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

Document new translation (i18n) support #207

Closed
sdirix opened this issue Dec 13, 2021 · 0 comments · Fixed by #222
Closed

Document new translation (i18n) support #207

sdirix opened this issue Dec 13, 2021 · 0 comments · Fixed by #222
Assignees
Labels

Comments

@sdirix
Copy link
Member

sdirix commented Dec 13, 2021

MVP:

  • Add a new page to the docs called i18n
  • Explain the concept i18n: (locale, translate, translateError) given via props
  • Add the new props to the bindings documentation
  • Mention that the renderer sets themselves are not yet translated, link to issue in JSON Forms: Translate hard coded strings in existing renderer sets jsonforms#1826
  • i18n key in UI Schema options, i18n key in JSON Schema, otherwise default generated based on the property path.
  • Default Error Translation:
    • <i18nkey>.error.custom: Single message no matter how many errors are there
    • <i18nkey>.error.<keyword> e.g. name.error.required or name.error.pattern,
    • error.<keyword>, e.g. error.required, error.pattern
    • should match pattern [0-9]+
  • Enum Translations
  • Translate function should be side effect free and should be stable (memoized) to avoid unnecessary rerenderings, i.e. the translate function should only change if there are new translations.
  • Showcase how to access locale, translate and translateError in custom renderers (React). const ctx = useJsonForms(). Mention that for example locale can be used for number formatting.

Polished:

  • Showcase translation examples

    • default keys
    • i18n keys
    • default messages
  • Showcase integration with react-intl

  • There is a live demo of translation support in Vue-Vanilla dev setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants