Closed
Bug 455738
Opened 16 years ago
Closed 16 years ago
Add support for new Vista locales
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b2
People
(Reporter: rain1, Assigned: rain1)
References
()
Details
Attachments
(2 files, 2 obsolete files)
3.99 KB,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
799 bytes,
patch
|
smontagu
:
review+
|
Details | Diff | Splinter Review |
Windows Vista has several new locales that aren't currently supported by Mozilla code. They aren't present in the locale table at <http://mxr.mozilla.org/mozilla-central/source/intl/locale/src/windows/nsIWin32LocaleImpl.cpp#158>, so people in these locales have their dates and times formatted incorrectly, amongst other issues. One way would be to just add the new locales that can be added to the table. Another possible option would be to investigate adding support for using locale names on Vista instead of locale identifiers (locale identifiers aren't unique to locales any more). There are -Ex functions and GetSystemDefaultLocaleName / GetUserDefaultLocaleName to support locale names on Vista. GetSystemDefaultLocaleName: <http://msdn.microsoft.com/en-us/library/ms776369(VS.85).aspx> GetUserDefaultLocaleName: <http://msdn.microsoft.com/en-us/library/ms776371(VS.85).aspx>
Assignee | ||
Comment 1•16 years ago
|
||
More potentially useful functions, these basically do whatever's done in GetPlatformLocale/GetXPLocale. LCIDToLocaleName: <http://msdn.microsoft.com/en-us/library/ms776386(VS.85).aspx> LocaleNameToLCID: <http://msdn.microsoft.com/en-us/library/ms776388(VS.85).aspx>
Assignee | ||
Comment 2•16 years ago
|
||
Assignee: smontagu → sid1337
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•16 years ago
|
||
Comment on attachment 343286 [details] [diff] [review] Patch to call LocaleNameToLCID/LCIDToLocaleName if available I've tested this patch, and it works as expected on Vista. Haven't tested on XP, though I don't think it should change anything there.
Attachment #343286 -
Flags: superreview?(smontagu)
Attachment #343286 -
Flags: review?(smontagu)
Comment 4•16 years ago
|
||
Comment on attachment 343286 [details] [diff] [review] Patch to call LocaleNameToLCID/LCIDToLocaleName if available r+moa=smontagu. It would be nice to have some tests for this, particularly to ensure that we get the same results on <=XP and Vista for the locales that are special-cased in the existing code, but I don't know if that is practical.
Attachment #343286 -
Flags: superreview?(smontagu)
Attachment #343286 -
Flags: review?(smontagu)
Attachment #343286 -
Flags: review+
Assignee | ||
Comment 5•16 years ago
|
||
It seems like those function don't support some locales that the current supports, should I add a fallback to that instead of just returning NS_ERROR_FAILURE?
Keywords: checkin-needed
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 6•16 years ago
|
||
Yes, please add the fallback.
Assignee | ||
Comment 7•16 years ago
|
||
I've also changed the LPWSTR to LPCWSTR, as that's what the actual function definition is, despite what MSDN says. That eliminated the need for the clone data function.
Attachment #343286 -
Attachment is obsolete: true
Assignee | ||
Comment 8•16 years ago
|
||
I made a mistake -- nsAString isn't guaranteed to be null-terminated. About tests: since this interface isn't scriptable, the only way to do this seems to be to write a C++ test.
Attachment #343367 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Attachment #343370 -
Flags: review?(smontagu)
Updated•16 years ago
|
Attachment #343370 -
Flags: review?(smontagu) → review+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 9•16 years ago
|
||
Comment on attachment 343370 [details] [diff] [review] Updated patch, using nsAutoString instead of a direct pointer [Checkin: Comment 9] http://hg.mozilla.org/mozilla-central/rev/0e4ab2fd22e7
Attachment #343370 -
Attachment description: Updated patch, using nsAutoString instead of a direct pointer → Updated patch, using nsAutoString instead of a direct pointer
[Checkin: Comment 9]
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b2
Comment 10•16 years ago
|
||
Is there a good alternative for this sort of thing on Windows Mobile, or should I just #ifndef WINCE this code?
Comment 11•16 years ago
|
||
Comment on attachment 343370 [details] [diff] [review] Updated patch, using nsAutoString instead of a direct pointer [Checkin: Comment 9] >+ WCHAR ret_locale[LOCALE_NAME_MAX_LENGTH]; >+ int rv = lcidToLocaleName(winLCID, ret_locale, LOCALE_NAME_MAX_LENGTH, 0); This must be a pretty new constant, my SDK doesn't have it...
Comment 12•16 years ago
|
||
Yeah, windows mobile doesn't have it at all.
Assignee | ||
Comment 13•16 years ago
|
||
Another approach is to put the offending block under an ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS. smontagu: sorry about bugging you for another review :(
Attachment #343517 -
Flags: review?(smontagu)
Comment 14•16 years ago
|
||
Same error { .../intl/locale/src/windows/nsIWin32LocaleImpl.cpp(688) : error C2065: 'LOCALE_NAME_MAX_LENGTH' : undeclared identifier } on my Windows 2000 with { Visual C++ 8 Express directory: [...]\Microsoft Visual Studio 8\VC Platform SDK directory: [...]\Microsoft Platform SDK for Windows Server 2003 R2 }
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 15•16 years ago
|
||
Comment on attachment 343517 [details] [diff] [review] Define LOCALE_NAME_MAX_LENGTH if it hasn't already been done [Checkin: Comment 16] r+moa=smontagu
Attachment #343517 -
Flags: review?(smontagu) → review+
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 16•16 years ago
|
||
Comment on attachment 343517 [details] [diff] [review] Define LOCALE_NAME_MAX_LENGTH if it hasn't already been done [Checkin: Comment 16] http://hg.mozilla.org/mozilla-central/rev/28fc43e4394c
Attachment #343517 -
Attachment description: Define LOCALE_NAME_MAX_LENGTH if it hasn't already been done → Define LOCALE_NAME_MAX_LENGTH if it hasn't already been done
[Checkin: Comment 16]
Comment 17•16 years ago
|
||
(In reply to comment #13) > Another approach is to put the offending block under an ifndef > MOZ_DISABLE_VISTA_SDK_REQUIREMENTS. Maybe be this could be added as a comment ?
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Assignee | ||
Comment 18•16 years ago
|
||
(In reply to comment #17) > > Maybe be this could be added as a comment ? I don't think that's necessary, as the file already includes several other #ifdefs which aren't there in older SDKs.
You need to log in
before you can comment on or make changes to this bug.
Description
•