ApplicationRessource.properties 文件是否可以在除 EN 之外的其他语言环境中
Does ApplicationRessource.properties file can be in another locale than EN
Struts2 文件 applicationRessource.properties
是否可以使用英语以外的其他语言环境。我知道我可以有一些其他文件,例如 ApplicationRessource_fr.properties
或 ApplicationRessource_es.properties
.
我的主要问题只涉及 ApplicationRessource.properties
。我的默认语言是法语,我不想要 ApplicationRessource_fr.properties
这样的文件。有办法吗?
如果您想使用法语语言环境,您必须有一个类似 ApplicationRessource_fr.properties
的文件。您还可以有一个默认语言文件,如果没有请求语言环境,将使用该文件。应用程序的基本部分包括用于拦截请求的语言环境的拦截器,您还可以根据请求切换语言环境。
It's likely no i18n interceptor on the action stack or you don't have
resource bundles for the used locale or default locale used by the
JVM.
Essentially, the i18n Interceptor pushes a locale into the ActionContext map upon every request. The framework components that
support localization all utilize the ActionContext locale.
这是我们找到的解决方案。我们使用 3 个文件。 ApplicationRessource.properties 是法语,ApplicationRessource_fr.properties 是空的,ApplicationRessource_en.properties 是英文翻译
Struts2 文件 applicationRessource.properties
是否可以使用英语以外的其他语言环境。我知道我可以有一些其他文件,例如 ApplicationRessource_fr.properties
或 ApplicationRessource_es.properties
.
我的主要问题只涉及 ApplicationRessource.properties
。我的默认语言是法语,我不想要 ApplicationRessource_fr.properties
这样的文件。有办法吗?
如果您想使用法语语言环境,您必须有一个类似 ApplicationRessource_fr.properties
的文件。您还可以有一个默认语言文件,如果没有请求语言环境,将使用该文件。应用程序的基本部分包括用于拦截请求的语言环境的拦截器,您还可以根据请求切换语言环境。
It's likely no i18n interceptor on the action stack or you don't have resource bundles for the used locale or default locale used by the JVM.
Essentially, the i18n Interceptor pushes a locale into the ActionContext map upon every request. The framework components that support localization all utilize the ActionContext locale.
这是我们找到的解决方案。我们使用 3 个文件。 ApplicationRessource.properties 是法语,ApplicationRessource_fr.properties 是空的,ApplicationRessource_en.properties 是英文翻译