Skip to content

Commit

Permalink
Use language IDs instead of langauge names
Browse files Browse the repository at this point in the history
Issue #267
  • Loading branch information
eofster committed Aug 31, 2016
1 parent b48137c commit a3dda12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Telephone/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ + (void)initialize {
NSString *preferredLocalization = [[NSBundle mainBundle] preferredLocalizations][0];

// Do not format phone numbers in German localization by default.
if ([preferredLocalization isEqualToString:@"German"]) {
if ([preferredLocalization isEqualToString:@"de"]) {
defaultsDict[kFormatTelephoneNumbers] = @NO;
} else {
defaultsDict[kFormatTelephoneNumbers] = @YES;
}

// Split last four digits in Russian localization by default.
if ([preferredLocalization isEqualToString:@"Russian"]) {
if ([preferredLocalization isEqualToString:@"ru"]) {
defaultsDict[kTelephoneNumberFormatterSplitsLastFourDigits] = @YES;
} else {
defaultsDict[kTelephoneNumberFormatterSplitsLastFourDigits] = @NO;
Expand Down
2 changes: 1 addition & 1 deletion Telephone/AuthenticationFailureController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (IBAction)changeUsernameAndPassword:(id)sender {

NSString *statusText;
NSString *preferredLocalization = [[NSBundle mainBundle] preferredLocalizations][0];
if ([preferredLocalization isEqualToString:@"Russian"]) {
if ([preferredLocalization isEqualToString:@"ru"]) {
statusText = [[NSApp delegate] localizedStringForSIPResponseCode:
[[[self accountController] account] registrationStatus]];
} else {
Expand Down
2 changes: 1 addition & 1 deletion Telephone/CallController.m
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ - (void)SIPCallDidDisconnect:(NSNotification *)notification {
break;

default:
if ([preferredLocalization isEqualToString:@"Russian"]) {
if ([preferredLocalization isEqualToString:@"ru"]) {
NSString *statusText = [[NSApp delegate] localizedStringForSIPResponseCode:[[self call] lastStatus]];
if (statusText == nil) {
[self setStatus:[NSString stringWithFormat:NSLocalizedString(@"Error %d", @"Error #."),
Expand Down

0 comments on commit a3dda12

Please sign in to comment.