Changeset 19725 in josm


Ignore:
Timestamp:
2026-12-02T11:44:28+01:00 (less than one hour ago)
Author:
stoecker
Message:

fix #25151 - add language code cnr and script cyrl as exception to internal I18n code, drop old exceptions for iw_IL and in (no longer needed in Java 17)

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

Legend:

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

    r19479 r19725  
    168168    private static final String HANS = "hans";
    169169    private static final String BOPOMOFO = "bopo";
     170    private static final String CYRILLIC = "cyrl";
    170171
    171172    // Matches ISO-639 two and three letters language codes + scripts
    172173    private static final Pattern LANGUAGE_NAMES = Pattern.compile(
    173174            "name:(\\p{Lower}{2,3})(?:[-_](?i:(" + String.join("|", HIRAGANA, KATAKANA,
    174             LATIN, PINYIN, LATINPINYIN, ROMAJI, HANI, HANS, HANT, BOPOMOFO) + ")))?");
     175            LATIN, PINYIN, LATINPINYIN, ROMAJI, HANI, HANS, HANT, BOPOMOFO, CYRILLIC) + ")))?");
    175176
    176177    private static String format(String text, Object... objects) {
    … …  
    755756                case ROMAJI:
    756757                    return /* I18n: a Japanese syllabary (latin script) */  tr("Rōmaji");
     758                case CYRILLIC:
     759                    return /* I18n: a Cyrillic syllabary */  tr("Cyrillic");
    757760                default:
    758761                    Logging.warn("Unsupported script: {0}", script);
    … …  
    773776            String code = m.group(1);
    774777            String label = new Locale(code).getDisplayLanguage();
     778            // Not yet included in language list (2026-12)
     779            if ("cnr".equals(label)) {
     780                label = tr("Montenegrin");
     781            }
    775782            boolean knownNameKey = !code.equals(label);
    776783            String script = getLocalizedScript(m.group(2));
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r19479 r19725  
    142142        if (locale == null) return "en";
    143143        for (String full : getLanguageCodes(locale)) {
    144             if ("iw_IL".equals(full))
    145                 return "he";
    146             else if ("in".equals(full))
    147                 return "id";
    148             else if (I18n.hasCode(full)) // catch all non-single codes
     144            if (I18n.hasCode(full)) // catch all non-single codes
    149145                return full;
    150146        }
Note: See TracChangeset for help on using the changeset viewer.