Closed Bug 1440235 Opened 7 years ago Closed 7 years ago

Port |Bug 1431260 - Migrate LocaleService::AvailableLocales from ChromeRegistry to multilocale.json|

Categories

(Thunderbird :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 61.0

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

Details

Attachments

(3 files, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #1431260 +++ As per bug 1431260 comment # we should add const { L10nRegistry, FileSource } = ChromeUtils.import("resource://gre/modules/L10nRegistry.jsm", {}); and + let locales = Services.locale.getPackagedLocales(); + const appSource = new FileSource("app", locales, "resource://app/localization/{locale}/"); + L10nRegistry.registerSource(appSource); to `final-ui-startup` - https://dxr.mozilla.org/comm-central/rev/91311b1d6aa3bddd427858cb7f8c149a81c71a92/mail/components/mailGlue.js#58
Attached patch 1440235-L10nRegistry.patch (v1) (obsolete) β€” β€” Splinter Review
This should do it. Note that final-ui-startup calls _onProfileStartup(), so I put the new code there. So this should work after bug 1431260 lands?
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #8952986 - Flags: review?(gandalf)
Comment on attachment 8952986 [details] [diff] [review] 1440235-L10nRegistry.patch (v1) Review of attachment 8952986 [details] [diff] [review]: ----------------------------------------------------------------- Yep, lgtm! I left a comment about the path but it's up to your discretion. Thank you for a quick reaction! :) ::: mail/components/mailGlue.js @@ +88,5 @@ > _onProfileStartup: function MailGlue__onProfileStartup() { > TBDistCustomizer.applyPrefDefaults(); > > + let locales = Services.locale.getPackagedLocales(); > + const appSource = new FileSource("app", locales, "resource://app/localization/{locale}/"); My knowledge of comm-central is limited, but I don't see there any `resource://app/` used. I know it's just a mock for now, but since we're landing it, maybe we should land it to already get ready for future `/localization/` directory being available? What I found scanning comm-central is `resource:///` paths, which in Firefox is an equivalent of `resource://app/` and I imagine in Thunderbird it'll be a Tb specific omni.ja? I found this: https://searchfox.org/comm-central/search?q=resource%3A%2F%2F%2F&case=false&regexp=false&path= So, I think the path here should be `resource:///localization/{locale}/`
Attachment #8952986 - Flags: review?(gandalf) → review+
Looks like nothing broke so for by not landing this, so this slipped a bit off the radar. Tom, Philipp, any opinion about what the path should be?
Flags: needinfo?(philipp)
Flags: needinfo?(mozilla)
I haven't wrapped my head around `resouces://` paths, so I don't have an informed opinion.
Flags: needinfo?(mozilla)
I'd suggest using resource:///chrome/{locale}/locale/{locale}/ for mail, or just the chrome:// uri. I've successfully been able to use ftl in calendar with an url like this. Please also see attached patch for calendar.
Flags: needinfo?(philipp)
Attachment #8965948 - Flags: review?(makemyday)
Comment on attachment 8965948 [details] [diff] [review] Calendar l10nregistry - v1 Review of attachment 8965948 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, r=me
Attachment #8965948 - Flags: review?(makemyday) → review+
Hmm, for calendar you're using let fs = new FileSource("calendar", locales , "resource://calendar/chrome/calendar-{locale}/locale/{locale}/"); and for mail you suggest: let fs = new FileSource("app", locales , "resource:///chrome/{locale}/locale/{locale}/"); That doesn't quite correspond. What am I missing?
Flags: needinfo?(philipp)
Each product is slightly different, you can openDialog("resource:///") to browse the app resource uri namespace. Obviously we need to find the folder with the localization files in it, not just use the exact same url as in calendar.
Flags: needinfo?(philipp)
The basic idea is to have one FileSource per omni.ja package (in Firefox we have two omni.ja, one for gre, one for browser).
Right, openDialog("resource:///chrome/en-US/locale/en-US/"); works, thanks!
Here we go. Should we use "app" or something else?
Attachment #8952986 - Attachment is obsolete: true
Attachment #8965995 - Flags: review?(philipp)
Comment on attachment 8965995 [details] [diff] [review] 1440235-L10nRegistry.patch (v2) Review of attachment 8965995 [details] [diff] [review]: ----------------------------------------------------------------- "app" sounds good to me, this matches what Firefox uses.
Attachment #8965995 - Flags: review?(philipp) → review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/31c55b1e1d59 Port bug 1431260 to TB [Migrate LocaleService::AvailableLocales from ChromeRegistry to multilocale.json]. r=philipp https://hg.mozilla.org/comm-central/rev/7a0e2dff1db7 Port bug 1431260 to TB [Migrate LocaleService::AvailableLocales from ChromeRegistry to multilocale.json], Calendar part. r=MakeMyDay
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 61.0
Care to fix the linting errors? TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/comm/calendar/base/src/calStartupService.js:76:21 | 'locales' is already declared in the upper scope. (no-shadow) TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/comm/calendar/base/src/calStartupService.js:77:21 | Identifier name 'fs' is too short (< 3). (id-length) TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/comm/calendar/base/src/calStartupService.js:77:61 | There should be no space before ','. (comma-spacing)
Status: RESOLVED → REOPENED
Flags: needinfo?(philipp)
Flags: needinfo?(makemyday)
Resolution: FIXED → ---
This should take care.
Flags: needinfo?(philipp)
Flags: needinfo?(makemyday)
Attachment #8966051 - Flags: review?(philipp)
Comment on attachment 8966051 [details] [diff] [review] FixLintingErrorsIncalStartupService-V1.diff Review of attachment 8966051 [details] [diff] [review]: ----------------------------------------------------------------- lgtm. Bonus points for making it in under 100 characters per line, I didn't count though.
Attachment #8966051 - Flags: review?(philipp) → review+
Thanks, here you go.
Attachment #8966051 - Attachment is obsolete: true
Attachment #8966053 - Flags: review+
Keywords: checkin-needed
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/74d0ddb667fd Fix linting errors in calStartupService.js. r=philipp
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: