My favorites | Sign in
Project Logo
                
Search
for
Updated Jun 05, 2009 by ezelspinguin
Labels: Featured
Translations  
Translations of OI applications

Translations

Please visit the OpenIntents translation project at Launchpad to help with translations.

Information for developers

Translated resources of the Android respository

Android source: http://android.git.kernel.org/

Other resources

  • SwitchLocale: Small Windows .bat scripts to switch the locale in the emulator with a double click of the file.
  • To switch the locale manually, do
  • adb shell "echo de-DE > /data/locale; stop; sleep 5; start"
  • Sun Solaris Style Guides for various languages.

How to convert strings.xml to .po/.pot files

First of all, get the androidxml2po.bash script.

Weekly workflow

You have changed some code (including some strings):

More strings have been translated on Launchpad:

  • Request "Download translations" on Launchpad (PO format).
  • Wait a few hours for an email with a download link.
  • Get the tarball and unpack the files into "./translations_aboutapp" (make sure they overwrite). Ofcourse the files that were there before should have been committed (sent to Launchpad and imported there) before you download new ones from launchpad.
  • (If translations for a new language were made, you need to add the language in the script: In short_lang the labels from the .po files ("nl", "zh_CN"), in long_lang the labels from the res/values folders ("nl-rNL", "zh-rCN").)
  • Make sure that in "translator-credits" all lines with translator names end with a ";" (or a "; ").
  • Run "bash androidxml2po.bash -i". This updates all the strings.xml's.

Setup workflow

Windows and Cygwin

To set up the scripts on a Windows machine, you will need:

  • Get Cygwin
  • Make sure that you install the following packages for Cygwin:
    • gettext
    • gettext-devel (for msgfmt and msgmerge)
    • python
    • python-libxml2
  • Download xml2po, for example through the Gnome-Doc-Utils
  • Make xml2po run from any directory. There may be a more clever way it, but I did it in the following way:
    • Copy the folder xml2po from Gnome-Doc-Utils into your home directory, so that the script can be found in ~/xml2po/xml2po.py
    • Create a new file called "xml2po" (without any file extension) with the following content:
    • #!/bin/bash 
      python ~/xml2po/xml2po.py "$@" 
    • and put it into /bin (C:\cygwin\bin)
    • Launch "Cygwin Bash Shell"
    • Now you should be able to call 'xml2po' from any directory.
  • Follow the instructions above.

More resources

http://groups.google.com/group/openintents/browse_frm/thread/84d7b059d0b15390


Comment by macarse, Nov 11, 2009

Hi, I've been trying to do this with an android project but I'm stuck.

  • I first run androidxml2po.bash -e and it created a pot file. Then I upload it to launchpad and wait for acceptance.

  • File was accepted.

Then I downloaded that pot file and place it on /translations but when I run ./androidxml2po.bash -e it prints: Exporting .xml to .pot and nothing happens.

I also tried to open poedit and create a file from a pot file. I translated a couple of strings and run ./androidxml2po.bash -e again. Exporting .xml to .pot Exporting .xml to updated .po for es Making temporary folder: .tmp.. Merging translations for smspopup-es: 0 translated messages, 170 untranslated messages.

What am I doing wrong? Thanks for reading.

Comment by peli0101, Nov 11, 2009

Sign in to add a comment
Hosted by Google Code