Changeset 128582 in webkit
- Timestamp:
- Sep 14, 2012 3:59:57 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128580 r128582 1 2012-09-14 Keishi Hattori <keishi@webkit.org> 2 3 LocaleMac should fallback to defaultLanguage for an invalid locale 4 https://bugs.webkit.org/show_bug.cgi?id=96744 5 6 Reviewed by Kent Tamura. 7 8 There is no way to tell if a locale identifier is valid or not in Cocoa 9 so we look if we have a matching language in the list of 10 ISOLanguageCodes given by NSLocale. 11 12 Covered in LocaleMacTest.invalidLocale. 13 14 * platform/text/mac/LocaleMac.mm: 15 (WebCore): 16 (WebCore::LocaleMac::LocaleMac): 17 (WebCore::LocaleMac::create): 18 1 19 2012-09-14 Vsevolod Vlasov <vsevik@chromium.org> 2 20 -
trunk/Source/WebCore/platform/text/mac/LocaleMac.mm
r128156 r128582 72 72 , m_didInitializeNumberData(false) 73 73 { 74 NSArray* availableLanguages = [NSLocale ISOLanguageCodes]; 75 // NSLocale returns a lower case NSLocaleLanguageCode so we don't have care about case. 76 NSString* language = [m_locale.get() objectForKey:NSLocaleLanguageCode]; 77 if ([availableLanguages indexOfObject:language] == NSNotFound) 78 m_locale = [[NSLocale alloc] initWithLocaleIdentifier:defaultLanguage()]; 74 79 } 75 80 -
trunk/Source/WebKit/chromium/ChangeLog
r128548 r128582 1 2012-09-14 Keishi Hattori <keishi@webkit.org> 2 3 LocaleMac should fallback to defaultLanguage for an invalid locale 4 https://bugs.webkit.org/show_bug.cgi?id=96744 5 6 Reviewed by Kent Tamura. 7 8 * tests/LocaleMacTest.cpp: 9 (TEST_F): 10 1 11 2012-09-13 Sheriff Bot <webkit.review.bot@gmail.com> 2 12 -
trunk/Source/WebKit/chromium/tests/LocaleMacTest.cpp
r128156 r128582 222 222 #endif 223 223 224 TEST_F(LocaleMacTest, invalidLocale) 225 { 226 EXPECT_STREQ(monthLabel("en_US", January).utf8().data(), monthLabel("foo", January).utf8().data()); 227 EXPECT_STREQ(decimalSeparator("en_US").utf8().data(), decimalSeparator("foo").utf8().data()); 228 } 229 224 230 static void testNumberIsReversible(const AtomicString& localeString, const char* original, const char* shouldHave = 0) 225 231 {
Note: See TracChangeset
for help on using the changeset viewer.