Support > Elxis 4.x/5.x DEV
Show full language name instead of ISO code in language switcher (FIVE template)
seadhna:
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?
michalis1984:
Did you try to change the settings on the language module?
seadhna:
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.
michalis1984:
Correct. It needs a change at template level at file five.class.php
datahell:
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']
Navigation
[0] Message Index
[#] Next page
Go to full version