Bug 93083 - [Chromium-win] Use the default locale only if the browser locale matches to it
Summary: [Chromium-win] Use the default locale only if the browser locale matches to it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on:
Blocks: 93085
  Show dependency treegraph
 
Reported: 2012-08-03 03:09 PDT by Kent Tamura
Modified: 2012-08-05 18:13 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.25 KB, patch)
2012-08-03 03:18 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff
Patch 2 (3.67 KB, patch)
2012-08-03 04:01 PDT, Kent Tamura
morrita: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>