How to Identify current locale in OJS 3.1?

Dear all
In registration page I want to know what language/locale is set, in order to put some more fields if specific language/locale is set.
I want current locale of the site. How can I recognize what locale is set by user by if statement?
Thanks a lot

Hi @MJB

Do you need it in the smarty template? If so you can access it with the variable {$currentLocale}.

Best,
Bozana

1 Like

Dear @bozana
Yes I mean in the smarty template. It works.
Thank a lot

@bozana Thanks for your answers. And how can I recognize the current locale in the main php file of the child theme in the init() function?

Hi @crosfield

In the PHP code AppLocale::getLocale() is used to get the current locale, so I think you can use that…

Best,
Bozana