Always use localized compare when sorting list items presented to the user

This commit is contained in:
Ethan Wong
2022-11-06 00:29:33 +08:00
parent 5bc3288d59
commit 3ba14f8596
2 changed files with 2 additions and 2 deletions

View File

@@ -153,7 +153,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
public var sortedFolders: [Folder]? {
if let folders = folders {
return Array(folders).sorted(by: { $0.nameForDisplay.caseInsensitiveCompare($1.nameForDisplay) == .orderedAscending })
return folders.sorted()
}
return nil
}

View File

@@ -135,7 +135,7 @@ private extension ArticleThemesManager {
let allThemeNames = appThemeNames.union(installedThemeNames)
return allThemeNames.sorted(by: { $0.compare($1, options: .caseInsensitive) == .orderedAscending })
return allThemeNames.sorted(by: { $0.localizedCaseInsensitiveCompare($1) == .orderedAscending })
}
func allThemePaths(_ folder: String) -> [String] {