Skip to content

Translateable form and schemas #4426

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

Open
dafeder opened this issue Mar 5, 2025 · 0 comments
Open

Translateable form and schemas #4426

dafeder opened this issue Mar 5, 2025 · 0 comments

Comments

@dafeder
Copy link
Member

dafeder commented Mar 5, 2025

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:

  1. 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.
  2. Accommodate this somehow in the .ui.json files. Perhaps in addition to ui:options keys we can have ui:locale strings or something, and allow individual schema elements to be translated there.
  3. Support packaging .po files along with our schemas, which I think has some precedent in the JSON schema ecosystem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant