legacy-knowledge-base
公開されました Jul. 2, 2025

URL上の言語+ロケールID(国コード)はどの様に設定されていますか。

written-by

Hamasaki Yutaro

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

learn-legacy-article-disclaimer-text

問題

  • URL上の言語+ロケールID(国コード)はどの様に設定されているのでしょうか。

環境

  • DXP7.0+

解決

  • クッキーのGUEST_LANGUAGE_IDは、言語+国コードとなっております。
    次の様なURLが、双方とも動作します。
    http://localhost:8080/en/(言語のみ)
    http://localhost:8080/en_US/(言語+国コード)
  • また、URLの言語コードは次のプロパティが関連しており、
    デフォルトでは「3」が設定されています。
    locale.prepend.friendly.url.style=3
    この場合、ユーザのデフォルトの言語と表示言語が異なる場合のみ、言語コードが表示されます。
    常に言語コードが出る様に設定したい場合、「1」を設定してください。
    ロケールIDをURL の先頭に自動的に追加したい場合、「2」に設定します。
    この場合、ロケールIDのみで各 URL で 1 つの言語を指すことを意味します。

追加情報

 

did-this-article-resolve-your-issue

legacy-knowledge-base