WIP: feat: add vite-plugin-i18n #2676
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#2676
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen:feature/vite-plugin-i18n"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I took a look at https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n
The package will shortly be replaced by https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n but as of now the latter doesn't support rollup 3 which we are already using.
Looking at the stats I was surprised to find out that per default all messages are loaded and included in the main bundle. I couldn't yet find out how one can split this.
When using the plugin the message compiler isn't included in the final build, which is a good thing! See https://vue-i18n.intlify.dev/guide/advanced/optimization.html#performance
If I undertand it correctly it's possible to split the translations over all vue components. But then all translations are loaded for that component.
Also syncing via Crowdin would be more complex and would need help of: https://github.com/intlify/vue-i18n-locale-message#api
I don't really like that latter tool, seems a bit risky to depend the whole translation process on such a tool. What happens if that doesn't get updated anymore?
EDIT
I also had to delete the
nl-NL.json
in order for the build to succeed, meaning that the actual bundle should be even larger…What's the advantage of using the vite plugin vs what we're currently using?
Precompilation of the messages as static strings.
Meaning:
Seems like the dutch mail was missing escaping the '@' character.