[josm-dev] [PATCH] Regex support for search

Dirk Stöcker openstreetmap at dstoecker.de
Thu Jan 8 14:38:15 GMT 2009


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.

Ciao
-- 
http://www.dstoecker.eu/ (PGP key available)


More information about the josm-dev mailing list