-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fallback to English WCAG terms when untranslated #139
Comments
@mhansma96 Would you know where the current fallback to English for non-translated UI terms is managed in the code? |
@remibetin You might get closer to what you're looking for either here: https://github.com/w3c/wai-wcag-em-report-tool/tree/main/src/locales/en (the English translation folder to set them) Or here: https://github.com/w3c/wai-wcag-em-report-tool/blob/main/src/components/App.svelte (This is where the context of the app is set and languages are imported) |
Hey, a quick tldr answer: default locale is first locale entered at src/locales/index.json The file / locales are passed through to i18n initializing script src/scripts/i18n.js and there the first locale is picked as default. |
Thank you very much @mhansma96 & @rvantonisse for your answers. That seems to work for UI terms translations, but not for WCAG guidelines/SC translations though. |
Hey @remibetin , WCAG does not have fallback translations due to different translation call (I think...) At src/components/ui/auditor/auditorview.svelte the translations are called on principles and guidelines as json object. In same folder criterion.svelte criterion translations are pulled as object. This is what I think is the cause. If there is no translation for WCAG2.2 criteria then this will be missing in the criterion json objects. I would expect the translation plugin used would pull the missing object from the default locale. There are 2 translation calls, you can find them in src/stores/i18nStore.js. The first works for UI, the second on WCAG. You may try to call wcag translations with the translate function as normal UI. This looked not possible at the time. |
You might also find some traces of the WCAG here: https://github.com/w3c/wai-wcag-em-report-tool/blob/main/src/locales/en/WCAG.json And here: https://github.com/w3c/wai-wcag-em-report-tool/blob/main/src/stores/wcagStore.js |
Updating the tool for WCAG 2.2. meant adding new SCs in
wcag.json
translated files (Dutch & French versions) for the tool to continue to work in the translated language.Issues:
Possible solutions:
lang="en"
to elements surrounding that contentThe text was updated successfully, but these errors were encountered: