From 4e68ec9d5229bb57a95aa981ff09da769cbdbea9 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 19 Mar 2015 08:32:37 -0400 Subject: [PATCH] Fix Language-Region tags in Web interface Fixes #3121 --- NEWS | 1 + UI/MailerUI/UIxMailEditor.m | 4 +++- UI/Scheduler/UIxCalMainView.m | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 855bebdb0..9826552c3 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Bug fixes - fixed freebusy data when 'busy off hours' is enabled and period starts during the weekend - fixed fetching of freebusy data from the Web interface - fixed EAS handling of Bcc in emails (#3138) + - fixed Language-Region tags in Web interface (#3121) 2.2.16 (2015-02-12) ------------------- diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index 80c29f512..7931bee13 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -230,7 +230,9 @@ static NSArray *infoKeys = nil; - (NSString *) localeCode { // WARNING : NSLocaleCode is not defined in - return [locale objectForKey: @"NSLocaleCode"]; + // Region subtag must be separated by a dash + NSString *s = [locale objectForKey: @"NSLocaleCode"]; + return [s stringByReplacingOccurrencesOfString: @"_" withString: @"-"]; } - (void) setFrom: (NSString *) newFrom diff --git a/UI/Scheduler/UIxCalMainView.m b/UI/Scheduler/UIxCalMainView.m index f9fd125eb..78d4723c6 100644 --- a/UI/Scheduler/UIxCalMainView.m +++ b/UI/Scheduler/UIxCalMainView.m @@ -82,7 +82,9 @@ - (NSString *) localeCode { // WARNING : NSLocaleCode is not defined in - return [locale objectForKey: @"NSLocaleCode"]; + // Region subtag must be separated by a dash + NSString *s = [locale objectForKey: @"NSLocaleCode"]; + return [s stringByReplacingOccurrencesOfString: @"_" withString: @"-"]; } - (NSArray *) monthMenuItems