Skip to content

Commit

Permalink
fix(login): Fix language list sorting on login page
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodySlum committed Jul 27, 2023
1 parent 5b35263 commit e0d76fb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion UI/MainUI/SOGoRootPage.m
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,19 @@ - (NSString *) localizedLanguage
return [self labelForKey: [self language]];
}

NSComparisonResult languageSort(id el1, id el2, void *context)
{
NSString *t1, *t2;

t1 = [context labelForKey: el1];
t2 = [context labelForKey: el2];

return [t1 compare: t2 options: NSCaseInsensitiveSearch];
}

- (NSArray *) languages
{
return [[SOGoSystemDefaults sharedSystemDefaults] supportedLanguages];
return [[[SOGoSystemDefaults sharedSystemDefaults] supportedLanguages] sortedArrayUsingFunction: languageSort context: self];
}

- (NSString *) languageText
Expand Down

0 comments on commit e0d76fb

Please sign in to comment.