Changeset 19070 in josm for trunk/src


Ignore:
Timestamp:
2024-05-02T15:34:26+02:00 (7 months ago)
Author:
stoecker
Message:

see #23627 - use getOSMLocaleCodes also for naming primitives

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

Legend:

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

    r18814 r19070  
    381381     *
    382382     * @return the name of this primitive, <code>null</code> if no name exists
    383      * @see LanguageInfo#getLanguageCodes
     383     * @see LanguageInfo#getOSMLocaleCodes
    384384     */
    385385    default String getLocalName() {
    386         for (String s : LanguageInfo.getLanguageCodes(null)) {
    387             String val = get("name:" + s);
     386        for (String s : LanguageInfo.getOSMLocaleCodes("name:")) {
     387            String val = get(s);
    388388            if (val != null)
    389389                return val;
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r19046 r19070  
    191191                return new String[]{prefix+"zh-Hant-TW", prefix+"zh-Hant", prefix+"zh"};
    192192            default:
    193                 return new String[]{prefix+main};
     193                ArrayList<String> r = new ArrayList<String>();
     194                for (String s : LanguageInfo.getLanguageCodes(null)) {
     195                    r.add(prefix + s);
     196                }
     197                return r.toArray(String[]::new);
    194198        }
    195199    }
Note: See TracChangeset for help on using the changeset viewer.