Need display (in index site ) current locales selected

Hello community.

I want to be a variable with the current locale selected in the site index (es_ES or en_US). (ojs 2.4.8)
I modify:
templates/site/site.tpl → variable {$formLocale}

pages/index/ → $templateMgr->assign(‘formLocale’, $site->getCurrentLocale(‘locale’));

I defines the function getCurrentLocale .
It does not work like this.

  1. Where the functions of “site” defined?
  2. a better choice: There is an already defined function to report the current locale used in site? what do you recomend? (surely there is a definite function to do this but I do not know)


In your case, the current locale is probably related to the user’s session, not to the site. The site supports multiple locales, and defines a default locale, but never has a “current” locale. The user’s session selects one of these available locales as the current locale. This is stored in the session variable named “currentLocale” (for example, this is set in the UserHandler).

The equivalent get would be: $session->getSessionVar('currentLocale'), assuming $session is a Session.

great @ctgraham . Exactly, you could understand my query :).

                $sessionManager =& SessionManager::getManager();
		$session =& $sessionManager->getUserSession();
		$session =& $request->getSession();
		$templateMgr->assign('formLocale', $session->getSessionVar('currentLocale'));


Best Regards