Reputation: 11
I want to write a code in different languages using an
if (language = en || lenguage=es) {// code } (For example)
in a tpl file. How can I know what language the user is using?
Thanks!
Upvotes: 0
Views: 5864
Reputation: 1117
In Prestashop 1.7 it seems that the correct way to read the iso code of the current language is
{$language.iso_code}
To find out all the properties of the object:
{$language|@var_dump}
Upvotes: 1
Reputation: 1301
To print the language i uses:
{$cookie->id_lang}
You could use:
{if $cookie->id_lang == '<id_language>'} {/if}
Upvotes: 0
Reputation: 2987
In front office use the lang_iso variable:
{if $lang_iso == 'en'}code{/if}
Upvotes: 1