mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-09 16:17:44 +00:00
don't include default latin non-qwerty layout in subtype display name
so now we're back at "French" and not "French (AZERTY)"
This commit is contained in:
parent
154f7c3a1e
commit
e21c135b90
1 changed files with 7 additions and 2 deletions
|
@ -124,7 +124,10 @@ object SubtypeLocaleUtils {
|
||||||
return subtype.locale().toString() + "/" + subtype.mainLayoutNameOrQwerty()
|
return subtype.locale().toString() + "/" + subtype.mainLayoutNameOrQwerty()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Subtype display name is <Locale> (<Layout>), defaults to system locale */
|
/**
|
||||||
|
* Subtype display name is <Locale> when using the default layout, or <Locale> (<Layout>) otherwise
|
||||||
|
* [displayLocale] defaults to system locale
|
||||||
|
*/
|
||||||
fun InputMethodSubtype.displayName(displayLocale: Locale? = null): String {
|
fun InputMethodSubtype.displayName(displayLocale: Locale? = null): String {
|
||||||
if (displayLocale == null) resourceSubtypeDisplayNameCache[hashCode()]?.let { return it }
|
if (displayLocale == null) resourceSubtypeDisplayNameCache[hashCode()]?.let { return it }
|
||||||
|
|
||||||
|
@ -136,7 +139,9 @@ object SubtypeLocaleUtils {
|
||||||
LayoutUtilsCustom.getDisplayName(layoutName)
|
LayoutUtilsCustom.getDisplayName(layoutName)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (keyboardLayoutToDisplayName.containsKey(layoutName)) {
|
// if it's a default layout, we want to use the nameResId instead of explicitly showing the layout name
|
||||||
|
if (keyboardLayoutToDisplayName.containsKey(layoutName)
|
||||||
|
&& SubtypeSettings.getResourceSubtypesForLocale(locale()).none { it.mainLayoutName() == layoutName }) {
|
||||||
return resources.getString(
|
return resources.getString(
|
||||||
R.string.subtype_with_layout_generic,
|
R.string.subtype_with_layout_generic,
|
||||||
locale().localizedDisplayName(resources, displayLocale),
|
locale().localizedDisplayName(resources, displayLocale),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue