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

Thomas Herve therve at redhat.com
Thu Mar 23 09:07:58 UTC 2017


On Thu, Mar 23, 2017 at 9:39 AM, Peng Wu <peng.e.wu at gmail.com> wrote:
> Hi,
>
>   For TripleO UI project, some users requested to translate the web UI.
> But some web UI string are from heat template files in tripleo-heat-
> templates project.
>
>   In order to get translated templates displayed in tripleo-ui, we
> propose a blueprint as follows, which needs to change code in heat,
> tripleo-heat-tempates and tripleo-ui projects.
>
>   I18n proposal for heat templates 'description' help strings
>
>   1. Update heat project to accept "translation-domain" header in
> RESTful request, like "translation-domain: tripleo-heat-templates"
>
>      a. With "translation-domain" header, heat will try to translate
> "title" and "description" field using "tripleo-heat-templates.po"
>
>      b. Without "translation-domain" header, heat will return the
> fields like before
>
>      c. Add some field in config file for security to have a list of
>         allowed "translation-domain",
>         like "allowed-translation-domains: ['tripleo-heat-templates',
> ...]"

>From the Heat side of things, that sounds like a big no-no to me.
While we've done many things to cater to TripleO, this is way too
specific of a use case. It doesn't even make sense for the general use
case of passing user templates to Heat.


>   2. Update tripleo-heat-templates to generate the translation files,
>      like "tripleo-heat-templates.pot"
>
>      a. May need to write python script to extract "title" and
> "description" field from yaml files
>
>      b. May need to integrate into python babel config or use separate
> po files
>
>
>   3. Update tripleo-ui to use locale API with "translation-domain"
> header to ask the RESTful response with translated "title" and
> "description" fields from heat services
>
>      a. tripleo-ui will send request with two additional headers:
>         "Accept-Language" and "translation-domain: tripleo-heat-
> templates"

Those last 2 steps may make more sense. Possibly try to store those
translation files somewhere and manage them in the UI?

Thanks,

-- 
Thomas



More information about the OpenStack-dev mailing list