-
Notifications
You must be signed in to change notification settings - Fork 7
Make views translatable #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
What is the scheme that you're using for translatable attributes? I would like to see if we can sync up between Cockpit and Openshift, and our scripts can recognize these attributes as transtlatable as well. |
I chose angular-gettext https://angular-gettext.rocketeer.be/ as a platform to be translated strings and they use "translate" attribute like you can see in the changes. gettext is most familiar method for translators to work on and is well supported on the various translation services like transifex and zanata etc. |
FWIW I'm working on OpenShift i18n as well and submit PR at openshift/origin#4332. FYI. |
We use gettext too in Cockpit, but use a different attribute syntax: @tagoh How do you handle translatable attribute text in angular-gettext? That is something l like this:
|
@stefwalter they just follow the AngularJS way. in that case, there are two way to make it translatable. one is to use the filter within the interpolocation like <tab heading="{{'My Lovely Headidng'|translate}}"> and another one is to use the custom annotation. see https://angular-gettext.rocketeer.be/dev-guide/custom-annotations/ |
Hmmm, that's very angular specific. Although Cockpit uses some angularjs in parts, many components in Cockpit are implemented without it. Will have to think about this further. |
Sure. that said this shouldn't conflict to the out of box so that the translations are eventually merged into the js itself at the build time. it should still work with cockpit even I suppose. |
Hmmm, wait. How are translations loaded? I hope not every translation is sent to the browser for all users ... |
Hmm, it shouldn't be too much given that translations for all of languages available are fully translated. that said angular-gettext also supports the dynamic loading on demand. so it can be improved later if someone thinks it is too much. just including translations into js would be good start so far I believe. |
Cockpit does dynamic loading of languages. So please don't include them in this bower component's dist/object-describer.js. Doing so would prevent us from using that file directly. I don't see translations compiled into dist/object-describer.js in this commit. So far, so good. |
Okay. updated PR to load languages dynamically and added sample code to change the language on demand to index.html. |
Any more feedback on this? |
The UI in object-describer isn't ready to i18n. this change allows users to see translated UI.