Command description is not localized

NEW
Assigned to

Status

()

Toolkit
WebExtensions: General
P5
normal
a year ago
9 hours ago

People

(Reporter: wbamberg, Assigned: anejaalisha, Mentored)

Tracking

({good-first-bug})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [commands][triaged])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
Created attachment 8751464 [details]
commands-l10n.zip

It should be possible for developers to provides localized versions of the "description" field in commands.

The "description" field for commands should be localized if it's referenced with a string of the form "__MSG_commandDescription__", and "commandDescription" exists in a messages.json file under the _locales directory.

For example, I've attached a zip containing an add-on with a _locales directory a containing messages.json that contains:

  "commandDescription": {
    "message": "Does stuff",
    "description": "Thingy."
  }

Then in the manifest.json the commands key is:

  "commands": {
    "toggle-feature": {
      "suggested_key": { "default": "Ctrl+Shift+U" },
      "description": "__MSG_commandDescription__"
    }
  }

If you install the add-on you'll see output like this in the Browser Console:

    __MSG_commandDescription__

In Chrome you get:

    Does stuff

This seems quite important, since AFAICT the only purpose of "description" is to show the user.
This is definitely something we should fix, but I'm not sure it's especially important at the moment. The command description definitely exists to be shown to the user, but at the moment, we don't actually show it anywhere. In Chrome, there's a configuration UI for extension commands where the field is used. We don't have anything similar, at the moment.
Whiteboard: [commands]

Comment 2

a year ago
we don't use descriptions yet - they are shown in prefferences where you can reassign key bindings.
Whiteboard: [commands] → [commands] good first bug triaged
(Reporter)

Comment 3

a year ago
It's true that Firefox doesn't have a native UI for assigning shortcuts, but an add-on could build its own UI for them.

Enabling an add-on to have its own UI for shortcuts is the only reason I can imagine that the description is accessible to add-ons via the JS API at all.

(just to clarify this, not to argue with your triage.)
Mentor: kmaglione+bmo@mozilla.com
Keywords: good-first-bug
Whiteboard: [commands] good first bug triaged → [commands][good first bug][triaged]

Updated

10 months ago
Whiteboard: [commands][good first bug][triaged] → [commands][triaged]

Updated

7 months ago
Component: WebExtensions: Untriaged → WebExtensions: General
Priority: -- → P5
(Assignee)

Comment 4

3 months ago
Hi,

If nobody is working on this, can I take up this bug?
Flags: needinfo?(kmaglione+bmo)
Sure! Let me know if you have any questions
Assignee: nobody → anejaalisha
Flags: needinfo?(kmaglione+bmo)
(Assignee)

Comment 6

3 months ago
Apologies for such a basic question. But how to exactly reproduce this bug?
Flags: needinfo?(kmaglione+bmo)
This is more like an "enhancement" than a "bug", so there are no easy steps to "reproduce".

The point is that that we don't localize the command descriptions the way Will described in comment #0.  So you would need to modify the loadCommandsFromManifest() method [1], in order to also read the localized descriptions (if present).  Also, you would need to add a test for new functionality in [2].

1) http://searchfox.org/mozilla-central/source/browser/components/extensions/ext-commands.js#70
2) http://searchfox.org/mozilla-central/source/browser/components/extensions/test/browser/browser_ext_commands_getAll.js
Flags: needinfo?(kmaglione+bmo)

Updated

22 days ago
Mentor: kmaglione+bmo@mozilla.com → tomica@gmail.com
Hey @anejaalish! Just checking in to see how you are doing with this bug. :)
You need to log in before you can comment on or make changes to this bug.