Closed Bug 293129 Opened 20 years ago Closed 18 years ago

ab-CD extension translations don't work anymore in new simple locale names (ab)

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gertpaul+moz, Assigned: axel)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; nl-NL; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; nl-NL; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

Due to the simple locale names, e.g. nl, extension translations which include
nl-NL locales (all translated extensions) don't work anymore. This is a big
problem, because it would be much work to adjust every  extensions and there
those extensions don't work anymore in older versions. If nothing is done, users
will not understand why their extensions are in English again.
Changing general.useragent.locale to e.g. nl-NL is no good idea, because you'll
find problems while installing languagepacks.

What should be done imo:
If the value of general.useragent.locale is 'ab' and no such a locale is
available in the extension, ab-AB should be displayed (or even other ab-CD
combinations). If no such a locale is available the English locale should be
displayed.

Reproducible: Always

Steps to Reproduce:
1. Install a translated trunkbuilds from
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk-l10n/ (e.g. nl)
2. Install a translated extension with includes the language of the trunkbuild
(e.g. https://addons.update.mozilla.org/extensions/moreinfo.php?id=128)
Actual Results:  
The extension is in the English language

Expected Results:  
The extension should have the language of the trunkbuild
I could've sworn this was supposed to work correctly. The code you want is

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/chrome/src/nsChromeRegistry.cpp&rev=1.330&mark=201-233,253#200
There was some confusion of pointer arith.

EndReading is after the string, thus, as == ae implies that you should do
*as in the first place. Anyway, as == ae check should be at the same point as
*bs == '-' and vice versa.

Untested patch coming up.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #182779 - Flags: review?(benjamin)
The "nl" (and also "sv-SE") build in
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk-l10n/ have
"en-US" as general.useragent.locale, perhaps because of bug 287262. So English
is AFAIK the correct choice here.
My apologies, I was wrong. I looked in firefox.js and found "en-US", but the
runtime value for the "sv-SE" build is "sv-SE", so please ignore the last comment.
Comment on attachment 182779 [details] [diff] [review]
shift the inc to the right place, compare the right iterators.

I think you want the ++ab; ++bs; before the "if (as == ae && bs == be)" check;
otherwise you could read past the end of "b"
Attachment #182779 - Flags: review?(benjamin) → review-
Taking review comments in. This is really just a nit, as we tested for equality

of the strings already, but better safe than sorry.

I tested this with a FF fr trunk build, enabled official (no, not going to put
that up anywhere), with fr-FR extension Geckomenu, 
http://wfilip.free.fr/dotclear/index.php?Geckomenu 
on a fresh profile.
I have set 
user_pref("general.useragent.locale", "fr-FR");
in a second run as well, with success.
Assignee: smontagu → axel
Attachment #182779 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #183378 - Flags: review?(benjamin)
Attachment #183378 - Flags: review?(benjamin)
Attachment #183378 - Flags: review+
Attachment #183378 - Flags: approval-aviary1.1a1?
Comment on attachment 183378 [details] [diff] [review]
shift the incrememnt a bit further

a=asa
Attachment #183378 - Flags: approval-aviary1.1a1? → approval-aviary1.1a1+
Comment on attachment 183378 [details] [diff] [review]
shift the incrememnt a bit further

sr=shaver, but boy, I hope the manual string gymnastics are worth it in terms
of performance.
Attachment #183378 - Flags: superreview+
Since things work correctly again in the latest builds I suppose this bug can be
marked as fixed?
(In reply to comment #10)
> Since things work correctly again in the latest builds I suppose this bug can
> be
> marked as fixed?
> 

marked as fixed

Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: