Comment on Translations in openintents

24 views
Skip to first unread message

openi...@googlecode.com

unread,
Nov 11, 2009, 10:46:03 PM11/11/09
to openi...@googlegroups.com
Comment by macarse:

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.

For more information:
http://code.google.com/p/openintents/wiki/Translations

openi...@googlecode.com

unread,
Nov 12, 2009, 1:54:57 AM11/12/09
to openi...@googlegroups.com
Comment by peli0101:

Please look at
http://groups.google.com/group/openintents/browse_frm/thread/e67d0edce196f29c#
for the discussion.

Peli

unread,
Nov 12, 2009, 1:55:53 AM11/12/09
to OpenIntents
What are you expecting at this stage?
Have you already translated some strings on Launchpad? There is no
automatic translation - someone has to translate each string manually.
Then you can download the translated .po files that you can import
using "-i" with the script.

Peli

Macarse

unread,
Nov 12, 2009, 4:48:15 AM11/12/09
to OpenIntents
My launchpad translations is empty. I just uploaded my .pot file.

My xmls are already translated. I was expecting that the smspopup-
es.po was going to be populated with my translated strings from the
xml but it didn't happen.

Should I first upload the untranslated po to launchpad, redownload and
then run the script?

Thanks.

Peli

unread,
Nov 12, 2009, 7:04:31 AM11/12/09
to OpenIntents
The script currently does not support that, since Launchpad changed
file naming convention at some point.

I wanted to include the possibility to export already translated
strings to .po file, but have not done so yet. It should only be a
minor change, and files should be named "es.po" in the end. If you
have time to look into it, and contribute your solution back, that
would be great. Otherwise I'll try to look into it at some point.

Peli

Macarse

unread,
Nov 12, 2009, 7:19:13 AM11/12/09
to OpenIntents
Oh, I thought it was possible.
I will try to find a walkaround or fix this because I have already
done a lot of translations.
I will try to start the Spanish translation and find a way to populate
my po files.
But I am a newbie to launchpad translations.
What should be the correct flow?

1) Get .pot from my /res/values/strings.xml
2) Upload to Launchpad.
3) Should I start the Spanish translation from launchpad or something
must be done with androidxml2po before?

Thanks.

Peli

unread,
Nov 12, 2009, 9:58:21 AM11/12/09
to OpenIntents
The bash file should produce both, .pot and various .po files, at
first, and then you upload all of them at the same time to Launchpad.

The original version of the bash script did this already, but had
wrong naming conventions, so it was deactivated. It should be
straightforward to activate it again with correct naming conventions.

Peli

Peli

unread,
Nov 14, 2009, 11:14:56 AM11/14/09
to OpenIntents
I've updated the bash script so that it will export the necessary .po
files:
http://code.google.com/p/openintents/source/browse/trunk/AboutApp/translations/androidxml2po.bash?spec=svn2387&r=2387

Note that .po files will be merged - so you need to have a .po file to
start with.

I would suggest the following:
* Upload your .pot file to Launchpad.
* Add at least one word in the language you need
* Download the tar file from Launchpad, which now contains the .po
file for the language.
* Run the new script. The merged .po files should appear in export_po.
* Tar the .pot and .po files and upload them to Launchpad.
* Wait for a few hours or days until your new translations got
accepted.

Hope this works,
Peli

Macarse

unread,
Nov 15, 2009, 11:53:08 AM11/15/09
to OpenIntents


On Nov 14, 1:14 pm, Peli <peli0...@googlemail.com> wrote:
> I've updated the bash script so that it will export the necessary .po
> files:http://code.google.com/p/openintents/source/browse/trunk/AboutApp/tra...
Peli, thanks for the update.
Please fix this:
rm "${export_po}"/* at line 43 should be rm -f rm "${export_po}"/* to
ignore nonexistent files.

When you said "Add at least one word in the language you need"
Which is the fastest way to do it?

I notice that if I enter my project's translation section it appears
only Spanish. (My launchpad user is located in Argentina).
So, for example, if I try to add a line to the Italian translations I
changed my profile and added Italian as working language.

Should I add all languages used in my project to my user profile?

Thanks.

Peli

unread,
Nov 16, 2009, 4:38:34 AM11/16/09
to OpenIntents
Thanks for the patch.

I think there is an even simpler method: Just copy the .pot file to
the .po file of the language you need. It is really the same file
format.

Peli
www.openintents.org

Peli

unread,
Nov 16, 2009, 6:08:55 AM11/16/09
to OpenIntents
Just so there is no misunderstanding:
You only need to copy .pot files to .po files for those languages,
where you already have existing translations.
For Launchpad, just add those languages to your profile that you can
translate.

You will see that as more and more people add translations in other
languages, those will be shown automatically.

You may also be interested in joining the Android-based projects team
on Launchpad, to make your project more visible:
https://launchpad.net/~android-projects-devs

Peli

Michael Elsdörfer

unread,
Dec 4, 2009, 1:28:33 PM12/4/09
to OpenIntents
FYI, after having a lot of trouble with xml2po when using nested tags,
I've written a script specifically to convert Android XML files to po
(and back) in Python. It also uses msgctx, i.e. can handle multiple
string resources with the same value:

http://github.com/miracle2k/android2po
Reply all
Reply to author
Forward
0 new messages