Skip to content

Commit e54d816

Browse files
authored
Add Mansi layout (openboard-team#791)
1 parent 8ea693d commit e54d816

File tree

9 files changed

+87
-2
lines changed

9 files changed

+87
-2
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[popup_keys]
2+
ё ё̄
3+
у ӯ ӱ
4+
к қ
5+
е е̄
6+
н ӈ
7+
г ғ
8+
х ҳ
9+
ы ы̄
10+
а а̄ ӓ
11+
о о̄ ӧ
12+
ж җ
13+
э э̄
14+
я я̄
15+
ч ҷ
16+
и ӣ
17+
ю ю̄
18+
19+
[labels]
20+
alphabet: АБВ
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
ё
2+
ы̄
3+
ӯ
4+
а̄
5+
е̄
6+
ӈ
7+
о̄
8+
я̄
9+
ю̄
10+
ӣ
11+
э̄
12+
ё̄
13+
14+
й
15+
ц
16+
у
17+
к
18+
е
19+
н
20+
г
21+
ш
22+
щ
23+
з
24+
х
25+
ъ
26+
27+
ф
28+
ы
29+
в
30+
а
31+
п
32+
р
33+
о
34+
л
35+
д
36+
ж
37+
э
38+
39+
я
40+
ч
41+
с
42+
м
43+
и
44+
т
45+
ь
46+
б
47+
ю

app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class LocaleKeyboardInfos(dataStream: InputStream?, locale: Locale) {
5252
"hy", "ar", "be", "fa", "hi", "lo", "mr", "ne", "th", "ur" -> Key.LABEL_FLAGS_FONT_NORMAL
5353
"km", "ml", "si", "ta", "te" -> Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_AUTO_X_SCALE
5454
"kn" -> Key.LABEL_FLAGS_FONT_NORMAL or Key.LABEL_FLAGS_AUTO_X_SCALE or Key.LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO
55+
"mns" -> Key.LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO
5556
else -> 0
5657
}
5758

app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ object LocaleUtils {
190190
fun getLocaleDisplayNameInLocale(locale: Locale, resources: Resources, displayLocale: Locale): String {
191191
val languageTag = locale.toLanguageTag()
192192
if (languageTag == SubtypeLocaleUtils.NO_LANGUAGE) return resources.getString(R.string.subtype_no_language)
193-
if (locale.script() != locale.language.constructLocale().script() || locale.language == "xdq") {
193+
if (locale.script() != locale.language.constructLocale().script() || locale.language == "mns" || locale.language == "xdq") {
194194
val resId = resources.getIdentifier(
195195
"subtype_${languageTag.replace("-", "_")}",
196196
"string",

app/src/main/java/helium314/keyboard/latin/utils/ScriptUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ object ScriptUtils {
165165
"ar", "ur", "fa" -> SCRIPT_ARABIC
166166
"hy" -> SCRIPT_ARMENIAN
167167
"bn" -> SCRIPT_BENGALI
168-
"sr", "mk", "ru", "uk", "mn", "be", "kk", "ky", "bg", "xdq", "cv", "mhr" -> SCRIPT_CYRILLIC
168+
"sr", "mk", "ru", "uk", "mn", "be", "kk", "ky", "bg", "xdq", "cv", "mhr", "mns" -> SCRIPT_CYRILLIC
169169
"ka" -> SCRIPT_GEORGIAN
170170
"el" -> SCRIPT_GREEK
171171
"iw" -> SCRIPT_HEBREW

app/src/main/res/values-ru/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@
5353
<string name="subtype_en_US">Английский (США)</string>
5454
<string name="subtype_es_US">Испанский (США)</string>
5555
<string name="subtype_hi_Latn">хинглиш</string>
56+
<string name="subtype_mns">Мансийский</string>
5657
<string name="subtype_xdq">кайтагский</string>
5758
<string name="subtype_sr_Latn">сербский (латиница)</string>
5859
<string name="subtype_with_layout_en_GB">Английский (Великобритания) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
5960
<string name="subtype_with_layout_en_US">Английский (США) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
6061
<string name="subtype_with_layout_es_US">Испанский (США) (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
6162
<string name="subtype_with_layout_hi_Latn">Хинглиш (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
63+
<string name="subtype_with_layout_mns">Мансийский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
6264
<string name="subtype_with_layout_xdq">Кайтагский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
6365
<string name="subtype_with_layout_sr_Latn">Сербский (<xliff:g id="KEYBOARD_LAYOUT" example="QWERTY">%s</xliff:g>)</string>
6466
<string name="subtype_generic_traditional"><xliff:g id="LANGUAGE_NAME" example="Непальский">%s</xliff:g> (Традиционная)</string>

app/src/main/res/values/donottranslate.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
<item>en-GB</item>
1515
<item>es-US</item>
1616
<item>hi-Latn</item>
17+
<item>mns</item>
1718
<item>xdq</item>
1819
<item>sr-Latn</item>
1920
</string-array>
2021

2122
<!-- Subtype locale whose name should be displayed in Locale.ROOT. -->
2223
<string-array name="subtype_locale_displayed_in_root_locale">
2324
<item>hi-Latn</item>
25+
<item>mns</item>
2426
<item>xdq</item>
2527
<item>sr-Latn</item>
2628
</string-array>
2729
<string name="subtype_in_root_locale_hi_Latn" translatable="false" tools:keep="@string/subtype_in_root_locale_hi_Latn">Hinglish</string>
30+
<string name="subtype_in_root_locale_mns" translatable="false" tools:keep="@string/subtype_in_root_locale_mns">Ма̄ньси</string>
2831
<string name="subtype_in_root_locale_xdq" translatable="false" tools:keep="@string/subtype_in_root_locale_xdq">Хайдаҡьан</string>
2932
<string name="subtype_in_root_locale_sr_Latn" translatable="false" tools:keep="@string/subtype_in_root_locale_sr_Latn">Srpski</string>
3033

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@
279279
<string name="subtype_es_US">Spanish (US)</string>
280280
<!-- Description for Hinglish (https://en.wikipedia.org/wiki/Hinglish) keyboard subtype [CHAR LIMIT=25] -->
281281
<string name="subtype_hi_Latn">Hinglish</string>
282+
<!-- Description for Mansi (https://en.wikipedia.org/wiki/Mansi_languages) keyboard subtype -->
283+
<string name="subtype_mns">Mansi</string>
282284
<!-- Description for Kaitag (https://en.wikipedia.org/wiki/Kaitag_language) keyboard subtype [CHAR LIMIT=25] -->
283285
<string name="subtype_xdq">Kaitag</string>
284286
<!-- Description for Serbian (Latin) keyboard subtype [CHAR LIMIT=25]
@@ -304,6 +306,7 @@
304306
<string name="subtype_generic_extended"><xliff:g id="LANGUAGE_NAME" example="Kannada">%s</xliff:g> (Extended)</string>
305307
<!-- Description for Serbian (Latin) keyboard subtype with explicit keyboard layout [CHAR LIMIT=25]
306308
This should be identical to subtype_sr_ZZ aside from the trailing (%s). -->
309+
<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>
307310
<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>
308311
<!-- Description for Serbian (Latin) keyboard subtype with explicit keyboard layout [CHAR LIMIT=25]
309312
This should be identical to subtype_sr_ZZ aside from the trailing (%s). -->

app/src/main/res/xml/method.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,15 @@
737737
android:imeSubtypeExtraValue="KeyboardLayoutSet=mongolian,EmojiCapable"
738738
android:isAsciiCapable="false"
739739
/>
740+
<subtype android:icon="@drawable/ic_ime_switcher"
741+
android:label="@string/subtype_mns"
742+
android:subtypeId="0x1056a464"
743+
android:imeSubtypeLocale="mns"
744+
android:languageTag="mns"
745+
android:imeSubtypeMode="keyboard"
746+
android:imeSubtypeExtraValue="KeyboardLayoutSet=mansi_north,EmojiCapable"
747+
android:isAsciiCapable="false"
748+
/>
740749
<subtype android:icon="@drawable/ic_ime_switcher"
741750
android:label="@string/subtype_generic"
742751
android:subtypeId="0x747b9f03"

0 commit comments

Comments
 (0)