From 20a265e327dcf2cc4b6453b0d243dc80e317a72a Mon Sep 17 00:00:00 2001 From: Helium314 Date: Wed, 6 Sep 2023 23:45:11 +0200 Subject: [PATCH] update keyboard texts table, and script to create it --- .../keyboard/internal/KeyboardTextsTable.java | 127 +++++++++--------- .../keyboard/tools/MoreKeysResources.java | 16 ++- 2 files changed, 76 insertions(+), 67 deletions(-) diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.java b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.java index a49845eaa..f039ee0ae 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -801,9 +801,9 @@ public final class KeyboardTextsTable { null, null, null, null, /* ~ morekeys_u */ // Label for "switch to alphabetic" key. - // U+0995: "ক" BENGALI LETTER KA - // U+0996: "খ" BENGALI LETTER KHA - // U+0997: "গ" BENGALI LETTER GA + // U+0995: "क" BENGALI LETTER KA + // U+0996: "ख" BENGALI LETTER KHA + // U+0997: "ग" BENGALI LETTER GA /* keylabel_to_alpha */ "\u0995\u0996\u0997", /* morekeys_i ~ */ null, null, null, null, null, null, @@ -1999,6 +1999,65 @@ public final class KeyboardTextsTable { /* morekeys_c */ "\u00E7,\u0107,\u010D", }; + /* Locale he: Hebrew */ + private static final String[] TEXTS_he = { + /* morekeys_a ~ */ + null, null, null, null, + /* ~ morekeys_u */ + // Label for "switch to alphabetic" key. + // U+05D0: "א" HEBREW LETTER ALEF + // U+05D1: "ב" HEBREW LETTER BET + // U+05D2: "ג" HEBREW LETTER GIMEL + /* keylabel_to_alpha */ "\u05D0\u05D1\u05D2", + /* morekeys_i ~ */ + null, null, null, + /* ~ morekeys_c */ + /* double_quotes */ "!text/double_rqm_9qm", + /* morekeys_s */ null, + /* single_quotes */ "!text/single_rqm_9qm", + // U+20AA: "₪" NEW SHEQEL SIGN + /* keyspec_currency */ "\u20AA", + /* morekeys_y ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, + /* ~ keyspec_tablet_comma */ + // U+2605: "★" BLACK STAR + /* morekeys_star */ "\u2605", + // The all letters need to be mirrored are found at + // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt + // U+2264: "≤" LESS-THAN OR EQUAL TO + // U+2265: "≥" GREATER-THAN EQUAL TO + // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + // U+00BB: "»" RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + // U+2039: "‹" SINGLE LEFT-POINTING ANGLE QUOTATION MARK + // U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + /* keyspec_left_parenthesis */ "(|)", + /* keyspec_right_parenthesis */ ")|(", + /* keyspec_left_square_bracket */ "[|]", + /* keyspec_right_square_bracket */ "]|[", + /* keyspec_left_curly_bracket */ "{|}", + /* keyspec_right_curly_bracket */ "}|{", + /* keyspec_less_than */ "<|>", + /* keyspec_greater_than */ ">|<", + /* keyspec_less_than_equal */ "\u2264|\u2265", + /* keyspec_greater_than_equal */ "\u2265|\u2264", + /* keyspec_left_double_angle_quote */ "\u00AB|\u00BB", + /* keyspec_right_double_angle_quote */ "\u00BB|\u00AB", + /* keyspec_left_single_angle_quote */ "\u2039|\u203A", + /* keyspec_right_single_angle_quote */ "\u203A|\u2039", + /* keyspec_comma ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, + /* ~ morekeys_currency_dollar */ + // U+00B1: "±" PLUS-MINUS SIGN + // U+FB29: "﬩" HEBREW LETTER ALTERNATIVE PLUS SIGN + /* morekeys_plus */ "\u00B1,\uFB29", + }; + /* Locale hi: Hindi */ private static final String[] TEXTS_hi = { /* morekeys_a ~ */ @@ -2341,65 +2400,6 @@ public final class KeyboardTextsTable { /* morekeys_swiss_row2_11 */ "\u00E0", }; - /* Locale iw: Hebrew */ - private static final String[] TEXTS_iw = { - /* morekeys_a ~ */ - null, null, null, null, - /* ~ morekeys_u */ - // Label for "switch to alphabetic" key. - // U+05D0: "א" HEBREW LETTER ALEF - // U+05D1: "ב" HEBREW LETTER BET - // U+05D2: "ג" HEBREW LETTER GIMEL - /* keylabel_to_alpha */ "\u05D0\u05D1\u05D2", - /* morekeys_i ~ */ - null, null, null, - /* ~ morekeys_c */ - /* double_quotes */ "!text/double_rqm_9qm", - /* morekeys_s */ null, - /* single_quotes */ "!text/single_rqm_9qm", - // U+20AA: "₪" NEW SHEQEL SIGN - /* keyspec_currency */ "\u20AA", - /* morekeys_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, - /* ~ keyspec_tablet_comma */ - // U+2605: "★" BLACK STAR - /* morekeys_star */ "\u2605", - // The all letters need to be mirrored are found at - // http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt - // U+2264: "≤" LESS-THAN OR EQUAL TO - // U+2265: "≥" GREATER-THAN EQUAL TO - // U+00AB: "«" LEFT-POINTING DOUBLE ANGLE QUOTATION MARK - // U+00BB: "»" RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - // U+2039: "‹" SINGLE LEFT-POINTING ANGLE QUOTATION MARK - // U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK - /* keyspec_left_parenthesis */ "(|)", - /* keyspec_right_parenthesis */ ")|(", - /* keyspec_left_square_bracket */ "[|]", - /* keyspec_right_square_bracket */ "]|[", - /* keyspec_left_curly_bracket */ "{|}", - /* keyspec_right_curly_bracket */ "}|{", - /* keyspec_less_than */ "<|>", - /* keyspec_greater_than */ ">|<", - /* keyspec_less_than_equal */ "\u2264|\u2265", - /* keyspec_greater_than_equal */ "\u2265|\u2264", - /* keyspec_left_double_angle_quote */ "\u00AB|\u00BB", - /* keyspec_right_double_angle_quote */ "\u00BB|\u00AB", - /* keyspec_left_single_angle_quote */ "\u2039|\u203A", - /* keyspec_right_single_angle_quote */ "\u203A|\u2039", - /* keyspec_comma ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, - /* ~ morekeys_currency_dollar */ - // U+00B1: "±" PLUS-MINUS SIGN - // U+FB29: "﬩" HEBREW LETTER ALTERNATIVE PLUS SIGN - /* morekeys_plus */ "\u00B1,\uFB29", - }; - /* Locale ka: Georgian */ private static final String[] TEXTS_ka = { /* morekeys_a ~ */ @@ -4288,6 +4288,8 @@ public final class KeyboardTextsTable { "fi" , TEXTS_fi, /* 10/ 58 Finnish */ "fr" , TEXTS_fr, /* 13/ 64 French */ "gl" , TEXTS_gl, /* 7/ 8 Galician */ + "iw" , TEXTS_he, /* 20/131 Hebrew */ + "he" , TEXTS_he, /* 20/131 Hebrew */ "hi" , TEXTS_hi, /* 27/ 57 Hindi */ "hi_ZZ" , TEXTS_hi_ZZ, /* 9/118 Hindi (Unknown Region) */ "hr" , TEXTS_hr, /* 9/ 20 Croatian */ @@ -4295,7 +4297,6 @@ public final class KeyboardTextsTable { "hy" , TEXTS_hy, /* 9/134 Armenian */ "is" , TEXTS_is, /* 10/ 16 Icelandic */ "it" , TEXTS_it, /* 11/ 64 Italian */ - "iw" , TEXTS_iw, /* 20/131 Hebrew */ "ka" , TEXTS_ka, /* 3/ 11 Georgian */ "kk" , TEXTS_kk, /* 15/129 Kazakh */ "km" , TEXTS_km, /* 2/130 Khmer */ diff --git a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java index 73229155e..b62a6be53 100644 --- a/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java +++ b/tools/make-keyboard-text/src/main/java/com/android/inputmethod/keyboard/tools/MoreKeysResources.java @@ -188,12 +188,20 @@ public class MoreKeysResources { for (final StringResourceMap resMap : mResourcesMap.values()) { final Locale locale = resMap.mLocale; final String localeStr = LocaleUtils.getLocaleCode(locale); - final String localeStr2 = localeStr.equals("he") - ? "iw" // android still uses iw, but apparently with a newer java version iw ends up being converted to he - : localeStr; + if (localeStr.equals("he")) { + // android still uses iw, but with newer java versions iw ends up being converted to he + // to be safe, just use both locales + final String localeToDump = (locale == LocaleUtils.DEFAULT_LOCALE) + ? String.format("\"%s\"", localeStr) + : String.format("\"%s\"%s", "iw", " ".substring(localeStr.length())); + out.format(" %s, %-12s /* %3d/%3d %s */\n", + localeToDump, getArrayNameForLocale(locale) + ",", + resMap.getResources().size(), resMap.getOutputArraySize(), + LocaleUtils.getLocaleDisplayName(locale)); + } final String localeToDump = (locale == LocaleUtils.DEFAULT_LOCALE) ? String.format("\"%s\"", localeStr) - : String.format("\"%s\"%s", localeStr2, " ".substring(localeStr.length())); + : String.format("\"%s\"%s", localeStr, " ".substring(localeStr.length())); out.format(" %s, %-12s /* %3d/%3d %s */\n", localeToDump, getArrayNameForLocale(locale) + ",", resMap.getResources().size(), resMap.getOutputArraySize(),