Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lkeegan
Copy link
Member

@lkeegan lkeegan commented Dec 17, 2024

  • 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 Allow admins to edit the german translations #211

- 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
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0.17668% with 565 lines in your changes missing coverage. Please review.

Project coverage is 1.49%. Comparing base (e594e1b) to head (03dfb76).

Files with missing lines Patch % Lines
frontend/src/lib/translations.ts 0.45% 221 Missing ⚠️
...end/src/lib/components/ChildrenRegistration.svelte 0.00% 37 Missing ⚠️
frontend/src/lib/i18n.svelte.ts 0.00% 28 Missing and 1 partial ⚠️
...ntend/src/lib/components/Admin/Translations.svelte 0.00% 22 Missing ⚠️
...ontend/src/lib/components/MilestoneOverview.svelte 0.00% 21 Missing ⚠️
frontend/src/lib/components/Milestone.svelte 0.00% 20 Missing ⚠️
frontend/src/lib/components/MilestoneGroup.svelte 0.00% 18 Missing ⚠️
...b/components/Admin/SubmittedMilestoneImages.svelte 0.00% 16 Missing ⚠️
frontend/src/lib/components/Frontpage.svelte 0.00% 15 Missing ⚠️
frontend/src/lib/components/ChildrenGallery.svelte 0.00% 13 Missing ⚠️
... and 36 more

❗ There is a different number of reports uploaded between BASE (e594e1b) and HEAD (03dfb76). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (e594e1b) HEAD (03dfb76)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #213       +/-   ##
==========================================
- Coverage   34.23%   1.49%   -32.74%     
==========================================
  Files         109      83       -26     
  Lines        3783    2611     -1172     
  Branches       94      95        +1     
==========================================
- Hits         1295      39     -1256     
- Misses       2409    2493       +84     
  Partials       79      79               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow admins to edit the german translations
2 participants