mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 20:19:05 +01:00
Fix language in source filter list jumping to top incorrectly
Fixes #9068
This commit is contained in:
@@ -11,10 +11,14 @@ import java.util.Locale
|
||||
*/
|
||||
object LocaleHelper {
|
||||
|
||||
val comparator = compareBy<String>(
|
||||
{ getDisplayName(it) },
|
||||
{ it == "all" },
|
||||
)
|
||||
/**
|
||||
* Sorts by display name, except keeps the "all" (displayed as "Multi") locale at the top.
|
||||
*/
|
||||
val comparator = { a: String, b: String ->
|
||||
if (a == "all") -1
|
||||
else if (b == "all") 1
|
||||
else getDisplayName(a).compareTo(getDisplayName(b))
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns display name of a string language code.
|
||||
|
||||
Reference in New Issue
Block a user