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

further i18n context improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.