Migrate usages of extension.(.*)@mozilla.org.* from properties to Fluent
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: nordzilla, Assigned: kpatenio)
References
Details
(Whiteboard: [fidefe-theme])
Attachments
(1 file)
As part of the M2 milestone for arewefluentyet, there are many usages of properties that should be moved to Fluent.
There are many that are of the following form:
extension.doh-rollout@mozilla.org.description
extension.doh-rollout@mozilla.org.name
extension.doh-rollout@mozilla.org.name
extension.formautofill@mozilla.org.description
extension.formautofill@mozilla.org.name
extension.pictureinpicture@mozilla.org.description
extension.pictureinpicture@mozilla.org.name
extension.screenshots@mozilla.org.description
extension.screenshots@mozilla.org.name
extension.webcompat-reporter@mozilla.org.description
extension.webcompat-reporter@mozilla.org.name
extension.webcompat@mozilla.org.description
extension.webcompat@mozilla.org.name
Many of these are generated [here] as an attempt hopefully match on a string and localize something, though many of these strings do not exist.
We should look at the actual sources of the LOCALE_BUNDLES
for this file [here]:
And move those properties to fluent to use them explicitly.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Toolkit::Form Autofill' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•2 years ago
|
||
And move those properties to fluent to use them explicitly.
In particular, we should not request localization of IDs we don't have, because it triggers deep fallback in Fluent.
So the code should look like this:
const LOCALIZED_EXTENSION_NAMES = [
"default-theme",
"firefox-compact-light",
"firefox-compact-dark",
"firefox-alpenglow",
];
function chooseValue(aAddon, aObj, aProp) {
let repositoryAddon = aAddon._repositoryAddon;
let objValue = aObj[aProp];
// ...
if (!aAddon.id in LOCALIZED_EXTENSION_NAMES) {
return [objValue, false];
}
let l10nId = `extension-meta-${aAddon.id}`;
let msg = l10n.formatMessagesSync([{id: l10nId}]); // XXX: can we do async here?
if (aProp == "title") {
return [msg.title, false];
} else if (aProp == "description") {
return [msg.description, false];
} else {
throw new Exception("This should never happen");
}
}
Comment 3•2 years ago
|
||
And l10n
is probably a custom const l10n = new Localization();
here if I'm not mistaken.
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by mtigley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a72ff9328e5 Migrate extension.(.*)@mozilla.org.* from properties to Fluent. r=mtigley,fluent-reviewers,robwu,flod
Comment 6•2 years ago
|
||
bugherder |
Comment 7•2 years ago
|
||
This change introduced a dependency of toolkit/mozapps/extensions/internal/XPIDatabase.jsm
on browser/locales/en-US/browser/appExtensionFields.ftl
which causes issues on non-Firefox products.
I'm not sure what the best way to deal with that is, but the extension-default-theme-*
strings should move back under toolkit
.
Comment 8•2 years ago
|
||
:fabrice - :robwu is looking for a better solution in bug 1733466.
Comment 9•2 years ago
|
||
(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #8)
:fabrice - :robwu is looking for a better solution in bug 1733466.
thanks!
Description
•