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

Zane Bitter zbitter at redhat.com
Thu Mar 23 19:36:19 UTC 2017


On 23/03/17 04:39, Peng Wu 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',
> ...]"

I agree with Thomas, Heat is the _last_ place you should be looking to 
do the translation. Personally, I think this is yet another entry in a 
long list of "why TripleO should generate its Heat templates". (Some of 
the templates are actually preprocessed with Jinja2 now, so it may be 
possible to work translation in there.) A poor substitute for that might 
be to translate stuff in the TripleO UI itself. What will never ever 
make sense is for Heat to include a list of strings that might possibly 
have occurred in application templates at some point in the past and 
their translations.

>   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"
>
>   Please evaluate it, thanks!
>
> Regards,
>   Peng
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>




More information about the OpenStack-dev mailing list