Version 29



    All english strings used by the JEMS installer are defined in the file JEMSInstallerFolder/local-izpack/bin/langpacks/installer/eng.xml. It contains all strings for the standard IzPack panels, the user input panels and all names and descriptions of the packages.

    In the current repository there are two folders with two different versions of the JEMS Installer that must be translated:




    In order to translate the JEMS Installer you should follow these steps:


    1. Find the three-letter ISO 639-2 Code of the language you are translating in (see Note that eng is the english code and thus eng.xml.


    2. Create a file JEMSInstallerFolder/local-izpack/bin/langpacks/installer/xyz.xml, where xyz is the ISO code from step 1 (keep the code lower case)


    3. Copy the contents of eng.xml into xyz.xml.


    4. All strings are defined like this:

    <str id="" txt="english text"/>

    It consists of two parts - id and txt. id contains an identifier unique for each string and txt contains the english text.

    You must replace the "english text" with the translated words or sentences and nothing else. DO NOT MODIFY THE STRING IDs!


    5. Make sure the translated file is saved as JEMSInstallerFolder/local-izpack/bin/langpacks/installer/xyz.xml


    6. Open the file JEMSInstallerFolder/install.xml and find the <resources> section.


        6.1. Inside the <resources> section add the following two lines:

        <res id="packsLang.xml_xyz" src="@{izpack.langpacks}/xyz.xml"/>     <res id="userInputLang.xml_xyz" src="@{izpack.langpacks}/xyz.xml"/>


        6.2. Ensure that the <locale> section has a <langpack iso3="xyz"/> reference for your language. If it doesn't have one - add it.


    Remember to replace xyz with the language code (lower case) for both 6.1 and 6.2.


    7. For the Media Kit branch of the JEMS Installer repeat step 6 for JEMSInstallerFolder/install-jbossrules.xml and JEMSInstallerFolder/install-jbpm.xml. The translation files for all versions of the JEMS Installer are the same and you can use the same xyz.xml file in both the media kit version and the trunk.


    You can see a sample pseudo-translation for the cat language in the trunk here: (it contains the english strings prefixed with "cat:", no real translation).


    The sample install.xml can be found here:




    For the media kit folder you can see the same sample cat language translation (note the media kit has two more install files):




    Resources (EULA, Readme, Images)


    These will be integrated by the Installer team. Instructions where and how to translate these should already be available to the I18N team.


    Instructions for adding localized resources (for the Installer team)



    The <resources> section of the install.xml file contains:

        <res id="HTMLLicencePanel.licence" src="@{jboss.install}/JBossORG-EULA.html"/>     <res id="" src="@{jboss.dist}/readme.html"/>     <res id="Installer.image.0" src="@{jboss.install}/images/frame1.gif"/>     <res id="Installer.image.1" src="@{jboss.install}/images/frame2.gif"/>     <res id="Installer.image.2" src="@{jboss.install}/images/frame3.gif"/>     <res id="Installer.image.3" src="@{jboss.install}/images/frame4.gif"/>     <res id="Installer.image.4" src="@{jboss.install}/images/frame1.gif"/>     <res id="Installer.image.5" src="@{jboss.install}/images/frame2.gif"/>     <res id="Installer.image.5" src="@{jboss.install}/images/frame3.gif"/>     <res id="Installer.image.6" src="@{jboss.install}/images/frame4.gif"/>     <res id="Installer.image.7" src="@{jboss.install}/images/frame1.gif"/>     <res id="Installer.image.8" src="@{jboss.install}/images/frame2.gif"/>     <res id="Installer.image.9" src="@{jboss.install}/images/frame3.gif"/>

    Each line maps a resource id to a physical file (the src attribute). In order to localize these you must create separate physical files for each language. For example the French version of frame1.gif can be called frame1_fra.gif. In order to add it as a resource for the French langpack you must add the following line to the <resources> section:


        <res id="Installer.image.0_fra" src="@{jboss.install}/images/frame1_fra.gif"/>



    Note that the id of the resource has the _fra suffix. All localized resource id must have the _xyz suffix for the corresponding language. Other examples are HTMLLicencePanel.licence_fra for the EULA in French, HTMLInfoPanel.info_fra for the readme in French and so on.




    Supplement: Localization Infrastructure and Workflow


    In order to simplify the workflow of localization, there are batch commands (Makefile) and scripts implemented for conversion between JBoss Installer's string definition files (e.g. eng.xml and other "xyz.xml") and popular translation file in PO file format:


    Notes: Requires Linux environment, with GNU Make, Perl, Perl XML::DOM, and Inkscape, msginit, and msgmerge installed.




    (xml <-> po)






    (images <-> po)






    (readme <-> po)





    Merging PO/POT Files




    PO is a text-based file format for translation. It uses the original phrases as primary key. Due to the fundermantal differences between JBoss Installer localization files which uses GUI components "id" as primary key, the conversion scripts embedded "id" into PO files in order to perform backward conversion (PO => JBoss Installer localization files).




    POT is the template of PO files. When POT is generated from JBoss Installer localization files, the original phrases are in msgid fields with all the fields of translated string (msgstr) remained empty.



    POT => PO


    Then PO files could be generated from POT file by "msginit" command ("ab_CD" is country code, e.g. en, de, fr, ja, pt_BR, zh_CN, etc. Filename and location of POT file may vary in different situations.):


    $ cd JEMSInstallerFolder/po/spec $ msginit -i jbil.pot -o ab_CD.po





    When JBoss Installer localization files are updated and new POT files are generated for reflecting changes of the former, "msgmerge" command is needed for merging POT files into current progress PO files. i.e. Adding new entries for translation, removing unused entries which is not in JBoss Installer anymore ("ab_CD" is country code, e.g. en, de, fr, ja, pt_BR, zh_CN, etc. Filename and location of POT file may vary in different situations.):


    $ cd JEMSInstallerFolder/po/spec $ msgmerge ab_CD.po jbil.pot > ab_CD.po.tmp $ mv ab_CD.po.tmp ab_CD.po



    Running Conversion Facilities


    The above batch commands / scripts do exactly same as step 4 mentioned in the "String" chapter above. The followings are the method of conversion:



    Extracts all translatable strings in "xyz.xml" (XML => PO)


    - jbil.pot will be created in same directory:


    $ cd JEMSInstallerFolder/po/spec $ make pot



    Generates "xyz.xml" files from PO files (PO => XML)


    - All "xyz.xml" will be output to JEMSInstallerFolder/local-izpack/bin/langpacks/installer/xyz.xml)


    $ cd JEMSInstallerFolder/po/spec $ make xml



    Extracts all translatable strings in "ReadMe.xml" (XML => PO)


    - ReadMe.pot will be created in same directory:


    $ cd JEMSInstallerFolder/po/readme $ make pot



    Generates "ReadMe-ab_CD.html" files from PO files (PO => HTML)


    - All "ReadMe-ab_CD.html" will be output to JEMSInstallerFolder/local-izpack/readme/ReadMe-ab_CD.html


    $ cd JEMSInstallerFolder/po/readme $ make html



    Extracts all translatable strings in "frame?.svg" (SVG => PO)


    - frame?.pot will be created in "frame?/" directory on current directory:


    $ cd JEMSInstallerFolder/po/images $ make pot



    Generates "frame?.png" files from PO files (PO => PNG)


    - All "frame?-ab_CD.svg" will be output to JEMSInstallerFolder/local-izpack/images/frame?-ab_CD.html


    $ cd JEMSInstallerFolder/po/images $ make png