[josm-dev] question about UI strings in plugins
Karl Guggisberg
karl.guggisberg at guggis.ch
Sun Apr 18 13:07:13 BST 2010
> I think it has changed, right?
Yes. The rules are much simpler now:
* Always escape single quotes with '', regardless of whether you use tr(), trn(), or trc().
#4160 <http://josm.openstreetmap.de/ticket/4160> still claims that double quotes won't work in the french translation but the ticket has
never been confirmed and it is probably outdated.
Regards
Karl
Am 18.04.2010 13:47, schrieb Sebastian Klein:
> Frederik Ramm wrote:
>
>> Simply add whatever you want in a tr() call. That serves as a hook for
>> the i18n engine but of it remains untranslated then it will just display
>> as-is. Make sure to use proper number formatting and the singular/plural
>> stuff (trn()).
>>
> There is some kind of script that runs over all the source files and
> collects the strings for translation. (in the folder editors/josm/i18n)
> The strings are uploaded to launchpad and all the translations are then
> copied to core/data/*.lang. This is done manually approximately once a week.
>
> From the wiki page
> http://josm.openstreetmap.de/wiki/DevelopersGuide/StyleGuide :
>
> wrong: new JLabel(tr("My Label " + labelId));
>
> right: new JLabel(tr("My Label {0}", labelId));
>
>
> Can anyone confirm that the following still holds:
>
> >>>>>>>>>
>
> For simple strings without substitution you need not change anything:
>
> new JButton(tr("Don't press me!"))
>
> For tr with more than one parameter, the apostrophe is special. (Like
> backslash in C)
> It needs to be escaped by another apostrophe:
>
> new JButton(tr("Don''t press me more than {0} times!", n))
>
> <<<<<<<<<
>
> I think it has changed, right?
>
> __
>
> Sebastian
>
> _______________________________________________
> josm-dev mailing list
> josm-dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/josm-dev
>
>
More information about the josm-dev
mailing list