Bug 93083

Summary: [Chromium-win] Use the default locale only if the browser locale matches to it
Product: WebKit Reporter: Kent Tamura <tkent>
Component: PlatformAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: morrita
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 93085    
Attachments:
Description Flags
Patch
none
Patch 2 morrita: review+

Description Kent Tamura 2012-08-03 03:09:06 PDT
http://code.google.com/p/chromium/issues/detail?id=139337

For a calendar picker, we have used month names and day-of-week names obtained from the OS default locale. However, the year-month format and [Today] [Clear] labels are decided with the browser locale.

So, if the OS default locale is en-US and the browser locale is ja-JP,
  - Month names and DOW names are English
  - [Today] [Clear] labels are Japanese, and year-month format is for ja-JP.
    The calendar picker shows '2012年 August' (OOPS!)
Comment 1 Kent Tamura 2012-08-03 03:18:49 PDT
Created attachment 156305 [details]
Patch
Comment 2 Hajime Morrita 2012-08-03 03:51:21 PDT
Comment on attachment 156305 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=156305&action=review

> Source/WebCore/platform/text/LocaleWin.cpp:81
> -    static LocaleWin* currentLocale = LocaleWin::create(LOCALE_USER_DEFAULT).leakPtr();
> +    static LocaleWin* currentLocale;

I'd extract LCID lookup part to a function, then we easily do early return and the code will look simpler.
Comment 3 Kent Tamura 2012-08-03 04:01:51 PDT
Created attachment 156315 [details]
Patch 2

make a function
Comment 4 Kent Tamura 2012-08-03 04:05:53 PDT
Comment on attachment 156305 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=156305&action=review

>> Source/WebCore/platform/text/LocaleWin.cpp:81
>> +    static LocaleWin* currentLocale;
> 
> I'd extract LCID lookup part to a function, then we easily do early return and the code will look simpler.

Indeed.  Updated the patch.
Comment 5 Kent Tamura 2012-08-05 18:13:00 PDT
Committed r124721: <http://trac.webkit.org/changeset/124721>