Closed Bug 776841 Opened 13 years ago Closed 13 years ago

Localization : TypeError bestMatchingLocale is null

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 776854

People

(Reporter: backy0175, Unassigned)

Details

Attachments

(1 file)

Attached image 3 screenshots of test
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1 Build ID: 20120713134347 Steps to reproduce: I tried to test the functionality of localization with Add-on SDK 1.8 Actual results: When I test it. In api-util/lib/l10n/core.js, "TypeError: bestMatchingLocale is null" has occurred. Expected results: Should work properly without error.
Severity: normal → critical
Priority: -- → P1
I think the problem is that Flightdeck doesn't let you create the "locale" folder at the addon's top-most level. locale/ needs to be next to data/ and lib/, not in data/ Alex, can you confirm that? (I see the traceback error when my test addon's main.js is just 'require("l10n");' and there is no locale folder or any valid xx-XX.properties files within the locale folder, but I think that's as intended.)
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to Wes Kocher (:KWierso) from comment #1) > I think the problem is that Flightdeck doesn't let you create the "locale" > folder at the addon's top-most level. > > locale/ needs to be next to data/ and lib/, not in data/ > > Alex, can you confirm that? Yes, flightdeck doesn't allow using localization feature :( For the reason you gave. locale/ doesn't live in data folder. Having said that, we should see such awfull exception when locale folder is missing!
I opened bug 776854 in order to request this feature in Addon builer.
> I think the problem is that Flightdeck doesn't let you create the "locale" > folder at the addon's top-most level. I see. I had been a misunderstanding. Because, I read the L10n-sample https://builder.addons.mozilla.org/addon/1015876/ before the test and this sample was using the data\locale\us-EN.properties. And there is no way to create top level folder.
With current master, you will have the following error in JS console instead: info: Error while loading localization: There is no localization file for your language. So this bug is either: - fixed in 1.10 by bug 748114 (if we only care about the exception), - duplicate or depends on 776854
(In reply to backy0175 from comment #4) > Because, I read the L10n-sample > https://builder.addons.mozilla.org/addon/1015876/ before the test and this > sample was using the data\locale\us-EN.properties. > And there is no way to create top level folder. This example is using its own l10n module which has nothing to do with the addon-kit/SDK one. But you can definitely use it while Addon builder team is working on this missing piece, or use the SDK with command line tools.
(In reply to Alexandre Poirot (:ochameau) from comment #6) > This example is using its own l10n module which has nothing to do with the > addon-kit/SDK one. But you can definitely use it while Addon builder team is > working on this missing piece, or use the SDK with command line tools. Alexandre, thanks in your recommend. I will wait for editor updated. Because, I had already published some addons what created by Add-on Builder. https://addons.mozilla.org/en-US/firefox/user/6110569/#my-addons And I don't like to use not standard feature.
Duping this to the Builder bug. Alex, can we cherry-pick that other localization patch to 1.9?
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Bug 748114's patch isn't really an obvious one so I'd wait for it to bake in dev branch.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: