Migrate extension permission strings from .properties to Fluent
Categories
(WebExtensions :: Frontend, task, P2)
Tracking
(firefox115 fixed)
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: eemeli, Assigned: eemeli)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files, 1 obsolete file)
Some of these messages currently use the legacy PluralForm API, which we'd like to drop.
The permission string formatting in Extension.jsm
currently requires passing in a separately constructed StringBundle as an argument, so some API changes will be required.
Some of the tests for the extension strings are parameterised to work differently in Thunderbird, so will probably need a corresponding update there to work.
Assignee | ||
Comment 1•2 years ago
|
||
This changes the arguments of ExtensionData.formatPermissionStrings(). The second bundle
arg is dropped, and a localization
option is added. Call sites in m-c are updated, but this will also need a matching update for Thunderbird. A few Thunderbird test cases will also need to be updated, as they currently point to a non-existing localization file path "messenger/addons.ftl".
Updated•2 years ago
|
Assignee | ||
Comment 2•1 years ago
|
||
As discussed at the addon workweek, this patch renames the Fluent l10n keys used for extension permissions to match the pattern:
webext-perms-description-{name}
where {name}
is the permission's unmangled name. The intent is to reduce the work required in adding more permissions later, as their name -> l10n id mapping does not need to be updated. A fluent-lint exception is added for these generated names. Permissions with names that are not valid as Fluent keys and message updates (and key renames) are supported via a PERMISSION_L10N_IDS
map.
Because Fluent localization keys are not enumerable and attempting to format a missing key is an error, this has a knock-on effect of needing to make ExtensionData.formatPermissionStrings()
async, as it now relies on the async lazy.NO_PROMPT_PERMISSIONS
value to skip some of the permissions. Accordingly, the l10n formatting calls are all made async, along with all callers of formatPermissionStrings()
.
Depends on D158663
Updated•1 years ago
|
Assignee | ||
Comment 3•1 years ago
|
||
The l10n migration shows a diff for addon-downloading-and-verifying
and addon-confirm-install-message
due to the en-US source having 1
rather than one
variants.
For addon-confirm-install-some-unsigned-message
,
the en-US source has a single-variant plural selector for localization to new languages.
In addition to moving strings from browser.properties
to the new addonNotifications.ftl
,
there's some shuffling of strings to & from browser.ftl
as well.
The intent is to collect the more rarely used strings out of files loaded during startup,
especially as many of the notification strings need to be formatted in a sync context.
For the most part, string keys are left roughly the same as they were in .properties.
With some guidance, some rationalisation might make sense as a part of this for the
rather wide selection of prefixes in this set:
addon-
site-permission-install-
webext-
xpinstall-
The addon-install-started
and addon-install-failed
notifications appear to need sync l10n formatting,
as using async format calls before their PopupNotifications.show()
leads to test failures in
toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
.
Depends on D178107
Assignee | ||
Comment 4•1 years ago
|
||
Depends on D178235
Updated•1 years ago
|
Assignee | ||
Comment 5•1 years ago
|
||
As mentioned in D178235, some of the add-on/webextension strings could be re-titled as a part of this change.
Rob, is this something that might be of interest?
Comment 7•1 years ago
|
||
(In reply to Eemeli Aro [:eemeli] from comment #5)
As mentioned in D178235, some of the add-on/webextension strings could be re-titled as a part of this change.
Rob, is this something that might be of interest?
Yes this is something that we'd be interested in, that can be done in a follow-up.
Comment 8•1 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/50f952ef9d20
https://hg.mozilla.org/mozilla-central/rev/c900208b3eaf
https://hg.mozilla.org/mozilla-central/rev/29a4c4bcd51d
Updated•1 years ago
|
Description
•