mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-09 08:07:42 +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()
|
||||
}
|
||||
|
||||
/** 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 {
|
||||
if (displayLocale == null) resourceSubtypeDisplayNameCache[hashCode()]?.let { return it }
|
||||
|
||||
|
@ -136,7 +139,9 @@ object SubtypeLocaleUtils {
|
|||
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(
|
||||
R.string.subtype_with_layout_generic,
|
||||
locale().localizedDisplayName(resources, displayLocale),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue