Label in languages.tpl
Hello,
how can i change the languages-labels from "DE" or "EN" to "German" or "English"? I think, i must change the "label" in {$languages.label|uppercase} - but how? "msg" works not, "massage" works not... What can i do?
Thanks for the help, Jan ;o)
I created a short template modifier to do is.
Folow this steps and it will work:
Add in file frontend/core/engine/template.php on line 247
// Get language label
$this->mapModifier('languagelabel', array('FrontendTemplateModifiers', 'languageLabel'));
In the same file add the following on line 869
/**
* Get language label for a language code
* syntax: {$var|languagelabel}
*
* @param string $var
*
* @return string
*/
public static function languageLabel($var = null)
{
return FL::getLabel(strtoupper($var));
}
Now the template modifier is created you can call it in your template with:
{$LANGUAGE|languagelabel}
Or even with:
{$language.label|languagelabel}
What it does:
- Fetch the template var
- Get the Frontend label for a language
- Return this label
I hope this helps you out.