[openstack-dev] [tripleo][ui] another i18n proposal for heat templates 'description' help strings
peng.e.wu at gmail.com
Mon May 8 08:20:01 UTC 2017
And the code to generate the above file is in:
The generated file need to be copied to tripleo-ui project, and
Please review it, thanks!
On Mon, 2017-04-10 at 16:13 +0100, Julie Pichon wrote:
> Hi Peng,
> I added some thoughts in-line, let me know what you think.
> On 10 April 2017 at 08:10, Peng Wu <peng.e.wu at gmail.com> wrote:
> > Hi,
> > In TripleO UI project users requested translation of the web UI.
> > But
> > some web UI strings are displayed from heat template files in
> > tripleo-
> > heat-templates project.
> > In order to get translated templates displayed in tripleo-ui, we
> > propose another solution as follows, which needs to change code in
> > tripleo-heat-templates and tripleo-ui projects.
> > I18n proposal for Heat templates 'description' help strings
> > to
> > include all translation strings, like "tripleo-heat-templates.js"
> > a. Need to write python script to extract "title" and
> > "description" field from yaml files and generate "tripleo-heat-
> > templates.js" for react-intl usage in tripleo-ui
> I think extracting the strings directly into js/json format may be
> be a viable option, because it isn't a format supported by
> Zanata .
> For tripleo-ui itself we use react-intl which expects json, and work
> with scripts to convert to/from pot and po (see ) which are fully
> supported by Zanata.
> Or is the idea that we'd also generate pot/po as intermediary steps
> only store json in the repo?
> > b. Use default message as message id or consider nodejs-i18n
> > for
> > tripleo-ui
> I'm wary of considering a library change considering the amount of
> churn it would cause in the code base for all the existing strings,
> plus that would then make backports more difficult. It really needs
> be considered carefully.
> > 2. Update tripleo-ui to use "tripleo-heat-templates.js"
> > a. Write some script to sync "tripleo-heat-templates.js" from
> > tripleo-heat-templates
> > b. Call formatMessage function for "title" and "description"
> > field
> > with message id (use default message) and default message or
> > consider
> > nodejs-i18n for tripleo-ui
> > Refer URL for message id: https://github.com/yahoo/react-intl/iss
> > ues/
> > 912
> Could you explain a bit more the issue with the ids? I see us
> an id in every message  and this is how they are referenced in the
> locale json  (the mapping is not done by message, but by ID).
> When it comes to the THT message, I think they all have a hierarchy
> that perhaps could be used as a key to map between the original
> and the translation? Something along the lines of
> whichever form the API gives us at the moment.
> > Please evaluate it, thanks!
> Thank you!
>  http://docs.zanata.org/en/release/user-guide/projects/project-typ
>  https://github.com/openstack/tripleo-ui/blob/master/docs/translat
>  https://github.com/openstack/tripleo-ui/blob/master/src/js/compon
>  https://github.com/openstack/tripleo-ui/blob/master/i18n/locales/
More information about the OpenStack-dev