The default bug view has changed. See this FAQ.

GCLI command help should be localizable

RESOLVED FIXED

Status

()

Firefox
Developer Tools
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jwalker, Assigned: jwalker)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Currently GCLI commands have a description element that is in English. They should have the ability to specify strings using a locale.

Current syntax:

gcli.addCommand({
  name: 'help',
  params: [
    {
      name: 'search',
      type: 'string',
      description: 'Search string to narrow the output.',
      defaultValue: null
    }
  ],
  returnType: 'html',
  description: 'Get help on the available commands.',
  exec: function(env, args) {
    // blah blah
  }
});


Since GCLI is an external project we can not tie l10n to the firefox l10n process. What we can do is attempt to provide a way to allow l10n either in place or via a lookup system.

Possible in-place l10n:

gcli.addCommand({
  name: 'help',
  params: [
    {
      name: 'search',
      type: 'string',
      description: {
        en_US: 'Search string to narrow the output',
        gk_GK: 'Αναζήτηση string για να περιορίσετε την έξοδο'
      }
      defaultValue: null
    }
  ],
  returnType: 'html',
  description: {
    en_US: 'Get help on the available commands',
    gk_GK: 'Ζητήστε βοήθεια σχετικά με τις διαθέσιμες εντολές'
  },
  exec: function(env, args) {
    // blah blah
  }
});


Possible way to have a lookup system:

gcli.addCommand({
  name: 'help',
  params: [
    {
      name: 'search',
      type: 'string',
      description: { key: 'gcli.command.help.search.desc' },
      defaultValue: null
    }
  ],
  returnType: 'html',
  description: { key: 'gcli.command.help.desc' },
  exec: function(env, args) {
    // blah blah
  }
});
Assignee: nobody → jwalker
Blocks: 642229
Depends on: 653119
Blocks: 653139
FWIW, this would be fine RTL-size.  We can use the RLM and LRM characters as needed to make embedding the command names in the translated string work correctly.
No longer blocks: 642229
Blocks: 659059
Implemented as described, with a minor change to allow a 'root' locale (named to be compatible with requirejs) which allows for a default that isn't 'en_US', so a French developer can provide:

'root': 'Bonjour',
'en_us': 'Hello'

See Internationalization at https://github.com/mozilla/gcli/blob/master/docs/index.md
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.