Changeset 2179 in josm for trunk/src/org


Ignore:
Timestamp:
2009-09-21T12:19:11+02:00 (15 years ago)
Author:
stoecker
Message:

further i18n context improvements

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Filters.java

    r2177 r2179  
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.trc;
    45
    56import javax.swing.table.AbstractTableModel;
     
    140141   public String getColumnName(int column){
    141142      String[] names = { /* translators notes must be in front */
    142           /* column header: enable filter */             tr("_: filter\nE"),
     143          /* column header: enable filter */             tr("filter","E"),
    143144          /* column header: hide filter */               tr("H"),
    144145          /* column header: filter text */               tr("Text"),
  • trunk/src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java

    r2178 r2179  
    55import static org.openstreetmap.josm.tools.I18n.tr;
    66import static org.openstreetmap.josm.tools.I18n.trn;
     7import static org.openstreetmap.josm.tools.I18n.trnc;
    78
    89import java.awt.Color;
     
    156157            points += c.size();
    157158        }
    158         String tool = data.size()+" "+trn("_: gps\ntrack", "_: gps\ntracks", data.size())
     159        String tool = data.size()+" "+trnc("gps", "track", "tracks", data.size())
    159160        +" "+points+" "+trn("point", "points", points);
    160161        File f = getAssociatedFile();
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r2177 r2179  
    3131    public static final String tr(String text, Object... objects) {
    3232        if (i18n == null)
    33             return filter(MessageFormat.format(text, objects));
     33            return MessageFormat.format(filter(text), objects);
    3434        return filter(i18n.tr(text, objects));
    3535    }
     
    4141    }
    4242
     43    public static final String trc(String ctx, String text) {
     44        if (i18n == null)
     45            return text;
     46        return i18n.trc(ctx, text);
     47    }
     48
    4349    public static final String marktr(String text) {
    4450        return text;
     
    4753    public static final String trn(String text, String pluralText, long n, Object... objects) {
    4854        if (i18n == null)
    49             return filter(n == 1 ? tr(text, objects) : tr(pluralText, objects));
     55            return n == 1 ? tr(text, objects) : tr(pluralText, objects);
    5056        return filter(i18n.trn(text, pluralText, n, objects));
    5157    }
     
    5359    public static final String trn(String text, String pluralText, long n) {
    5460        if (i18n == null)
    55             return filter(n == 1 ? tr(text) : tr(pluralText));
     61            return n == 1 ? tr(text) : tr(pluralText);
    5662        return filter(i18n.trn(text, pluralText, n));
     63    }
     64
     65    public static final String trnc(String ctx, String text, String pluralText, long n, Object... objects) {
     66        if (i18n == null)
     67            return n == 1 ? tr(text, objects) : tr(pluralText, objects);
     68        return i18n.trnc(ctx, text, pluralText, n, objects);
     69    }
     70
     71    public static final String trnc(String ctx, String text, String pluralText, long n) {
     72        if (i18n == null)
     73            return n == 1 ? tr(text) : tr(pluralText);
     74        return i18n.trnc(ctx, text, pluralText, n);
    5775    }
    5876
Note: See TracChangeset for help on using the changeset viewer.