09-二次开发教程-国际化-v8

2018-03-23 17:44 阅读

/src/main/resources/conf/plugin/plug/conf.properties中指定国际化文件位置:

messageSource.basenames.plug=classpath:messages/plugin/plug/plug
messageSource.basenames.plugfore=classpath:messages/plugin/plugfore/plugfore

系统中其他的国际化文件在/src/main/resources/conf/conf.properties文件中指定:

messageSource.basenames.common=classpath:messages/common/common
messageSource.basenames.core=classpath:messages/core/core
messageSource.basenames.corefore=classpath:messages/corefore/corefore
messageSource.basenames.ext=classpath:messages/ext/ext
messageSource.basenames.extfore=classpath:messages/extfore/extfore

这些配置会在/src/main/resources/conf/context.xml文件中加载:

    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="cacheSeconds" value="${messageSource.cacheSeconds}"/>
        <property name="basenames" value="#{propertiesHelper.getList('messageSource.basenames.')}"/>
        <property name="fallbackToSystemLocale" value="false"/>
        <property name="alwaysUseMessageFormat" value="false"/>
        <property name="defaultEncoding" value="UTF-8"/>
    </bean>
QQ咨询
电话
微信
微信扫码咨询