Closed Bug 22310 Opened 25 years ago Closed 15 years ago

Locale conversion to support 3 letter language

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: nhottanscp, Assigned: bugzilla)

References

Details

(Keywords: intl)

Attachments

(3 files, 1 obsolete file)

Platform locale (e.g., LCID) to the XP locale (internally used) conversion needs
change to support 3 letter language (ISO-639-2).
There are platform specific changes needed.
Unix - change not to assume 2 letters for language
Windows/Macintosh - change the mapping table to be extensible
Status: NEW → ASSIGNED
Target Milestone: M16
Target Milestone: M16 → M18
Target Milestone: M18 → M20
Target Milestone: M20 → Future
*** Bug 69561 has been marked as a duplicate of this bug. ***
Keywords: intl
OS: Windows NT → All
I may have filed another bug on the same issue.
Assignee: nhottanscp → jshin
Status: ASSIGNED → NEW
Blocks: 441167
Add support for locales ja-JP-mac, kok-IN, nn-NO and nb-NO and allow error handling on Windows. Patch copied from bug 441167.
Attachment #327373 - Flags: review?(smontagu)
Attachment #327373 - Flags: review?(smontagu) → review+
now what is next? should it be checked in or something else? by who?
This is the JavaScript I used to test the Windows patch.

The Mac code seems quite similar to the Windows code, so I guess it needs some fixing too, but I don't have a Mac, so I cannot test.

I tried a script similar to this one on Linux, but it seems to return the date in a machine readable form ignoring the locale completely, but at least it gives a date for all tested locales.
Assignee: jshin1987 → smontagu
QA Contact: teruko → i18n
Assignee: smontagu → bugzilla
Pushed in 15867:085edeb5e56d.
Status: NEW → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Priority: P3 → --
Resolution: --- → FIXED
Target Milestone: Future → mozilla1.9.1a1
reed: my patch was Windows-only. Linux already worked, but it looks like Mac still needs a patch. Correct me if I a am wrong, but I don't think this is fixed on Mac.
(In reply to comment #7)
> I don't think this is
> fixed on Mac.

That's right. Mac still has problem.
"ja-JP-mac" should be converted to "ja-JP".

Requesting blocking because Bug 441167 has been exposed this issue and causes regression.
(See Bug 472666)
Status: RESOLVED → REOPENED
Flags: blocking1.9.2?
Flags: blocking1.9.1?
Resolution: FIXED → ---
This is a direct conversion of the Windows patch to the Mac code. As I don't have a Mac, I haven't tested it. It might not even compile.
(In reply to comment #10)
> +    if (strcmp(lang_list[i].iso_code, language_code)==0) {
>        *scriptCode = lang_list[i].mac_script_code;
>        *langCode = lang_list[i].mac_lang_code;
>        return NS_OK;
>      }

I have not tested it either, but I guess |*regionCode| should be initialized.
(In reply to comment #10)
> Created an attachment (id=356005) [details]
> Mac OS locale parser (not tested)

The patch does not compile.

intl/locale/src/mac/nsMacLocale.cpp: In member function ‘virtual nsresult nsMacLocale::GetPlatformLocale(const nsAString_internal&, short int*, short int*, short int*)’:
intl/locale/src/mac/nsMacLocale.cpp:244: error: ‘j’ was not declared in this scope
intl/locale/src/mac/nsMacLocale.cpp:244: error: ‘NS_StringGetData’ was not declared in this scope
(In reply to comment #12)
> The patch does not compile.

As I said: I haven't tried, and I can't.
(In reply to comment #11)
> I have not tested it either, but I guess |*regionCode| should be initialized.

Filed this issue as Bug 472960.

I think Bug 441167 should be backed out (or add #ifndef XP_MACOSX) unless both this bug and Bug 472960 get fixed.
I've changed my mind.
Clearing requesting blocking on this, and nominating Bug 441167 instead.
Flags: blocking1.9.2?
Flags: blocking1.9.1?
I will be happy to work together to make a patch, if you like. Just mail me off bugzilla.
Blocks: 472666
Works fine for ja-JP-mac, but I don't test for other locales because I don't know expected results.

(In reply to comment #16)
> I will be happy to work together to make a patch, if you like. Just mail me off
> bugzilla.

We should use Bugzilla for other developers to see it.
Attachment #356005 - Attachment is obsolete: true
It seems we have a patch in here. Is it ready for review?
Attachment #356712 - Flags: review?(smontagu)
I tried running the testcase in attachment 327471 [details] on Mac, and I don't really follow what's happening: ja-JP outputs "2008年 6月 30日 (月) 0:56:34 PM", but all the other locales in the testcase (including ja-JP-mac) output "Mon, Jun 30, 2008 12:56:34 PM".
(In reply to comment #19)
Exactly which locales did you test with? Note that some of the English fallbacks might be caused by this bug while other English fallbacks might be caused by bug 472960.
Comment on attachment 356712 [details] [diff] [review]
Mac OS locale parser (modified)
[Checkin: Comment 22]

Thanks for the pointer. I discovered that bug 472960 is fixed by the patch in bug 360018; and that with that patch all the testcases in attachment 327471 [details] and more work correctly.

So this patch is fine for now, but in the long term we probably want to rip out most of the existing nsMacLocale.cpp and any other places that use the deprecated Carbon system functions.
Attachment #356712 - Flags: review?(smontagu) → review+
Keywords: checkin-needed
Attachment #327373 - Attachment description: Windows locale parser → Windows locale parser [Checkin: Comment 6]
Comment on attachment 356712 [details] [diff] [review]
Mac OS locale parser (modified)
[Checkin: Comment 22]


http://hg.mozilla.org/mozilla-central/rev/e42e2fbb98fa
Attachment #356712 - Attachment description: Mac OS locale parser (modified) → Mac OS locale parser (modified) [Checkin: Comment 22]
Status: REOPENED → RESOLVED
Closed: 16 years ago15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: mozilla1.9.1a1 → mozilla1.9.2a1
Attachment 327471 [details] could be the basis of an xpcshell test (though as far as I know it will pass only on Windows and Mac right now).
Flags: in-testsuite?
Tests: http://hg.mozilla.org/mozilla-central/rev/81dc4af9e961
Flags: in-testsuite? → in-testsuite+
Depends on: 484664
Depends on: 485728
(In reply to comment #24)
> Tests: http://hg.mozilla.org/mozilla-central/rev/81dc4af9e961

1.9.1 landing: bug 360018 comment 59!

*****

NB: Mac patch did not land on 1.9.1 (yet).
Depends on: 360018
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: