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

  • 相关阅读:
    linux 常用命令
    ubuntu 安装在硬盘与配置
    linux管道符、重定向与环境变量
    linux用户身份与文件权限
    centos开启ftp服务
    js实现常见排序算法
    算法分析
    Vim
    CSS的3种使用方法
    cookie 在登录时的存储,获取,清除
  • 原文地址:https://www.cnblogs.com/chunchengwuchu/p/4029641.html
Copyright © 2011-2022 走看看