Legacy Knowledge Base
Published Jul. 2, 2025

en_US and en_GB is available and it is always displayed in long-form

Written By

Rita Schaff

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • We want to have both American English and British English available in the Instance settings, but only use one of them on a site that has a non-English language set as the default language.
  • The URL should be displayed as follows: www.portal.com/en
    but the long form of the language is shown: www.portal.com/en_GB
  • After changing the order of English languages in the Available Languages section, and brought en_GB before en_US. It resolved the issue for once, but with new changes to the environment, this change no longer works. The order of the languages no longer matters so the en_GB will display in the URLs in long-form.

Environment

  • DXP 7.2

Resolution

  • The default language of the portal is en_US, however, on home pages for other countries the available languages are a local language (e.g. de_DE) + en_GB (and not en_US).
  • The problem is related to these multilingual country pages, where the English language is appearing in the long-form in the URL with en_GB.

  • This is the intended behavior of Liferay because the core product is designed to use the long-form of en_GB and en_US to differentiate between them if they are both available.
  • This means that in order to achieve the needed behavior (having www.portal.com/en instead of www.portal.com/en_GB while 2 English language variations are enabled) means changing the core of a feature.

Workarounds

  • Delete one of the English locales.
  • You can try to configure a rule on the webserver level to redirect to the desired URL. This thread is an example of what we mean, or you can also see this article for nginx redirection for more detailed redirection examples.
  • Open a Feature Request that will be evaluated by our Product Team. 
    • This is our official process that will allow our Product Team to assess the request.
    • You can add your personal touch to the product by writing down the details in the description.
    • Feel free to add further comments to discuss the remaining details with the team.
    • Please note that the implementation of feature requests is subject to our developers' decision, and the new feature can only be added to our future Liferay releases.
  • Customization
    Modifying Liferay's source code and developing your own solution to fit your business needs are always available to you. Please note that doing so may result in limited support for bugs that originate from modifying the code.
  • Global Services Team
    Involve our Global Services team by reaching out to your Liferay representative.
Did this article resolve your issue ?

Legacy Knowledge Base