Hi,

I think I figured this out now. As Simon pointed out, there are infrequent plugin i18n updates, so you don't need to do anything at all. But if you want to update the translations of a plugin more frequently:

There is an automatic process that extracts the language strings from the JOSM core and all plugins that are committed to [2]. That process is run once a day and the language strings are uploaded to Launchpad. See the Launchpad import queue [3] for the last upload/import. After the upload to Launchpad the strings are available for translation. Thus, all you need to do to start the translation is to commit the code.

There are several ways to download the translations.

1) Create a new Launchpad project for the plugin. Launchpad has a global pool of translations and all strings that are translated for JOSM can be copied to the plugin project and vice versa. The advantage is that you can download only the translated strings needed for the plugin. But the big disadvantage is that the translations need to be copied manually within Launchpad. I.e. you need to copy the translation of every string in every language separately. And there is no way to know when a translations changes in JOSM, so you cannot update the translation in the plugin project.

If you copy translations you are asked to make sure that you comply to the license of the other project, JOSM in our case. That means the plugin projects needs the same license that JOSM has. Or Launchpad's BSD license.

It's interesting that people will actively search for new projects and untranslated strings. My plugin project was translated to Ukrainian shortly after I uploaded the POT file.

2) Use the "download translation tarballs" link [4]. You need a Launchpad account to do that. After about 20 minutes you get an email with a download link.

3) The JOSM translations are synchronized with a Bazaar branch [5] once a day.

3a) My first idea was to check out that branch. Then it is easy to update to the latest version of the translations. But Bazaar is one of those revision control systems where you get the complete repository in your working copy. I stopped the "bzr branch lp:~openstreetmap/josm/josm_trans" operation after 600MB were downloaded. There is no point in downloading and keeping gigabytes of repository data for just a few translations.

3b) The nice thing about the Launchpad Bazaar branch is that you can download a tarball for a revision. E.g. [6] for the current revision 749. This is the best way to download the translations, no need for a Launchpad account, no need to wait for emails.

Once you have the translations downloaded the next steps are straight forward: Update the translation template (*.pot, xgettext), merge the translations (msgmerge), remove unnecessary translations (msgattrib), and generate the *.lang files in the data directory.

This is my translation flow for the PhotoAdjust plugin [7]. It assumes that all translations are done at Launchpad. The POT and PO files are stored on the directory po:

ant pot
./poimport.pl 749
./pomerge.pl
ant lang

The first step creates/updates the translation template po/photoadjust.pot. It uses the gettext-ant-tasks.jar from the i18n directory ([8]). The second step (poimport.pl) downloads all JOSM translations for revision 749 (see [5] for latest revision) as tarball. The PO files are extracted from the tarball and copied into the po directory next to the translation template. The third step (pomerge.pl) runs msgmerge and msgattrib. I added msgattrib because I need just the 8 strings in the 6 available languages and not all 8526 string in 77 languages. Fuzzy strings are removed because i18n.pl will do the same. The last step runs "../../i18n/i18n.pl data po/*.po". That generates the data/*.lang files.

The complete flow runs a few seconds plus the time to download all JOSM translations. It is much faster than to run the complete translation process in directory i18n ([8], ./launchpad.pl http://launchpadlibrarian.net/nnnn/launchpad-export.tar.gz).

Regards,
Holger

[2] http://svn.openstreetmap.org/applications/editors/josm/plugins/
[3] https://translations.launchpad.net/josm/trunk/+imports
[4] https://translations.launchpad.net/josm/trunk/+export
[5] https://code.launchpad.net/~openstreetmap/josm/josm_trans
[6] http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/749
[7] http://svn.openstreetmap.org/applications/editors/josm/plugins/photoadjust/
[8] http://svn.openstreetmap.org/applications/editors/josm/i18n/

Am 22.11.2013 14:02, schrieb Holger Mappt:
Hi,

JOSM core and all plugins from the JOSM plugins SVN repository are
translated with Launchpad.  There is documentation how to to work with
the complete set of strings (some 8000+).  But how do I get the
translation for the 10 strings of a single plugin?  Is there a
description how to get a small subset of the translations?  Would it
make sense to create a new Launchpad project for the plugin as it would
share the translations with JOSM?

If I understand it correctly, the license of the translations will be
Launchpad's BSD license or JOSM's license, GPL v2+.  JOSM's license
because it is the registered Launchpad project and according to the
Launchpad Terms of Use: "Translations of groups of strings from the same
project ... are made available ... to you under the licence applicable
to the project" [1].  That means the plugin would need to be release
under one of the two licenses as it includes the translations in the JAR
file.  Or does the plugin itself count as "project"?

Thanks,
Holger

[1] https://help.launchpad.net/TermsofUse#Translations_copyright


_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to