From 46fae0c1409e05cf8e888f0863ef88ed8f3cef59 Mon Sep 17 00:00:00 2001 From: stoecker Date: Sat, 12 Oct 2024 19:49:01 +0000 Subject: [PATCH] add some more script variants, fix #23964 git-svn-id: https://josm.openstreetmap.de/svn/trunk@19240 0c6e7542-c601-0410-84e7-c038aed88b3b --- src/org/openstreetmap/josm/tools/I18n.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/org/openstreetmap/josm/tools/I18n.java b/src/org/openstreetmap/josm/tools/I18n.java index 4d55e65b41b..94150272e1e 100644 --- a/src/org/openstreetmap/josm/tools/I18n.java +++ b/src/org/openstreetmap/josm/tools/I18n.java @@ -149,11 +149,15 @@ private enum PluralMode { private static final String KATAKANA = "kana"; private static final String LATIN = "latn"; private static final String PINYIN = "pinyin"; + private static final String LATINPINYIN = "latn-pinyin"; private static final String ROMAJI = "rm"; + private static final String HANI = "hani"; + private static final String HANT = "hant"; + private static final String HANS = "hans"; // Matches ISO-639 two and three letters language codes + scripts private static final Pattern LANGUAGE_NAMES = Pattern.compile( - "name:(\\p{Lower}{2,3})(?:[-_](?i:(" + String.join("|", HIRAGANA, KATAKANA, LATIN, PINYIN, ROMAJI) + ")))?"); + "name:(\\p{Lower}{2,3})(?:[-_](?i:(" + String.join("|", HIRAGANA, KATAKANA, LATIN, PINYIN, LATINPINYIN, ROMAJI, HANI, HANS, HANT) + ")))?"); private static String format(String text, Object... objects) { if (objects.length == 0 && !text.contains("'")) { @@ -720,8 +724,14 @@ public static String getLocalizedScript(String script) { return /* I18n: a Japanese syllabary */ tr("Katakana"); case LATIN: return /* I18n: usage of latin letters/script for usually non-latin languages */ tr("Latin"); - case PINYIN: + case PINYIN: case LATINPINYIN: return /* I18n: official romanization system for Standard Chinese */ tr("Pinyin"); + case HANI: + return /* I18n: Han characters for Vietnamese or Korean language */ tr("Hani"); + case HANS: + return /* I18n: Simplified Chinese */ tr("Simplied"); + case HANT: + return /* I18n: Traditional Chinese */ tr("Trdaditional"); case ROMAJI: return /* I18n: a Japanese syllabary (latin script) */ tr("Rōmaji"); default: