Legacy Knowledge Base
公開されました Jun. 30, 2025

Liferay DXPで新しい言語を追加できない

Written By

Anushka Tiwari

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.

問題

  • 利用可能な言語から新しいロケール言語を設定し、現在の言語を 。 UIに以下のエラーが表示される。new-locale.png
  • 再現の手順
  1. [LIFERAY_HOME]/tomcat<version>/webapps/ROOT/WEB-INF/ web.xml ファイルの <web-resource-name> の下に移動して、 Web.xml に新しい言語を追加する。
<url-pattern>/am/c/portal/protected</url-pattern>
<url-pattern>/am-ET/c/portal/protected</url-pattern>
<url-pattern>/am_ET/c/portal/protected</url-pattern>

web.xml ファイルの <servlet-mapping> セクションの下にある:

<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am-ET/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am_ET/*</url-pattern>
	</servlet-mapping>

2. ポータル-ext.properties ファイルをインストールの Liferay Home フォルダに作成または変更します。 上記のファイルで ロケール を定義する。

locales=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP 3. 

3. N コントロールパネル> インスタンス設定 > その他 にアクセスし、使用可能な言語から新しい言語を現在の言語に追加します。
結果:エラー: 有効なロケールを入力してください。

環境

  • Liferay DXP 7.1

解像度

  • portal-ext.properties file in Liferay Home folder.を変更するたびに、 portal - ext . properties file in Liferay Home folder.を変更します。 このファイルは、 portal.properties ファイルで定義された有効なデフォルトロケールを上書きすることに注意してください。 したがって、 ポータル-ext.プロパティ ファイルで使用したいすべての言語をリストする。 ロケール と ロケール.有効. 例:

    locales=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP
    locales.enabled=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP

追加情報

Did this article resolve your issue ?

Legacy Knowledge Base