Please note that the forum isn't realy used anymore.

If you have questions, want support or just simply want to talk to us you can find us on slack.

 

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:

  1. Fetch the template var
  2. Get the Frontend label for a language
  3. Return this label

I hope this helps you out.

Comment

The forum is deprecated in favor of our Slack channel, which provides real-time support for your issues.

Join us on Slack here: https://fork-cms.herokuapp.com/