Fixed: CPLocal can't handle unknown language codes

When the language code is not known it still sets the current language code
to the unknown code instead of the defualt 'en_US' code.
This makes the test cases for CPDateFormatter fail when run on a foreign system.
This commit is contained in:
Martin Carlberg
2013-05-14 13:30:30 +02:00
parent e047212f5f
commit 9d86391bdb
+1 -1
View File
@@ -101,7 +101,7 @@ var sharedSystemLocale = nil,
language = [CPString stringWithFormat:@"%s_%s", [language lowercaseString], [language uppercaseString]];
if ([availableLocaleIdentifiers indexOfObject:language])
if ([availableLocaleIdentifiers indexOfObject:language] !== CPNotFound)
localeIdentifier = language;
}