From c32b3bada451262540a28fb2eebf58743b084ed6 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Sat, 19 Apr 2025 09:27:58 +0300 Subject: [PATCH] Keyboard layouts for languages primarily used in Africa (#1483) --- app/src/main/assets/layouts/main/akan.txt | 28 ++++ app/src/main/assets/layouts/main/bemba.txt | 29 +++++ app/src/main/assets/layouts/main/dagbani.txt | 28 ++++ app/src/main/assets/layouts/main/ewe.txt | 28 ++++ app/src/main/assets/layouts/main/ga.txt | 28 ++++ app/src/main/assets/layouts/main/hausa.txt | 28 ++++ app/src/main/assets/layouts/main/igbo.txt | 28 ++++ app/src/main/assets/layouts/main/kikuyu.txt | 28 ++++ app/src/main/assets/layouts/main/lingala.txt | 28 ++++ app/src/main/assets/layouts/main/luganda.txt | 29 +++++ app/src/main/assets/layouts/main/sesotho.txt | 28 ++++ app/src/main/assets/layouts/main/yoruba.txt | 28 ++++ .../keyboard_parser/LocaleKeyboardInfos.kt | 13 +- .../keyboard/latin/common/LocaleUtils.kt | 2 +- app/src/main/res/values/strings.xml | 4 + app/src/main/res/xml/method.xml | 122 +++++++++++++++++- 16 files changed, 474 insertions(+), 5 deletions(-) create mode 100644 app/src/main/assets/layouts/main/akan.txt create mode 100644 app/src/main/assets/layouts/main/bemba.txt create mode 100644 app/src/main/assets/layouts/main/dagbani.txt create mode 100644 app/src/main/assets/layouts/main/ewe.txt create mode 100644 app/src/main/assets/layouts/main/ga.txt create mode 100644 app/src/main/assets/layouts/main/hausa.txt create mode 100644 app/src/main/assets/layouts/main/igbo.txt create mode 100644 app/src/main/assets/layouts/main/kikuyu.txt create mode 100644 app/src/main/assets/layouts/main/lingala.txt create mode 100644 app/src/main/assets/layouts/main/luganda.txt create mode 100644 app/src/main/assets/layouts/main/sesotho.txt create mode 100644 app/src/main/assets/layouts/main/yoruba.txt diff --git a/app/src/main/assets/layouts/main/akan.txt b/app/src/main/assets/layouts/main/akan.txt new file mode 100644 index 00000000..1f139b58 --- /dev/null +++ b/app/src/main/assets/layouts/main/akan.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/bemba.txt b/app/src/main/assets/layouts/main/bemba.txt new file mode 100644 index 00000000..5253b288 --- /dev/null +++ b/app/src/main/assets/layouts/main/bemba.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/dagbani.txt b/app/src/main/assets/layouts/main/dagbani.txt new file mode 100644 index 00000000..588ff051 --- /dev/null +++ b/app/src/main/assets/layouts/main/dagbani.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/ewe.txt b/app/src/main/assets/layouts/main/ewe.txt new file mode 100644 index 00000000..bb307f1a --- /dev/null +++ b/app/src/main/assets/layouts/main/ewe.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/ga.txt b/app/src/main/assets/layouts/main/ga.txt new file mode 100644 index 00000000..03d1fe66 --- /dev/null +++ b/app/src/main/assets/layouts/main/ga.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/hausa.txt b/app/src/main/assets/layouts/main/hausa.txt new file mode 100644 index 00000000..3138eb99 --- /dev/null +++ b/app/src/main/assets/layouts/main/hausa.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/igbo.txt b/app/src/main/assets/layouts/main/igbo.txt new file mode 100644 index 00000000..9cf50d78 --- /dev/null +++ b/app/src/main/assets/layouts/main/igbo.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/kikuyu.txt b/app/src/main/assets/layouts/main/kikuyu.txt new file mode 100644 index 00000000..0fdbdd8d --- /dev/null +++ b/app/src/main/assets/layouts/main/kikuyu.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/lingala.txt b/app/src/main/assets/layouts/main/lingala.txt new file mode 100644 index 00000000..83010980 --- /dev/null +++ b/app/src/main/assets/layouts/main/lingala.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/luganda.txt b/app/src/main/assets/layouts/main/luganda.txt new file mode 100644 index 00000000..5253b288 --- /dev/null +++ b/app/src/main/assets/layouts/main/luganda.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/sesotho.txt b/app/src/main/assets/layouts/main/sesotho.txt new file mode 100644 index 00000000..b0796b3b --- /dev/null +++ b/app/src/main/assets/layouts/main/sesotho.txt @@ -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 diff --git a/app/src/main/assets/layouts/main/yoruba.txt b/app/src/main/assets/layouts/main/yoruba.txt new file mode 100644 index 00000000..3ee1696d --- /dev/null +++ b/app/src/main/assets/layouts/main/yoruba.txt @@ -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 diff --git a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt index eba17161..f0f5d5a2 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt +++ b/app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/LocaleKeyboardInfos.kt @@ -266,7 +266,7 @@ private fun getCurrencyKey(locale: Locale): Pair> { return euro if (locale.language.matches("ca|eu|lb|mt".toRegex())) 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)) if (locale.language == "hy") return dram @@ -292,17 +292,24 @@ private fun getCurrency(locale: Locale): String { if (locale.country == "BD") return "৳" if (locale.country == "LK") return "රු" return when (locale.language) { + "ak" -> "¢" + "dag" -> "¢" + "ee" -> "¢" "fa" -> "﷼" + "gaa" -> "¢" + "ha" -> "₦" + "ig" -> "₦" "iw" -> "₪" - "ko" -> "₩" "lo" -> "₭" + "km" -> "៛" + "ko" -> "₩" "mn" -> "₮" "ne" -> "रु." "si" -> "රු" "th" -> "฿" "uk" -> "₴" "vi" -> "₫" - "km" -> "៛" + "yo" -> "₦" else -> "$" } } diff --git a/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt b/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt index 377d0c08..85f8f885 100644 --- a/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt +++ b/app/src/main/java/helium314/keyboard/latin/common/LocaleUtils.kt @@ -188,7 +188,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 == "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( "subtype_${languageTag.replace("-", "_")}", "string", diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 03e7bcff..a0f317a9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -367,6 +367,10 @@ Mansi Kaitag + + Dagbani + + Sesotho Serbian (Latin) @@ -164,6 +176,15 @@ android:imeSubtypeExtraValue="AsciiCapable,EmojiCapable" android:isAsciiCapable="true" /> + + + + + + + + + + + +