Skip to content
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

mgr/dashboard: Fix translation of variables #30671

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

tspmelo
Copy link
Contributor

@tspmelo tspmelo commented Oct 1, 2019

Translation of variables is not supported.
Had to pass the string directly into the i18n method.

Signed-off-by: Tiago Melo tmelo@suse.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs

Translation of variables is not supported.
Had to pass the string directly into the i18n method.

Signed-off-by: Tiago Melo <tmelo@suse.com>
@tspmelo tspmelo requested a review from p-se October 1, 2019 15:02
@tspmelo tspmelo requested a review from a team as a code owner October 1, 2019 15:02
@tspmelo
Copy link
Contributor Author

tspmelo commented Oct 2, 2019

jenkins test make check

Copy link
Contributor

@p-se p-se left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Where can I read more about this feature being unsupported?

@tspmelo
Copy link
Contributor Author

tspmelo commented Oct 15, 2019

There is no direct mention in the i18n-polyfill README, but variables are not part of the supported types and it will show an warning when you extract the source translations:

npm run i18n:extract

> ceph-dashboard@0.0.0 i18n:extract /ceph/src/pybind/mgr/dashboard/frontend
> ng xi18n --i18n-format xlf --i18n-locale en-US --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US

WARNING: We cannot extract variable values passed to TranslateService (yet)
WARNING: We cannot extract variable values passed to TranslateService (yet)

Angular own html translations don't support variables. We mention that in our HACKING

@ricardoasmarques ricardoasmarques merged commit a54f47c into ceph:master Oct 15, 2019
@ricardoasmarques ricardoasmarques deleted the wip-i18n-vars branch October 15, 2019 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants