[Bug]: <SwDataTable /> component i18n messages cannot be resolved
Closed this issue · 2 comments
atloss commented
Package
@meteor/component-library
Package version
3.0.0-alpha1
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-ywaatz?file=src%2FApp.vue
Steps to reproduce
- Setup a running environment as seen in the StackBlitz project with Vue 3 and i18n plugin for the translations
- Add the
<SwPagination />
and<SwDataTable />
component
Actual behavior
- With inactive i18n legacy mode in
main.js
both components can be rendered. However, the translations are not resolved for both components - With active i18n legacy mode in
main.js
the translations of the<SwPagination />
component resolve correctly. However, the<SwDataTable />
crashes, since it doesn't support legacy mode.
Expected behavior
There should be a i18n module config that supports correct translation functionality for all components of the library.
System Info
No response
Any additional comments?
No response
Code of Conduct
- I have read and agree to follow Meteor's Code of Conduct
Haberkamp commented
Hey @atloss, the code snippet below got it working for me. You need to enable the legacy mode and set the allowComposition
property to true.
const i18n = createI18n({
// Enable legacy mode
legacy: true,
locale: 'de',
messages: {
en: {
hello: 'Hello world!',
},
},
// Enable this
allowComposition: true,
});
I hope this helps you.
atloss commented