[openstack-dev] [tripleo][ui] another i18n proposal for heat templates 'description' help strings

Peng Wu peng.e.wu at gmail.com
Mon May 15 05:36:44 UTC 2017


Hi Florian,

On Tue, 2017-05-09 at 17:01 +0200, Florian Fuchs wrote:
> Thanks for the update Peng! A few comments:
> 
> 1. A minor thing: The file is missing the import for the
> defineMessages function, so that would have to be added here.

  Fixed.

> 2. The UI looks up messages by their object key, not the message id
> (random examples: [1]). The current naming would make that quite hard
> (description1, description2, descriptionN, ...). Ideally the key
> would
> be created using some reproducible conventions. For instance, the UI
> stores EnvironmentGroups by their title, Environments by their file
> path and Parameters by their name. If the message keys would reflect
> this structure, the UI could look up the objects dynamically, based
> on
> the naming conventions.
> 

  From react-intl reply, maybe we can use formatMessage like follow:

  <FormattedMessage id={message} defaultMessage={message}>

  URL: https://github.com/yahoo/react-intl/issues/609

> Two more things I noticed:
> 
> I count roughly 3400 occurrences of the word "description" in current
> tripleo-heat-templates. I'm not sure we need them all (your current
> example file only lists about 600, which would still be an acceptable
> number I guess), but if we do, we should probably think about some
> dynamic way to load messages in the UI and not put them all into one
> huge file.
> 

  I think we could improve it later or in next version.

Regards,
  Peng

> We need to handle cases where translatable t-h-t strings don't have a
> corresponding message object in the generated js file. That's
> probably
> not a big thing, but something we have to take care of.



More information about the OpenStack-dev mailing list