On Mon, May 8, 2017 at 10:20 AM, Peng Wu <peng.e...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to