dkan
dkan copied to clipboard
Translateable form and schemas
Following up #3684
Because the forms are build from schema and ui-schema JSON files, they are localize-able in the same way other Drupal forms are.
One solution could be to have multiple JSON schemas that match a locale name by convention, but there are some issues with this approach. I think there needs to be one single-language schema file that reflects the default language on the website that is the single-source-of-truth validation schema. Then any parts that need to be localized are translated individually.
Some ways to deal with this could be:
- Somehow have DKAN register the translatable parts of the schema with the Drupal string translation system. You can then use the i18n UI to add translations for each string, and those strings are localized before being used on the form.
- Accommodate this somehow in the .ui.json files. Perhaps in addition to
ui:optionskeys we can haveui:localestrings or something, and allow individual schema elements to be translated there. - Support packaging .po files along with our schemas, which I think has some precedent in the JSON schema ecosystem.