[josm-dev] Translators and Context driven translation
Ævar Arnfjörð Bjarmason
avarab at gmail.com
Sun Sep 20 23:02:01 BST 2009
On Sun, Sep 20, 2009 at 8:23 PM, Dirk Stöcker
<openstreetmap at dstoecker.de> wrote:
> as I still do not like to introduce context based translation for josm,
> but on the other side we have conflicting strings in JOSM I now
> implemented the middle way:
>
> When a string starts with ~ everything between ~ and the next : is
> stripped from it when displayed. This allows to make strings context
> based, whereas the text between ~ and : is the context.
It's good to know that this is finally being supported. When I brought
this up[1] in February you indicated that you were not interested in
supporting any sort of context within translations. But with this
feature applied I'll be able to translate JOSM without the UI being
full of grammar errors. Yippie!
As I said[2] in that thread the gettext format has a native facility
for specifying contexts since release 0.15. However it appears the
Java implementation we're using doesn't support that. So either that
has to be improved or we're going to have to use this hack, I'd prefer
the hack to nothing at all.
However a /standard/ hack is better than something ad-hoc JOSM comes
up with. It looks like Launchpad already supports the hacky way KDE
used to do this:
https://bugs.launchpad.net/rosetta/+bug/3990
This documentation explains how it works:
http://l10n.kde.org/docs/translation-howto/gui-peculiarities.html
And here's a more general overview of such hacks:
http://leonardof.org/2007/12/01/context-in-gnome-translations/en/
If you're interested in using the KDE hack this is how they do it:
http://lists.kde.org/?l=kde-commits&m=110709737032487&w=2
and here's the resulting .po file:
http://l10n.ubuntu.tla.ro/rosetta-intrepid-build//po/mn/kdelibs.po
So to get Launchpad support it looks like all you have to do is replace:
tr("~filter:E")
with:
tr("_: filter\nE")
I don't know what native support of context actually means in
Launchpad. Hopefully it means that if you have "_:Ctxt1\nBar" and
"_:Ctxt1\nBar" and only translate the first string the second string
will still show up translated. I.e. context will have been something
optional the translator can add if he or she wants.
> Please report conflicts of translations, where this marking should be
> used, so we can add the context to these.
Can I get commit access so that I can fix these up when I see them?
I've been fixing up i18n issues in the OpenStreetMap website whenever
I see them and I'm a lot more likely to do it if I only have to open a
.java file & edit it instead of filing a bug / submitting a patch /
sending messages to the mailing list for each of those issues.
1. http://www.mail-archive.com/josm-dev@openstreetmap.org/msg01765.html
2. http://www.mail-archive.com/josm-dev@openstreetmap.org/msg02179.html
More information about the josm-dev
mailing list