Internationalization: properties best practices

Discussion in 'Java' started by Karsten Wutzke, May 9, 2007.

  1. Hi all!

    I have several language packs (locales) that I wish to support via
    ResourceBundle:

    "en_US"
    "en_GB"
    "de"
    "fr"
    "es"
    .... (no more locales with country codes)

    These are all backed by .properties files delivered within the JAR.

    LanguagePack_en_US.properties
    LanguagePack_en_GB.properties
    LanguagePack_de.properties
    LanguagePack_fr.properties
    LanguagePack_es.properties
    ....

    1. Do you usually deliver a language pack called "en", too? Why or why
    not? In my case, every file delivered gets selectable in the GUI so it
    is rather undesirable to do so... (?)

    2. Do you usually create the root locale language pack
    "LanguagePack.properties" as a class?

    3. The default locale will be "en_US". This is the fallback language
    pack if nothing else goes (as far as I understand). So in "en_GB",
    would I only put key-value pairs into that file that are different
    from the parent "en" or root language pack? If the root language pack
    contained all key-values of the "en_US" properties file the file
    LanguagePack_en_US.properties could essentially become empty (no
    matter if I created the root language pack created via a property file
    or via class file). Is that the/a best practice?

    4. As a German, I might also create the root package in German and
    leave the "de" file empty, how would I proceed with the key-value
    pairs of "en_US" and "en_GB" then? Create an "en" language pack, make
    "en_US" file empty and put only the differences into "en_GB"? (I would
    then have to deal with the "en" being selectable problem but thats
    another issue)

    Comments anyone?

    TIA
    Karsten
     
    Karsten Wutzke, May 9, 2007
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.