Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

October CMS how to get current locale name?

Could you tell me please how i can get current language name or somthing like this.

I want customize Locale Switcher on web site based on October CMS.

It will be greate to recevie something like

...
{{ set var = ****.getLocale();}}
...
then use it for switch($var){}
...
like image 610
Ye K Avatar asked Dec 06 '22 16:12

Ye K


1 Answers

In twig you can access the current language with {{ activeLocale }}, the full language name with {{ activeLocaleName }} and an array with all locales available with {{ locales }}.

You could use {{ dump() }} to see all variables available on a page. If you try it you will find the locale variables right there as well.

like image 74
BenjaVR Avatar answered Jan 06 '23 13:01

BenjaVR