Allow other layouts for some languages

This commit is contained in:
Aleksandras Kostarevas 2024-06-08 19:09:41 +03:00
parent a93cfd83bd
commit 73c355fdf6

View File

@ -23,45 +23,54 @@ import org.futo.inputmethod.latin.uix.settings.SettingItem
val QwertyVariants = listOf("qwerty", "qwertz", "dvorak", "azerty", "colemak", "bepo", "pcqwerty")
fun makeQwertyWithPrimary(primary: String): List<String> {
return listOf(primary) + QwertyVariants.filter { it != primary }
}
fun makeQwertyWithPrimary(primary: String, secondary: String): List<String> {
return listOf(primary, secondary) + QwertyVariants.filter { it != primary && it != secondary }
}
val LocaleLayoutMap = mapOf(
"af" to listOf("qwerty"),
"af" to QwertyVariants,
"ar" to listOf("arabic"),
"az_AZ" to listOf("qwerty"),
"az_AZ" to QwertyVariants,
"be_BY" to listOf("east_slavic", "east_slavic_phonetic"),
"bg" to listOf("bulgarian"),
"bg" to listOf("bulgarian_bds"),
"bn_BD" to listOf("bengali_akkhor"),
"bn_IN" to listOf("bengali"),
"ca" to listOf("spanish"),
"cs" to listOf("qwertz"),
"da" to listOf("nordic"),
"de" to listOf("qwertz"),
"de_CH" to listOf("swiss"),
"el" to listOf("greek"),
"en_IN" to listOf("qwerty"),
"ca" to makeQwertyWithPrimary("spanish"),
"cs" to makeQwertyWithPrimary("qwertz"),
"da" to makeQwertyWithPrimary("nordic"),
"de" to makeQwertyWithPrimary("qwertz"),
"de_CH" to makeQwertyWithPrimary("swiss"),
"el" to makeQwertyWithPrimary("greek"),
"en_IN" to QwertyVariants,
"en_US" to QwertyVariants,
"en_GB" to QwertyVariants,
"eo" to listOf("spanish"),
"es" to listOf("spanish"),
"es_US" to listOf("spanish"),
"es_419" to listOf("spanish"),
"et_EE" to listOf("nordic"),
"eu_ES" to listOf("spanish"),
"eo" to makeQwertyWithPrimary("spanish"),
"es" to makeQwertyWithPrimary("spanish"),
"es_US" to makeQwertyWithPrimary("spanish"),
"es_419" to makeQwertyWithPrimary("spanish"),
"et_EE" to makeQwertyWithPrimary("nordic"),
"eu_ES" to makeQwertyWithPrimary("spanish"),
"fa" to listOf("farsi"),
"fi" to listOf("nordic"),
"fr" to listOf("azerty", "qwerty", "swiss", "bepo"),
"fr_CA" to listOf("qwerty", "azerty", "swiss", "bepo"),
"fr_CH" to listOf("swiss", "qwerty", "azerty", "bepo"),
"gl_ES" to listOf("spanish"),
"fi" to makeQwertyWithPrimary("nordic"),
"fr" to makeQwertyWithPrimary("azerty", "swiss"),
"fr_CA" to makeQwertyWithPrimary("qwerty", "swiss"),
"fr_CH" to makeQwertyWithPrimary("swiss"),
"gl_ES" to makeQwertyWithPrimary("spanish"),
"hi" to listOf("hindi", "hindi_compact"),
//"hi_ZZ" to listOf("qwerty"),
"hr" to listOf("qwertz"),
"hu" to listOf("qwertz"),
//"hi_ZZ" to QwertyVariants,
"hr" to makeQwertyWithPrimary("qwertz"),
"hu" to makeQwertyWithPrimary("qwertz"),
"hy_AM" to listOf("armenian_phonetic"),
"in" to listOf("qwerty"),
"is" to listOf("qwerty"),
"it" to listOf("qwerty"),
"it_CH" to listOf("swiss"),
"in" to QwertyVariants,
"is" to QwertyVariants,
"it" to QwertyVariants,
"it_CH" to makeQwertyWithPrimary("swiss"),
"iw" to listOf("hebrew"),
"ka_GE" to listOf("georgian"),
"kk" to listOf("east_slavic", "east_slavic_phonetic"),
@ -69,40 +78,40 @@ val LocaleLayoutMap = mapOf(
"kn_IN" to listOf("kannada"),
"ky" to listOf("east_slavic", "east_slavic_phonetic"),
"lo_LA" to listOf("lao"),
"lt" to listOf("qwerty"),
"lv" to listOf("qwerty"),
"lt" to QwertyVariants,
"lv" to QwertyVariants,
"mk" to listOf("south_slavic"),
"ml_IN" to listOf("malayalam"),
"mn_MN" to listOf("mongolian"),
"mr_IN" to listOf("marathi"),
"ms_MY" to listOf("qwerty"),
"ms_MY" to QwertyVariants,
"nb" to listOf("nordic"),
"ne_NP" to listOf("nepali_romanized", "nepali_traditional"),
"nl" to listOf("qwerty"),
"nl_BE" to listOf("azerty"),
"pl" to listOf("qwerty"),
"pt_BR" to listOf("qwerty"),
"pt_PT" to listOf("qwerty"),
"ro" to listOf("qwerty"),
"nl" to QwertyVariants,
"nl_BE" to makeQwertyWithPrimary("azerty"),
"pl" to QwertyVariants,
"pt_BR" to QwertyVariants,
"pt_PT" to QwertyVariants,
"ro" to QwertyVariants,
"ru" to listOf("east_slavic", "east_slavic_phonetic"),
"si_LK" to listOf("sinhala"),
"sk" to listOf("qwerty"),
"sl" to listOf("qwerty"),
"sk" to QwertyVariants,
"sl" to QwertyVariants,
"sr" to listOf("south_slavic"),
"sr_ZZ" to listOf("serbian_qwertz"),
"sv" to listOf("nordic"),
"sw" to listOf("qwerty"),
"sw" to QwertyVariants,
"ta_IN" to listOf("tamil"),
"ta_LK" to listOf("tamil"),
"ta_SG" to listOf("tamil"),
"te_IN" to listOf("telugu"),
"th" to listOf("thai"),
"tl" to listOf("spanish"),
"tr" to listOf("qwerty"),
"tl" to makeQwertyWithPrimary("spanish"),
"tr" to QwertyVariants,
"uk" to listOf("east_slavic", "east_slavic_phonetic"),
"uz_UZ" to listOf("uzbek"),
"vi" to listOf("qwerty"),
"zu" to listOf("qwerty"),
"vi" to QwertyVariants,
"zu" to QwertyVariants,
"zz" to QwertyVariants,
)