[josm-dev] [PATCH] Regex support for search
Ævar Arnfjörð Bjarmason
avarab at gmail.com
Thu Jan 8 14:57:41 GMT 2009
On Thu, Jan 8, 2009 at 2:38 PM, Dirk Stöcker <openstreetmap at dstoecker.de> wrote:
> On Thu, 8 Jan 2009, Ævar Arnfjörð Bjarmason wrote:
>
>>> Some notes: You cannot add any text without tr(). It will not get
>>> translated. Either you make a marktr() around or you add it directly at
>>> the
>>> place where it is used and add a tr().
>>
>> I didn't know about that tr() restriction. Attached is a patch where I
>
> tr() has a double purpose:
> a) translating during runtime
> b) be a marker for translation parser
>
> If a strings should be translatable, then it must be marked somehow, so the
> parser for the i18n stuff finds it. Otherwise the software would translatate
> it, but the translaters don't know this and thus do not supply a
> translation. For purposes like yours marktr() exists. The is a
> String marktr(String s){return s;} for runtime, but allows to find strings
> for preparser. For C/C++ this is optimized to nothing, don't know if Java is
> clever enough to do so as well.
>
>> duplicate the error message for all the places where there can be
>> regex errors, more duplication but it eliminates the class variable I
>> was using to store the message.
>
> Already checked in with slight modifications :-) Sorry.
No problem, I don't know Java and have no idea what I'm doing :)
Thanks for the explanation on how tr() and marktr().
More information about the josm-dev
mailing list