Elxis CMS Forum
Support => Elxis 4.x/5.x DEV => Topic started by: seadhna on October 18, 2020, 18:09:10
-
Hi, is it possible in the select-box of the language-switcher in the FIVE template, to display the full language names, instead of the 2-letter ISO code? e.g. English instead of EN?
-
Did you try to change the settings on the language module?
-
In the FIVE template, the language module is not required. There is a parameter in the Template settings: "Display language selection? Available only if 2 or more languages are published".
This is better because it allows switching languages on tag index pages.
-
Correct. It needs a change at template level at file five.class.php
-
Template Five uses an internal language selector and not the module. The template is designed to use the 2 letter language code in order to fit properly on the available space under all circumstances. I advise you not to change it.
However if you want to change here is how to do it.
Open file templates/five/includes/five.class.php
Go to line 353:
$block_lang .= '<option value="'.$lng.'"'.$selected.' data-act="'.$link.'">'.strtoupper($lng)."</option>\n";
And change it to:
$block_lang .= '<option value="'.$lng.'"'.$selected.' data-act="'.$link.'">'.$info['NAME']."</option>\n";
If you want to display the English language names instead of the native ones then instead of $info['NAME'] use $info['NAME_ENG']
-
Thanks datahell!