-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add built-in translations to components #4961
Comments
Following is the list of high-risk locales provided by @annierm18 from localization team which can be used to test before shipping PR #5471
|
I have completed testing for the test cases listed in the screen shot below. Tickets were opened for all issues found (links are included in screenshot). cc: @anveshmekala |
**Related Issue:** #4961 ## Summary This PR will add built-in translations to the components across calcite . Notable features : - Users no longer need to parse translated strings, translations are now built-in. List of the supported locale's can be found [here](https://developers.arcgis.com/calcite-design-system/localization/#locale-support). - One can overwrite default translations for a given locale using `messageOverrides` property. - Specifying `lang` at document level , component level and ancestor level is supported. - component level always takes precedence and then ancestor's followed by doc level. ``` <!--Though arabic is specified as lang at doc level , button component will follow Spanish for string localization . --> <html lang="ar"> <body> <calcite-button lang="es"> </calcite-button> </body> </html> ``` ### Migration To migrate calcite components that use `intl` props & properties for accessible labels for overriding default values, refer to the following example to start using `messageOverrides` object property. Before: ``` <!-- overriding via intl props --> <calcite-color-picker intl-saturation="{custom value}" intl-save="{custom value}"> </calcite-color-picker> ``` Current : ``` <!-- leveraging building translations. display translations for Spanish lang --> <calcite-color-picker lang="es"> </calcite-color-picker> <!-- if the user wants to customize the default translations provided, one can override as below --> <calcite-color-picker lang="es"> </calcite-color-picker> <script> const colorpickEl = document.querySelector('calcite-color-picker') colorpickerEl.messageOverrides = { blue = "custom value" , red = "custom value" } </script> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: JC Franco <jfranco@esri.com> Co-authored-by: Ben Elan <benelan@users.noreply.github.com> Co-authored-by: jona7150 <jturpin@esri.com> Co-authored-by: Ben Elan <belan@esri.com> Co-authored-by: Calcite Admin <calcite-admin@esri.com> Co-authored-by: jcfranco <jcfranco@users.noreply.github.com> Co-authored-by: Kitty Hurley <khurley@esri.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eliza Khachatryan <eli97736@esri.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Driscoll <mdriscoll@esri.com> Co-authored-by: Alison Stump <alisonailea@users.noreply.github.com>
Installed and assigned for verification. |
Verified on Of the above issues mentioned by Aine above, 2 have been closed and are included in the 1.0 release, and the remaining lower priority issues have been allocated to the February milestone. |
Overview
Currently, our components have placed the responsibility of text translations on the user. Unfortunately, this pattern has lead to some unnecessary boilerplate from teams/projects that have to support more than one locale and do not provide customized strings (e.g., each project needs to set up translation for the same strings and update each component).
The goal for this epic is to make it easier for developers to bring in components w/o having to worry about setting up translations themselves.
Tasks
Define pattern for localized components (see notes below) (feat: add built-in translations #5065)
intl<Prop>
s as these should no longer be needed Epic: remove deprecatedintl
properties & accessible label properties. #5946Add script to generate types for t9n bundles for type safety (feat: add built-in translations #5065)
Plan automation of translation-bundles
action items
Notes
src/components/<component>/assets/t9n/
intl<Prop>
values should no longer be set by defaultintl<Prop>
s should be merged w/ the built-in stringsQuestions
navigator.language
,document.documentOwner.lang
, global util)?Additional Resources
Prototype: #4960
i18n libs
cc @benelan @geospatialem
The text was updated successfully, but these errors were encountered: