Closed Bug 472960 Opened 16 years ago Closed 16 years ago

[Mac] nsIScriptableDateFormat does not work correctly if region code is not specified

Categories

(Core :: Internationalization, defect)

All
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.2a1

People

(Reporter: dev-null, Assigned: smontagu)

References

Details

(Keywords: verified1.9.1, Whiteboard: [fixed by bug 360018])

Build ID: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; ja-JP-mac; rv:1.9.2a1pre) Gecko/20090110 Minefield/3.2a1pre

Steps to reproduce:
run the following JavaScript
var dts = Components.classes["@mozilla.org/intl/scriptabledateformat;1"]
  .getService(Components.interfaces.nsIScriptableDateFormat);
var s = dts.FormatDate("da",
                       dts.dateFormatLong,
                       2009, 1, 10);
alert(s);

Actual Result:
Sat, Jan 10, 2009

Expected Result(I'm not sure, I guess):
lør 10. jan 2009

I suspect the cause is that |*regionCode| is not set at
http://hg.mozilla.org/mozilla-central/annotate/1c4fdd5a9b17/intl/locale/src/mac/nsMacLocale.cpp#l266
It seems like http://mxr.mozilla.org/mozilla-central/source/intl/locale/src/mac/nsDateTimeFormatMac.cpp#386 only uses the script code and region code, whereas the language code is the primary identifier in the Mozilla locale code.
Blocks: 472666
Bug 470837 seems to be a friend of this one, from glancing at it. It's about day names being cumbersome on OSX, when no locale code is specified, like in the cookies dialog.
Depends on: 360018
Fixed by bug 360018
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Covered by the test for bug 22310
Flags: in-testsuite+
Verified on trunk and 1.9.1 with:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090421 Minefield/3.6a1pre ID:20090421032809

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b4pre) Gecko/20090421 Shiretoko/3.5b4pre ID:20090421030848
Status: RESOLVED → VERIFIED
Keywords: verified1.9.1
Hardware: x86 → All
Whiteboard: [fixed by bug 360018]
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.