Changeset 4212 in josm for trunk/src/org


Ignore:
Timestamp:
2011-07-08T21:28:59+02:00 (13 years ago)
Author:
stoecker
Message:

reduce hardcoded I18n parts

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r4211 r4212  
    299299        });
    300300        return l;
     301    }
     302
     303    public static boolean hasCode(String code)
     304    {
     305        return languages.containsKey(code);
    301306    }
    302307
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r4211 r4212  
    6969        else if (full.equals("in"))
    7070            return "id";
    71         /* list of non-single codes supported by josm */
    72         else if (full.equals("en_GB") || full.equals("pt_BR") || full.equals("en_AU") || full.equals("zh_TW") || full.equals("zh_CN"))
     71        else if (I18n.hasCode(full)) /* catch all non-single codes */
    7372            return full;
    7473
     74        /* return single code */
    7575        return locale.getLanguage();
    7676    }
Note: See TracChangeset for help on using the changeset viewer.