-
Notifications
You must be signed in to change notification settings - Fork 373
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
Rework i18n support in JSON Forms core #1825
Conversation
Labels, descriptions and error messages can now be translated via special translation functions handed over to JSON Forms. The translations are automatically handed within the default mapping functions and are therefore available in all renderer sets. This includes a key-determination algorithm, allowing to either rely on using labels as keys or specifying 'i18n' keys in UI Schema options or directly within the JSON Schema. Errors are handled separately to allow for maximum flexibility. Includes test cases for the most common mapping functions. Also AJV is set to non-strict by default to not throw errors when handing over JSON Schemas containing 'i18n' keys.
Tested and reviewed the code. |
@sdirix could you put an example here with i18n keys in the schema or uischema? I don't find the right way of setting this in the case of |
@andresgutgon There is an example in the Vue2-Vuetify renderer set for the 'basic' example (see under the 'schema' tab) https://jsonforms-vuetify-renderers.netlify.app/#/example/basic That has i18n keys and also an enum, maybe that will be helpful. |
The enums actually have a bug right now in the React Material renderers (Angular and Vue are fine). They will render correctly with the first locale selection but will not update their labels when the translator is changed without an additional schema change. This will be fixed here: #1879 |
Labels, descriptions and error messages can now be translated via
special translation functions handed over to JSON Forms.
The translations are automatically handed within the default
mapping functions and are therefore available in all renderer sets.
This includes a key-determination algorithm, allowing to either rely
on using labels as keys or specifying 'i18n' keys in UI Schema options
or directly within the JSON Schema. Errors are handled separately to
allow for maximum flexibility.
Includes test cases for the most common mapping functions.
Also AJV is set to non-strict by default to not throw errors when
handing over JSON Schemas containing 'i18n' keys.