From 30983b53d2a6ebf483dafaf9b1a886acdfa86988 Mon Sep 17 00:00:00 2001 From: ronniedroid Date: Tue, 28 May 2024 08:59:21 +0300 Subject: [PATCH 1/3] FEAT: added arabic language support --- .../fossify/keyboard/extensions/Context.kt | 1 + .../org/fossify/keyboard/helpers/Constants.kt | 2 + .../keyboard/services/SimpleKeyboardIME.kt | 1 + app/src/main/res/xml/keys_letters_arabic.xml | 173 ++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 app/src/main/res/xml/keys_letters_arabic.xml diff --git a/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt b/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt index c13ca1a9..bd8e69f8 100644 --- a/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt @@ -186,6 +186,7 @@ fun Context.getKeyboardLanguagesRadioItems(): ArrayList { fun Context.getKeyboardLanguageText(language: Int): String { return when (language) { + LANGUAGE_ARABIC -> "${getString(R.string.translation_arabic)} (العربية)" LANGUAGE_BENGALI -> getString(R.string.translation_bengali) LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian) LANGUAGE_DANISH -> getString(R.string.translation_danish) diff --git a/app/src/main/kotlin/org/fossify/keyboard/helpers/Constants.kt b/app/src/main/kotlin/org/fossify/keyboard/helpers/Constants.kt index 1b7f3bf8..1ef18032 100644 --- a/app/src/main/kotlin/org/fossify/keyboard/helpers/Constants.kt +++ b/app/src/main/kotlin/org/fossify/keyboard/helpers/Constants.kt @@ -48,9 +48,11 @@ const val LANGUAGE_FRENCH_BEPO = 17 const val LANGUAGE_VIETNAMESE_TELEX = 18 const val LANGUAGE_POLISH = 19 const val LANGUAGE_UKRAINIAN = 20 +const val LANGUAGE_ARABIC = 21 // Keep this sorted val SUPPORTED_LANGUAGES = listOf( + LANGUAGE_ARABIC, LANGUAGE_BENGALI, LANGUAGE_BULGARIAN, LANGUAGE_DANISH, diff --git a/app/src/main/kotlin/org/fossify/keyboard/services/SimpleKeyboardIME.kt b/app/src/main/kotlin/org/fossify/keyboard/services/SimpleKeyboardIME.kt index 613babc8..604c8e08 100644 --- a/app/src/main/kotlin/org/fossify/keyboard/services/SimpleKeyboardIME.kt +++ b/app/src/main/kotlin/org/fossify/keyboard/services/SimpleKeyboardIME.kt @@ -409,6 +409,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared private fun getKeyboardLayoutXML(): Int { return when (baseContext.config.keyboardLanguage) { + LANGUAGE_ARABIC -> R.xml.keys_letters_arabic LANGUAGE_BENGALI -> R.xml.keys_letters_bengali LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian LANGUAGE_DANISH -> R.xml.keys_letters_danish diff --git a/app/src/main/res/xml/keys_letters_arabic.xml b/app/src/main/res/xml/keys_letters_arabic.xml new file mode 100644 index 00000000..8734b40a --- /dev/null +++ b/app/src/main/res/xml/keys_letters_arabic.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4ef4fc1740ec10460e26283682ea33763644b0e7 Mon Sep 17 00:00:00 2001 From: Ronnie Nissan Date: Sun, 9 Jun 2024 10:10:09 +0300 Subject: [PATCH 2/3] removed unneeded translation text --- app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt b/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt index bd8e69f8..bf049248 100644 --- a/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt +++ b/app/src/main/kotlin/org/fossify/keyboard/extensions/Context.kt @@ -186,7 +186,7 @@ fun Context.getKeyboardLanguagesRadioItems(): ArrayList { fun Context.getKeyboardLanguageText(language: Int): String { return when (language) { - LANGUAGE_ARABIC -> "${getString(R.string.translation_arabic)} (العربية)" + LANGUAGE_ARABIC -> getString(R.string.translation_arabic) LANGUAGE_BENGALI -> getString(R.string.translation_bengali) LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian) LANGUAGE_DANISH -> getString(R.string.translation_danish) From 4a07ecd29e282146ceb96d5e803b76c5ea4c5b22 Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Tue, 11 Jun 2024 07:39:40 +0530 Subject: [PATCH 3/3] Update Arabic key width --- app/src/main/res/xml/keys_letters_arabic.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/xml/keys_letters_arabic.xml b/app/src/main/res/xml/keys_letters_arabic.xml index 8734b40a..af316059 100644 --- a/app/src/main/res/xml/keys_letters_arabic.xml +++ b/app/src/main/res/xml/keys_letters_arabic.xml @@ -116,7 +116,7 @@ app:popupCharacters="گ" app:popupKeyboard="@xml/keyboard_popup_template" /> - +