Keyboard layouts for languages primarily used in Africa (#1483)

This commit is contained in:
Benson Muite 2025-04-19 09:27:58 +03:00 committed by GitHub
parent e042adc5b8
commit c32b3bada4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 474 additions and 5 deletions

View file

@ -0,0 +1,28 @@
ɛ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ɔ x
c ¢
v
b
n
m

View file

@ -0,0 +1,29 @@
q
w
e
r
t
y
u
i
o
p
ŋ
a
s
d
f
g
h
j
k
l
z
x
c
v
b
n
m

View file

@ -0,0 +1,28 @@
q
w
ɛ e
r ¢
t
y
u
i
ɔ o
p
a
s
d
f
ɣ g
h
j
k
l
ʒ z
x x
c
v
b
ŋ n
m

View file

@ -0,0 +1,28 @@
ɛ q
w
e
r
t
ɣ y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ɔ x
c ¢
v
b
n
m

View file

@ -0,0 +1,28 @@
ɛ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ɔ x
ŋ c ¢
v
b
n
m

View file

@ -0,0 +1,28 @@
ẹ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ọ x
c
v
b
n ₦
m

View file

@ -0,0 +1,28 @@
ṅ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ọ x
c
ụ v
b
n ₦
m

View file

@ -0,0 +1,28 @@
ĩ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ũ x
c
v
b
n
m

View file

@ -0,0 +1,28 @@
q
w
ɛ e
r
t
y
u
i
ɔ o
p
a
s
d
f
g
h
j
k
l
z
x
c
̌ v
b
n
m

View file

@ -0,0 +1,29 @@
q
w
e
r
t
y
u
i
o
p
ŋ
a
s
d
f
g
h
j
k
l
z
x
c
v
b
n
m

View file

@ -0,0 +1,28 @@
q
w
e
r
t
y
u
i
o
p
a
š s
d
f
g
h
j
k
l
z
x
c
v
b
n
m

View file

@ -0,0 +1,28 @@
ẹ q
w
e
r
t
y
u
i
o
p
a
s
d
f
g
h
j
k
l
z
ọ x
c
ṣ v
b
n ₦
m

View file

@ -266,7 +266,7 @@ private fun getCurrencyKey(locale: Locale): Pair<String, List<String>> {
return euro return euro
if (locale.language.matches("ca|eu|lb|mt".toRegex())) if (locale.language.matches("ca|eu|lb|mt".toRegex()))
return euro return euro
if (locale.language.matches("fa|iw|ko|lo|mn|ne|si|th|uk|vi|km".toRegex())) if (locale.language.matches("ak|dag|ee|fa|gaa|ha|ig|iw|lo|ko|km|mn|ne|si|th|uk|vi|yo".toRegex()))
return genericCurrencyKey(getCurrency(locale)) return genericCurrencyKey(getCurrency(locale))
if (locale.language == "hy") if (locale.language == "hy")
return dram return dram
@ -292,17 +292,24 @@ private fun getCurrency(locale: Locale): String {
if (locale.country == "BD") return "" if (locale.country == "BD") return ""
if (locale.country == "LK") return "රු" if (locale.country == "LK") return "රු"
return when (locale.language) { return when (locale.language) {
"ak" -> "¢"
"dag" -> "¢"
"ee" -> "¢"
"fa" -> "" "fa" -> ""
"gaa" -> "¢"
"ha" -> ""
"ig" -> ""
"iw" -> "" "iw" -> ""
"ko" -> ""
"lo" -> "" "lo" -> ""
"km" -> ""
"ko" -> ""
"mn" -> "" "mn" -> ""
"ne" -> "रु." "ne" -> "रु."
"si" -> "රු" "si" -> "රු"
"th" -> "฿" "th" -> "฿"
"uk" -> "" "uk" -> ""
"vi" -> "" "vi" -> ""
"km" -> "" "yo" -> ""
else -> "$" else -> "$"
} }
} }

View file

@ -188,7 +188,7 @@ object LocaleUtils {
fun getLocaleDisplayNameInLocale(locale: Locale, resources: Resources, displayLocale: Locale): String { fun getLocaleDisplayNameInLocale(locale: Locale, resources: Resources, displayLocale: Locale): String {
val languageTag = locale.toLanguageTag() val languageTag = locale.toLanguageTag()
if (languageTag == SubtypeLocaleUtils.NO_LANGUAGE) return resources.getString(R.string.subtype_no_language) if (languageTag == SubtypeLocaleUtils.NO_LANGUAGE) return resources.getString(R.string.subtype_no_language)
if (locale.script() != locale.language.constructLocale().script() || locale.language == "mns" || locale.language == "xdq" || locale.language=="dru") { if (locale.script() != locale.language.constructLocale().script() || locale.language == "mns" || locale.language == "xdq" || locale.language=="dru" || locale.language=="st" || locale.language=="dag") {
val resId = resources.getIdentifier( val resId = resources.getIdentifier(
"subtype_${languageTag.replace("-", "_")}", "subtype_${languageTag.replace("-", "_")}",
"string", "string",

View file

@ -367,6 +367,10 @@
<string name="subtype_mns">Mansi</string> <string name="subtype_mns">Mansi</string>
<!-- Description for Kaitag (https://en.wikipedia.org/wiki/Kaitag_language) keyboard subtype --> <!-- Description for Kaitag (https://en.wikipedia.org/wiki/Kaitag_language) keyboard subtype -->
<string name="subtype_xdq">Kaitag</string> <string name="subtype_xdq">Kaitag</string>
<!-- Description for Dagbani (https://en.wikipedia.org/wiki/Dagbani_language) keyboard subtype -->
<string name="subtype_dag">Dagbani</string>
<!-- Description for Sesotho (https://en.wikipedia.org/wiki/Sesotho_language) keyboard subtype -->
<string name="subtype_st">Sesotho</string>
<!-- Description for Serbian (Latin) keyboard subtype --> <!-- Description for Serbian (Latin) keyboard subtype -->
<string name="subtype_sr_Latn">Serbian (Latin)</string> <string name="subtype_sr_Latn">Serbian (Latin)</string>
<!-- Description for English (UK) keyboard subtype with explicit keyboard layout <!-- Description for English (UK) keyboard subtype with explicit keyboard layout

View file

@ -11,10 +11,12 @@
<!-- Supported subtypes <!-- Supported subtypes
keyboard_locale: script_name/keyboard_layout_set keyboard_locale: script_name/keyboard_layout_set
af: Afrikaans/qwerty af: Afrikaans/qwerty
ak: Akan/akan # This is a preliminary keyboard layout.
ar: Arabic/arabic ar: Arabic/arabic
ar: Arabic/arabic_pc ar: Arabic/arabic_pc
az_AZ: Azerbaijani (Azerbaijan)/qwerty az_AZ: Azerbaijani (Azerbaijan)/qwerty
be_BY: Belarusian (Belarus)/belarusian be_BY: Belarusian (Belarus)/belarusian
bem: Bemba/bemba # This is a preliminary keyboard layout.
bg: Bulgarian/bulgarian bg: Bulgarian/bulgarian
bg: Bulgarian/bulgarian_bds bg: Bulgarian/bulgarian_bds
bg: Bulgarian/bulgarian_bekl bg: Bulgarian/bulgarian_bekl
@ -27,10 +29,12 @@
cs: Czech/qwertz cs: Czech/qwertz
cv: Chuvash/chuvash cv: Chuvash/chuvash
da: Danish/qwerty+ da: Danish/qwerty+
dag: Dagbani/dagbani # This is a preliminary keyboard layout.
dru: Dargwa (Urakhi)/dargwa_urakhi dru: Dargwa (Urakhi)/dargwa_urakhi
de: German/qwertz de: German/qwertz
de_DE: German (Germany)/qwertz+ de_DE: German (Germany)/qwertz+
de_CH: German (Switzerland)/qwertz+ de_CH: German (Switzerland)/qwertz+
ee: Ewe/ewe # This is a preliminary keyboard layout.
el: Greek/greek el: Greek/greek
en_AU: English (Australia)/qwerty en_AU: English (Australia)/qwerty
en_IN: English (India)/qwerty en_IN: English (India)/qwerty
@ -47,8 +51,10 @@
fr: French/azerty fr: French/azerty
fr_CA: French (Canada)/qwerty fr_CA: French (Canada)/qwerty
fr_CH: French (Switzerland)/qwertz+ fr_CH: French (Switzerland)/qwertz+
gaa: Ga/ga # This is a preliminary keyboard layout.
gl_ES: Galician (Spain)/qwerty+ gl_ES: Galician (Spain)/qwerty+
gu: Gujarati/gujarati gu: Gujarati/gujarati
ha: Hausa/hausa # This is a preliminary keyboard layout.
hi: Hindi/hindi hi: Hindi/hindi
hi: Hindi/hindi_compact hi: Hindi/hindi_compact
hi: Hindi/hindi_phonetic hi: Hindi/hindi_phonetic
@ -58,6 +64,7 @@
hu: Hungarian/hungarian_qwertz hu: Hungarian/hungarian_qwertz
hu_HU: Hungarian/qwerty hu_HU: Hungarian/qwerty
hy_AM: Armenian (Armenia) Phonetic/armenian_phonetic hy_AM: Armenian (Armenia) Phonetic/armenian_phonetic
ig: Igbo/igbo # This is a preliminary keyboard layout.
in: Indonesian/qwerty # "id" is the official language code of Indonesian. in: Indonesian/qwerty # "id" is the official language code of Indonesian.
is: Icelandic/qwerty is: Icelandic/qwerty
it: Italian/qwerty it: Italian/qwerty
@ -66,11 +73,14 @@
iw: Hebrew/hebrew_1452_2 # "he" is the official language code of Hebrew. iw: Hebrew/hebrew_1452_2 # "he" is the official language code of Hebrew.
ka_GE: Georgian (Georgia)/georgian ka_GE: Georgian (Georgia)/georgian
kab: Kabyle (Algeria)/azerty # This is a preliminary keyboard layout. kab: Kabyle (Algeria)/azerty # This is a preliminary keyboard layout.
ki: Kikuyu/kikuyu # This is a preliminary keyboard layout.
kk: Kazakh/russian kk: Kazakh/russian
km_KH: Khmer (Cambodia)/khmer km_KH: Khmer (Cambodia)/khmer
kn_IN: Kannada (India)/kannada kn_IN: Kannada (India)/kannada
kn_IN: Kannada Extended (India)/kannada kn_IN: Kannada Extended (India)/kannada
ky: Kyrgyz/russian ky: Kyrgyz/russian
lg: Luganda/luganda # This is a preliminary keyboard layout.
ln: Lingala/lingala # This is a preliminary keyboard layout.
lo_LA: Lao (Laos)/lao lo_LA: Lao (Laos)/lao
lt: Lithuanian/qwerty lt: Lithuanian/qwerty
lv: Latvian/qwerty lv: Latvian/qwerty
@ -98,6 +108,7 @@
sl: Slovenian/qwerty sl: Slovenian/qwerty
sr: Serbian/serbian sr: Serbian/serbian
sr_ZZ: Serbian (Latin)/qwertz+ # This is a preliminary keyboard layout. sr_ZZ: Serbian (Latin)/qwertz+ # This is a preliminary keyboard layout.
st: Sesotho/sesotho # This is a preliminary keyboard layout.
sv: Swedish/qwerty+ sv: Swedish/qwerty+
sw: Swahili/qwerty sw: Swahili/qwerty
ta_IN: Tamil (India)/tamil ta_IN: Tamil (India)/tamil
@ -112,7 +123,8 @@
uk: Ukrainian (Extended)/ukrainian_extended uk: Ukrainian (Extended)/ukrainian_extended
uz_UZ: Uzbek (Uzbekistan)/uzbek # This is a preliminary keyboard layout. uz_UZ: Uzbek (Uzbekistan)/uzbek # This is a preliminary keyboard layout.
vi: Vietnamese/qwerty vi: Vietnamese/qwerty
zu: Zulu/qwerty yo: Yoruba/yoruba
zu: Zulu/qwerty # This is a preliminary keyboard layout.
zz: QWERTY/qwerty zz: QWERTY/qwerty
--> -->
<!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. --> <!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
@ -164,6 +176,15 @@
android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x6f972363"
android:imeSubtypeLocale="ak"
android:languageTag="ak"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:akan,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x590dde40" android:subtypeId="0x590dde40"
@ -200,6 +221,15 @@
android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1dc3a959"
android:imeSubtypeLocale="bem"
android:languageTag="bem"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:bemba,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x1dc3a859" android:subtypeId="0x1dc3a859"
@ -326,6 +356,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwerty+,AsciiCapable,SupportTouchPositionCorrection,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwerty+,AsciiCapable,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1dc3b959"
android:imeSubtypeLocale="dag"
android:languageTag="dag"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:dagbani,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x2e2cbe61" android:subtypeId="0x2e2cbe61"
@ -425,6 +464,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwerty+,AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwerty+,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ac3c954"
android:imeSubtypeLocale="ee"
android:languageTag="ee"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:ewe,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xbe66c254" android:subtypeId="0xbe66c254"
@ -470,6 +518,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz+,AsciiCapable,SupportTouchPositionCorrection,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz+,AsciiCapable,SupportTouchPositionCorrection,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ec4c959"
android:imeSubtypeLocale="gaa"
android:languageTag="gaa"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:ga,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0xb939573c" android:subtypeId="0xb939573c"
@ -487,6 +544,15 @@
android:imeSubtypeMode="keyboard" android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:gujarati,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:gujarati,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/>
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ec2c969"
android:imeSubtypeLocale="ha"
android:languageTag="ha"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:hausa,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
@ -573,6 +639,15 @@
android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1dc3ca59"
android:imeSubtypeLocale="ig"
android:languageTag="ig"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:igbo,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x7df519e5" android:subtypeId="0x7df519e5"
@ -637,6 +712,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:georgian,NoShiftProximityCorrection,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:georgian,NoShiftProximityCorrection,EmojiCapable"
android:isAsciiCapable="false" android:isAsciiCapable="false"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1bc3c259"
android:imeSubtypeLocale="ki"
android:languageTag="ki"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:kikuyu,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x2d73d2f6" android:subtypeId="0x2d73d2f6"
@ -735,6 +819,24 @@
android:imeSubtypeMode="keyboard" android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz,AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz,AsciiCapable,EmojiCapable"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ec2b4c9"
android:imeSubtypeLocale="lg"
android:languageTag="lg"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:luganda,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1bc3c429"
android:imeSubtypeLocale="ln"
android:languageTag="ln"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:lingala,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x8315772c" android:subtypeId="0x8315772c"
@ -993,6 +1095,15 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz+,AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:qwertz+,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ee4c259"
android:imeSubtypeLocale="st"
android:languageTag="st"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:sesotho,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x48b4ff43" android:subtypeId="0x48b4ff43"
@ -1124,6 +1235,15 @@
android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable" android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable"
android:isAsciiCapable="true" android:isAsciiCapable="true"
/> />
<subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic"
android:subtypeId="0x1ec3c959"
android:imeSubtypeLocale="yo"
android:languageTag="yo"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=MAIN:yoruba,AsciiCapable,EmojiCapable"
android:isAsciiCapable="true"
/>
<subtype android:icon="@drawable/ic_ime_switcher" <subtype android:icon="@drawable/ic_ime_switcher"
android:label="@string/subtype_generic" android:label="@string/subtype_generic"
android:subtypeId="0x9b13ab76" android:subtypeId="0x9b13ab76"