Skip to content

Commit

Permalink
Add Mansi layout (openboard-team#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenextractor authored May 17, 2024
1 parent 8ea693d commit e54d816
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 2 deletions.
20 changes: 20 additions & 0 deletions app/src/main/assets/language_key_texts/mns.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[popup_keys]
ё ё̄
у ӯ ӱ
к қ
е е̄
н ӈ
г ғ
х ҳ
ы ы̄
а а̄ ӓ
о о̄ ӧ
ж җ
э э̄
я я̄
ч ҷ
и ӣ
ю ю̄

[labels]
alphabet: АБВ
47 changes: 47 additions & 0 deletions app/src/main/assets/layouts/mansi_north.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ё
ы̄
ӯ
а̄
е̄
ӈ
о̄
я̄
ю̄
ӣ
э̄
ё̄

й
ц
у
к
е
н
г
ш
щ
з
х
ъ

ф
ы
в
а
п
р
о
л
д
ж
э

я
ч
с
м
и
т
ь
б
ю
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class LocaleKeyboardInfos(dataStream: InputStream?, locale: Locale) {
"hy", "ar", "be", "fa", "hi", "lo", "mr", "ne", "th", "ur" -> Key.LABEL_FLAGS_FONT_NORMAL
"km", "ml", "si", "ta", "te" -> Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_AUTO_X_SCALE
"kn" -> Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_AUTO_X_SCALE or Key.LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO
"mns" -> Key.LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO
else -> 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ object LocaleUtils {
fun getLocaleDisplayNameInLocale(locale: Locale, resources: Resources, displayLocale: Locale): String {
val languageTag = locale.toLanguageTag()
if (languageTag == SubtypeLocaleUtils.NO_LANGUAGE) return resources.getString(R.string.subtype_no_language)
if (locale.script() != locale.language.constructLocale().script() || locale.language == "xdq") {
if (locale.script() != locale.language.constructLocale().script() || locale.language == "mns" || locale.language == "xdq") {
val resId = resources.getIdentifier(
"subtype_${languageTag.replace("-", "_")}",
"string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ object ScriptUtils {
"ar", "ur", "fa" -> SCRIPT_ARABIC
"hy" -> SCRIPT_ARMENIAN
"bn" -> SCRIPT_BENGALI
"sr", "mk", "ru", "uk", "mn", "be", "kk", "ky", "bg", "xdq", "cv", "mhr" -> SCRIPT_CYRILLIC
"sr", "mk", "ru", "uk", "mn", "be", "kk", "ky", "bg", "xdq", "cv", "mhr", "mns" -> SCRIPT_CYRILLIC
"ka" -> SCRIPT_GEORGIAN
"el" -> SCRIPT_GREEK
"iw" -> SCRIPT_HEBREW
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@
<string name="subtype_en_US">Английский (США)</string>
<string name="subtype_es_US">Испанский (США)</string>
<string name="subtype_hi_Latn">хинглиш</string>
<string name="subtype_mns">Мансийский</string>
<string name="subtype_xdq">кайтагский</string>
<string name="subtype_sr_Latn">сербский (латиница)</string>
<string name="subtype_with_layout_en_GB">Английский (Великобритания) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_en_US">Английский (США) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_es_US">Испанский (США) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_hi_Latn">Хинглиш (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_mns">Мансийский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_xdq">Кайтагский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_sr_Latn">Сербский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_generic_traditional"><xliff:g id="LANGUAGE_NAME" example="Непальский">%s</xliff:g> (Традиционная)</string>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@
<item>en-GB</item>
<item>es-US</item>
<item>hi-Latn</item>
<item>mns</item>
<item>xdq</item>
<item>sr-Latn</item>
</string-array>

<!-- Subtype locale whose name should be displayed in Locale.ROOT. -->
<string-array name="subtype_locale_displayed_in_root_locale">
<item>hi-Latn</item>
<item>mns</item>
<item>xdq</item>
<item>sr-Latn</item>
</string-array>
<string name="subtype_in_root_locale_hi_Latn" translatable="false" tools:keep="@string/subtype_in_root_locale_hi_Latn">Hinglish</string>
<string name="subtype_in_root_locale_mns" translatable="false" tools:keep="@string/subtype_in_root_locale_mns">Ма̄ньси</string>
<string name="subtype_in_root_locale_xdq" translatable="false" tools:keep="@string/subtype_in_root_locale_xdq">Хайдаҡьан</string>
<string name="subtype_in_root_locale_sr_Latn" translatable="false" tools:keep="@string/subtype_in_root_locale_sr_Latn">Srpski</string>

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@
<string name="subtype_es_US">Spanish (US)</string>
<!-- Description for Hinglish (https://en.wikipedia.org/wiki/Hinglish) keyboard subtype [CHAR LIMIT=25] -->
<string name="subtype_hi_Latn">Hinglish</string>
<!-- Description for Mansi (https://en.wikipedia.org/wiki/Mansi_languages) keyboard subtype -->
<string name="subtype_mns">Mansi</string>
<!-- Description for Kaitag (https://en.wikipedia.org/wiki/Kaitag_language) keyboard subtype [CHAR LIMIT=25] -->
<string name="subtype_xdq">Kaitag</string>
<!-- Description for Serbian (Latin) keyboard subtype [CHAR LIMIT=25]
Expand All @@ -304,6 +306,7 @@
<string name="subtype_generic_extended"><xliff:g id="LANGUAGE_NAME" example="Kannada">%s</xliff:g> (Extended)</string>
<!-- Description for Serbian (Latin) keyboard subtype with explicit keyboard layout [CHAR LIMIT=25]
This should be identical to subtype_sr_ZZ aside from the trailing (%s). -->
<string name="subtype_with_layout_mns" tools:keep="@string/subtype_with_layout_mns">Mansi (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<string name="subtype_with_layout_xdq" tools:keep="@string/subtype_with_layout_xdq">Kaitag (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
<!-- Description for Serbian (Latin) keyboard subtype with explicit keyboard layout [CHAR LIMIT=25]
This should be identical to subtype_sr_ZZ aside from the trailing (%s). -->
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/xml/method.xml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=mongolian,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_mns"
android:subtypeId="0x1056a464"
android:imeSubtypeLocale="mns"
android:languageTag="mns"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=mansi_north,EmojiCapable"
android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x747b9f03"
Expand Down

0 comments on commit e54d816

Please sign in to comment.