Translating GateIn

Version 3

    GateIn uses either standard property files or proprietary XML file to store localized strings.

     

    .properties or .xml ?

    You can choose one or the other, GateIn will adapt and use the one which is available for a certain language.

     

    .properties

    Advantages:

    • Standard
    • i18n keys are easy to find

    Drawbacks:

    • Requires to be converted with 'native2ascii' tool
    • Hard to read for languages such as Japanese, Russian...

    .xml

    Advantages:

    • Easy to read without any tooling (Encoding is defined by the XML file)

    Drawbacks:

    • No existing tool to compare to the English version

     

    For more explanations see, the reference guide.

     

    Starting

    To start more easily, I added the files to translate in the attached file named GateInLocalization_rxxxx.zip (where xxxx corresponds to the revision number when the files where taken).

     

    A script (rename.sh) is available to rename all the template files to the equivalent for a certain language. Do "rename.sh" followed by the 2 letters language code for the language you are willing to create. See this document to find it. If you are willing to contribute a German translation do "sh rename.sh de". You can also rename the files _xx.properties.tpl to _de.properties

     

    Once you have all the files you can decide to work on properties or XML files and start the translation.

     

    Once translated get the sources for GateIn:

    svn co http://anonsvn.jboss.org/repos/gatein/portal/trunk/ originalGatein

    And make a copy of it for later use:

    cp originalGatein modifiedGateIn

    Then copy the translated file in it (make sure to respect the hierarchy).

    cd modifiedGateIn
    cp -r ../GateInLocalization/* .
    

    Once that done you need to add the new language at the portal level, simply edit:

    ./web/portal/src/main/webapp/WEB-INF/conf/common/locales-config.xml

    To add your language such as:

      <locale-config>
        <locale>de</locale>
        <output-encoding>UTF-8</output-encoding>
        <input-encoding>UTF-8</input-encoding>
        <description>Default configuration for german locale</description>
      </locale-config>

    Once that done we need a copy of JBoss AS (or Tomcat), let's say it's in /home/user/ and the directory name of uthe unzipped AS is jboss-5.1.0.GA.

    Now we are ready to compile and package, go to the root of the modifiedGateIn:

    and run Maven:
    mvn install -Ppkg-jbossas -Dexo.projects.directory.dependencies=/home/user -Dexo.projects.app.jboss.version=jboss-5.1.0.GA
    

     

    If you get OutOfMemory errors, you need to adapt the parameters in file packaging/pkg/pom.xml.

     

    Go to http://localhost:8080/portal to see your work.

     

    Please contribute back your translation !

    diff -ruN originalGateIn modifiedGateIn > patchDE.diff

     

    Then create a new "Feature Request" for "GateIn Portal" in Jira "Translation in XXXX" and attach the file.

     

    Once that initial work done and committed it will be easier to work directly from SVN.