Ticket #17526: SearchDialog-added-Context.patch

File SearchDialog-added-Context.patch, 4.1 KB (added by Hb---, 5 years ago)

This additional patch provides a "search string example" translation context to all new strings. The context can help to avoid translating key words.

  • .java

    ==================================================================
    old new  
    22package org.openstreetmap.josm.gui.dialogs;
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
     5import static org.openstreetmap.josm.tools.I18n.trc;
    56
    67import java.awt.Cursor;
    78import java.awt.Dimension;
     
    275276                .addKeyword(tr("Baker Street"), null, tr("''Baker'' and ''Street'' in any key"))
    276277                .addKeyword(tr("\"Baker Street\""), "\"\"", tr("''Baker Street'' in any key"))
    277278                .addKeyword("<i>key</i>:<i>valuefragment</i>", null,
    278                         tr("''valuefragment'' anywhere in ''key''"), tr("name:str matches name=Bakerstreet"))
     279                        tr("''valuefragment'' anywhere in ''key''"),
     280                        trc("search string example", "name:str matches name=Bakerstreet"))
    279281                .addKeyword("-<i>key</i>:<i>valuefragment</i>", null, tr("''valuefragment'' nowhere in ''key''")),
    280282                GBC.eol());
    281283        hintPanel.add(new SearchKeywordRow(hcbSearchString)
     
    288290                .addKeyword("\"key\"=\"value\"", "\"\"=\"\"",
    289291                        tr("to quote operators.<br>Within quoted strings the <b>\"</b> and <b>\\</b> characters need to be escaped " +
    290292                                "by a preceding <b>\\</b> (e.g. <b>\\\"</b> and <b>\\\\</b>)."),
    291                         tr("name=\"Baker Street\""),
     293                        trc("search string example", "name=\"Baker Street\""),
    292294                        "\"addr:street\""),
    293295                GBC.eol().anchor(GBC.CENTER));
    294296        hintPanel.add(new SearchKeywordRow(hcbSearchString)
    295297                .addTitle(tr("combinators"))
    296298                .addKeyword("<i>expr</i> <i>expr</i>", null,
    297299                        tr("logical and (both expressions have to be satisfied)"),
    298                         tr("Baker Street"))
     300                        trc("search string example", "Baker Street"))
    299301                .addKeyword("<i>expr</i> | <i>expr</i>", "| ", tr("logical or (at least one expression has to be satisfied)"))
    300302                .addKeyword("<i>expr</i> OR <i>expr</i>", "OR ", tr("logical or (at least one expression has to be satisfied)"))
    301303                .addKeyword("-<i>expr</i>", null, tr("logical not"))
     
    319321                    GBC.eol().anchor(GBC.CENTER));
    320322            hintPanel.add(new SearchKeywordRow(hcbSearchString)
    321323                .addTitle(tr("metadata"))
    322                 .addKeyword("user:", "user:", tr("objects changed by user"), tr("user:anonymous"))
    323                 .addKeyword("id:", "id:", tr("objects with given ID"), tr("id:0 (new objects)"))
    324                 .addKeyword("version:", "version:", tr("objects with given version"), tr("version:0 (objects without an assigned version)"))
     324                .addKeyword("user:", "user:", tr("objects changed by author"),
     325                        trc("search string example", "user:<i>OSM username</i> (objects with the author <i>OSM username</i>)"),
     326                        trc("search string example", "user:anonymous (objects without an assigned author)"))
     327                .addKeyword("id:", "id:", tr("objects with given ID"),
     328                        trc("search string example", "id:0 (new objects)"))
     329                .addKeyword("version:", "version:", tr("objects with given version"),
     330                        trc("search string example", "version:0 (objects without an assigned version)"))
    325331                .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID"),
    326                         tr("changeset:0 (objects without an assigned changeset)"))
     332                        trc("search string example", "changeset:0 (objects without an assigned changeset)"))
    327333                .addKeyword("timestamp:", "timestamp:", tr("objects with last modification timestamp within range"), "timestamp:2012/",
    328334                        "timestamp:2008/2011-02-04T12"),
    329335                GBC.eol());