zoukankan      html  css  js  c++  java
  • Java国际化资源文件的选择

     

    如果Locale为:language_country,操作系统的Locale为xx_YY则选择资源文件的顺序为:

                  (一)如果存在message_language_country.properties,查找key值的顺序为:

                 message_language_country.properties

                 message_language.properties

                 message.properties

     (二)否则,如果存在message_language.properties,查找key值的顺序为:

                 message_language.properties

                 message.properties

     (三)否则,如果存在message_xx_YY.properties,查找key值的顺序为:

     message_xx_YY.properties

     message_xx.properites

     message.properties

     (四)否则,如果存在message_xx.properties,查找key值的顺序为:

     message_xx.properites

     message.properties

     (五)否则,如果存在message.properties,查找key值的顺序为:

     message.properties

    如果Locale为language,操作系统的Locale为xx_YY则选择资源文件的顺序为:

    1. message_language.properties
    2. message_xx_YY.properties
    3. message_xx.properties
    4. message.properties

    ps:首先需要确定使用哪个系列的资源文件(基本名称相同,语言和国家不同),其次确定优先使用哪个资源文件中的资源,再次确定当该资源文件中没有资源时查找其他资源文件的顺序

  • 相关阅读:
    对于 redux 的一些理解-1.基础
    css 优化
    HTML 理解标签
    css 理解盒模型
    json2.js JSON解析程序
    DOM 核心
    居中
    Director.js
    jquery-2.0.3 源码分析 整体架构
    Zookeeper安装
  • 原文地址:https://www.cnblogs.com/chunchengwuchu/p/4029641.html
Copyright © 2011-2022 走看看