Bug 100329
| Summary: | Rename Localizer to Locale | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kent Tamura <tkent> |
| Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ap, keishi |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 100627, 100634 | ||
| Bug Blocks: | |||
Kent Tamura
I'd like to rename them to LocalizerFoo. However Alexey objected the name 'Localizer'.
https://bugs.webkit.org/show_bug.cgi?id=96355#c7
Alexey, do you have a proposal for the name? LocaleData, LocalizedData?
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Can you describe in several ways what this class is? One way to pick a good name is to start with such a description.
Kent Tamura
Ok.
What is Localizer class?
- An object of Localizer class is associated to a specific locale
- It converts number strings represented in the HTML5 format to localized number strings , and vice versa.
- It formats date/time data represented in DateComponents class to localized strings, and parses localized date/time strings.
- It provides localized date format patterns for date, datetime, month, and time input types
- It provides various localized data to build UI. e.g. localized month names, localized AM/PM, localized decimal point, localized day-of-week names, the first day of week, text direction
It is a combination of NSLocale, NSNumberFormatter, NSDateFormatter, NSCalendar, and it's similar to QLocale of Qt.
We discussed the name before introducing Localizer, and other class name candidates were Locale, LocaleData, and LocaleInfo. We dropped Locale because locale.h will conflict with a C standard header.
Alexey Proskuryakov
> We dropped Locale because locale.h will conflict with a C standard header.
This is certainly a good reason not to use this name for the header, but how about using it for the class? This happened before with String, so we had PlatformString.h, and now have WTFString.h. WebCore/platform/PlatformLocale.h doesn't look bad.
Alternatively, you could consider following Cocoa design, and actually having separate classes for each of these.
Kent Tamura
Alexey, thank you for the comment.
PlatformLocale.h and Locale class sound reasonable. I'll rename so.