Skip to content

Commit

Permalink
add some more script variants, fix #23964
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19240 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Oct 12, 2024
1 parent aa25f9e commit 46fae0c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/org/openstreetmap/josm/tools/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) + ")))?");

Check failure on line 160 in src/org/openstreetmap/josm/tools/I18n.java

View workflow job for this annotation

GitHub Actions / Analyze

com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck

Line is longer than 145 characters (found 152).

private static String format(String text, Object... objects) {
if (objects.length == 0 && !text.contains("'")) {
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 46fae0c

Please sign in to comment.