From 3ff68bce98e30203e75a6b52e79a8125f1683be8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Jan 2018 16:24:55 +0100 Subject: [PATCH] [keyboard] Correct guessing for Arabic variants --- src/modules/keyboard/KeyboardPage.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/modules/keyboard/KeyboardPage.cpp b/src/modules/keyboard/KeyboardPage.cpp index a1904f5d4..9e4b7e3ae 100644 --- a/src/modules/keyboard/KeyboardPage.cpp +++ b/src/modules/keyboard/KeyboardPage.cpp @@ -306,8 +306,28 @@ KeyboardPage::onActivate() * identifier in guessing -- so it should be something * like _. */ - static auto specialCaseMap = QMap( { - { "ar_EG", "ara" }, /* Egyptian Arabic */ + static constexpr char arabic[] = "ara"; + static const auto specialCaseMap = QMap( { + /* Most Arab countries map to Arabic keyboard (Default) */ + { "ar_AE", arabic }, + { "ar_BH", arabic }, + { "ar_DZ", arabic }, + { "ar_EG", arabic }, + { "ar_IN", arabic }, + { "ar_IQ", arabic }, + { "ar_JO", arabic }, + { "ar_KW", arabic }, + { "ar_LB", arabic }, + { "ar_LY", arabic }, + /* Not Morocco: use layout ma */ + { "ar_OM", arabic }, + { "ar_QA", arabic }, + { "ar_SA", arabic }, + { "ar_SD", arabic }, + { "ar_SS", arabic }, + /* Not Syria: use layout sy */ + { "ar_TN", arabic }, + { "ar_YE", arabic }, { "ca_ES", "cat_ES" }, /* Catalan */ { "as_ES", "ast_ES" }, /* Asturian */ { "en_CA", "eng_CA" }, /* Canadian English */