Main Content

Magnolia Community Forums: Get help with Magnolia: Change language name on Admincentral selector


  • iokerhe1
    iokerhe1
    Full name: Francisco J. Giner
    Posts: 8
    Last post: Jul 12, 2017 10:46:55 AM
    Registered on: Aug 28, 2015
    Change language name on Admincentral selector
    #1 by iokerhe1 on Jul 11, 2017 11:36:48 AM

    Hi!

    Can someone tell us if it's possible to change language name on Admincentral selector? On pages app, for example. If it's possible, how?

    Thanks in advance :)

  • ahietala
    ahietala
    Full name: Antti Hietala
    Posts: 342
    Last post: Sep 14, 2017 11:48:40 AM
    Re: Change language name on Admincentral selector
    #2 by ahietala on Jul 11, 2017 1:38:20 PM

    Hi Francisco,

    The language names in the dropdown (English, German...) reflect each user's preferences. Choose a different language in your preferences and the dropdown will adapt accordingly (Englisch, Deutsch...). Click the Edit user profile action in the top right corner.

  • iokerhe1
    iokerhe1
    Full name: Francisco J. Giner
    Posts: 8
    Last post: Jul 12, 2017 10:46:55 AM
    Registered on: Aug 28, 2015
    Re: Change language name on Admincentral selector
    #3 by iokerhe1 on Jul 11, 2017 2:38:52 PM

    Hi Antti,

    We know that if you change your user language preference, that name changes accordingly. But what we want is change an specific language name, no matter what language you have selected on your user options.

    For example:

    English -> ENG or EN or ENGL (whatever)

    It this possible?

    Thanks.

  • ahietala
    ahietala
    Full name: Antti Hietala
    Posts: 342
    Last post: Sep 14, 2017 11:48:40 AM
    Re: Change language name on Admincentral selector
    #4 by ahietala on Jul 12, 2017 9:49:00 AM

    When you configure a locale in your site definition you can set the language code such as "pt" for Portuguese and the country code such as "BR" for Brazil but you cannot set the language name. Magnolia extends java.util.Locale which provides all the language names such as "Portuguese (Brazil)" and their translations. We don't store language names in Magnolia resource bundles so they are not configurable as far as I know.

    https://documentation.magnolia-cms.com/display/DOCS/Language+configuration#Languageconfiguration-3.Definelocalesinsite

    If you wanted to display the code "en" instead of the language name I believe you would have to extend the LanguageSelector which builds the dropdown.
    https://git.magnolia-cms.com/projects/MODULES/repos/pages/browse/magnolia-pages-app/src/main/java/info/magnolia/pages/app/editor/pagebar/languageselector

  • iokerhe1
    iokerhe1
    Full name: Francisco J. Giner
    Posts: 8
    Last post: Jul 12, 2017 10:46:55 AM
    Registered on: Aug 28, 2015
    Re: Change language name on Admincentral selector
    #5 by iokerhe1 on Jul 12, 2017 10:46:55 AM

    Hi Antti,

    We'll try extending LanguageSelector as you explains.

    Thanks for the information and have a nice day!

You don't have the permission to post on this thread

Sign in

To login on this forum, you can use your Magnolia Forge, Support or Partner account, or, below, your Google, Yahoo! or OpenID account. If you have trouble logging in, or any other sort of issue, please let us know in the Meta forum, on the user-list, or simply by email at forum-admin at magnolia-cms dot com.

* Required

... or sign in with:

  • icon http://{your-openid-url}
  • icon
  • icon https://me.yahoo.com/