Internationalization in a website

后端 未结 2 695
闹比i
闹比i 2020-12-11 13:26

I m using ResourceBundle method getBundle(Propertyfilename,Local.languagename) class which returns an object of ResourceBundle of the local

rb = ResourceBundle.get

2条回答
  •  情书的邮戳
    2020-12-11 13:31

    1) Each properties file must be renamed by .properties where language_code is 2 character lower case language code and country_code is 2 letters UPPERCASE letter.

    E.g.

    MyResource_fr_FR.properties 
    

    specifies MyResource (fr for French, FR for FRANCE).

    To support Arabic in your properties file, you have to type escape sequences for the language.

    Arabic uses the ISO 8859-6 CharSet so (e.g.)

    if you have in your properties file:

    char_ren=\u00631, 8859_6_CHARSET
    

    char_ren will represent the Arabic CHARACTER RHEN.

    PS. Naming of your properties file will be

    MyResource_ar.properties
    

    The \u00631 is the hexadecimal value of the RHEN character.

提交回复
热议问题