-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor i18n implementation #213
Conversation
03dfb76
to
fe4d038
Compare
- main improvements - all language texts can now be edited from the admin interface - in frontend code we now have autocomplete for translation ids - change in use - i18n-svelte -> lib/i18n.svelte - `$locale` -> `i18n.locale` - `$locales` -> `i18n.locales` - `$_('a.b')` -> `i18n.tr.a.b` - to add a text, add the id to lib/translations.ts - code changes - remove i18n-svelte library - remove locales/de.json: this is now included in the static folder of the deployed website, not part of the frontend source code anymore - use camel case for all translation ids for consistency and to allow use without quotes - de is now also editable in admin interface - resolves #211
3c70332
to
fd1c13a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice addition, looks good. The only question I have is if there would be a way to have defaults for, e.g., the names of the buttons in the profile popover or similar functional elements. Someone who is not familiar with the code might be a little confused by the amount of names and labels and doesn´t know what to provide there upon initial deployment.
Yes I was also thinking about that and I agree - I guess the most developer-friendly option would be to put the actual german text in https://github.com/ssciwr/mondey/pull/213/files#diff-63f05097c4a548b2bc2106f45ca89b7986d834aaddc361c23ea8b1850c2e59b6 instead of empty strings, even if this wastes some bandwidth. The alternative would be to ship a de.json as part of the source code but not part of the website, and modify the local docker / testing setup to serve that at runtime, but don't think it's worth the extra complications just to avoid downloading some redundant data, at least for now. |
…when developing the frontend
Quality Gate passedIssues Measures |
$locale
->i18n.locale
$locales
->i18n.locales
$_('a.b')
->i18n.tr.a.b