配置SSM项目文件国际化

57 阅读1分钟

1.html国际化在 mvc-core-config.xml 里  配置即可

<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">    
    <property name="basenames">       
        <list>
            <value>messages/common</value>

2.JS国际化在html文件里引入关于js文件国际化

<script src="jquery.i18n.properties.js"></script>

在引入具体的文档 文件名

<script>    
    jQuery.i18n.properties({        
        name:['home'],        
        path: 文件的地址,
        mode:'both',        
        async: false,        
        cache: true    
    });
</script>