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

Jiri Tomasek jtomasek at redhat.com
Wed May 10 12:05:43 UTC 2017



On 9.5.2017 17:01, Florian Fuchs wrote:
> On Mon, May 8, 2017 at 10:20 AM, Peng Wu <peng.e.wu at gmail.com> wrote:
>> Hi Julie,
>>
>>    I generated one example javascript file containing the translatable
>> strings.
>>    URL: https://pwu.fedorapeople.org/openstack-i18n/tripleo/tripleo-heat
>> -templates.js
>>
>>    And the code to generate the above file is in:
>>    https://pwu.fedorapeople.org/openstack-i18n/tripleo/
>>
>>    The generated file need to be copied to tripleo-ui project, and
>> translate as other javascript files.
>>
>>    Please review it, thanks!
> 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.
> 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.
>
> 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.
>
> 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.
>
> [1] https://github.com/openstack/tripleo-ui/blob/master/src/js/components/deployment/DeploymentDetail.js#L106
>       https://github.com/openstack/tripleo-ui/blob/master/src/js/components/deployment/DeploymentDetail.js#L59
>
> __________________________________________________________________________
> 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

I am probably a bit late to the discussion, but I think we're missing 
quite important thing and that is the fact that TripleO UI is supposed 
to use various plans (template sets) not strictly tripleo-heat-templates 
repository contents. Tripleo-heat-templates repository is just a default 
plan, but user can provide own changed files to the plan. Or create new 
plan which is very different from what default tripleo-heat-templates 
repository holds.

Also I am quite scared of keeping the GUI-specific file in sync with 
tripleo-heat-templates contents.

IMHO a proper solution is introducing translations as part of 
tripleo-heat-templates repository - template files hold the keys and 
translations are held in a separate files in THT.

-- Jirka



More information about the OpenStack-dev mailing list