Where to place i18n key strings in Java

前端 未结 8 2774
不思量自难忘°
不思量自难忘° 2021-02-20 04:10

When doing internationalization in Java, you assign a string key to each message. What\'s the best practice, on where to place those string keys. Goal is to allow easy refactori

8条回答
  •  甜味超标
    2021-02-20 04:40

    IMHO ResourceBundle facilitates usage of Locale specific properties files. In order to use ResourceBundle, properties files should be named according to following convention :-

    BaseName_langCode.properties
    

    OR

    BaseName_langCode_countryCode.properties
    

    You can use the properties files.

提交回复
热议问题