My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Translations  
Translations of OI applications
Featured
Updated Mar 24, 2011 by ezelspin...@gmail.com

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 (old version).

Weekly workflow

You have changed some code (including some strings):

  • Run "bash androidxml2po.bash -e". This updates the .pot and .po files.
  • Create a tgz containing the .pot and .po file(s) in "./translations_aboutapp" (I include this last relative path in the tarball but I have yet to find out if this is really necessary). It's important that the files retain their name ("aboutapp") because this should match with the existing templates on Launchpad (or at least, I think so). Also don't ruin the encoding or the unix linebreaks.
  • Upload the tarball on Launchpad. To see the upload you need to go to exact series first. So on "https://translations.launchpad.net/openintents" there is no "Upload translations" link but if you click on "OpenIntents Series: trunk" then there is.
  • Wait a few days max. and you will get an email when done.

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

  • Create a similar folder/file structure as I have done for AboutApp.
  • In res/values/strings.xml add
    <string name="about_translators">
    translator-credits
    </string>
    .
  • Setup the variables in the script. "short_lang" And "long_lang": set to expected translated languages, see above. "launchpad_po_filename" is the name/prefix of the template. Make this the name of the subproject folder. This needs to be unique amongst subprojects so Launchpad can keep translations apart for the subprojects. The other variables should be correct unless you make some drastic changes or unless you change the folder structure.
  • Run "bash androidxml2po.bash -e". A .pot file is created.
  • Continue with the weekly workflow form here on. First time upload is a longer wait.
  • In case you already start with some translated strings.xml's this gets a little bit more complex. Make a backup and play with it would be my advice.

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 maca...@gmail.com, 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 project member peli0...@gmail.com, Nov 11, 2009
Comment by radinj...@gmail.com, Mar 24, 2012

Thy


Sign in to add a comment
Powered by Google Project Hosting