Last Comment Bug 653135 - GCLI command help should be localizable
: GCLI command help should be localizable
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Joe Walker [:jwalker] (needinfo me or ping on irc)
:
: J. Ryan Stinnett [:jryans] (use ni?)
Mentors:
Depends on: 653119
Blocks: 653139 GCLI-HELP
  Show dependency treegraph
 
Reported: 2011-04-27 08:51 PDT by Joe Walker [:jwalker] (needinfo me or ping on irc)
Modified: 2011-08-25 04:04 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-04-27 08:51:36 PDT
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
  }
});
Comment 1 :Ehsan Akhgari 2011-04-27 18:49:45 PDT
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.
Comment 2 Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-25 04:04:02 PDT
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

Note You need to log in before you can comment on or make changes to this bug.