svelte-translate-tools
v0.1.7
Published
Translation tools to extract/generate/compile translation files for your Svelte App (must be used with the package [svelte-translate](https://github.com/noelmugnier/svelte-translate)) at build time.
Downloads
1
Readme
Svelte Translate Tool (inspired by angular i18n and svelte-i18n)
Translation tools to extract/generate/compile translation files for your Svelte App (must be used with the package svelte-translate) at build time.
Installation
npm install svelte-translate-tools -D
Dynamic translations usages
plugins: [
extracti18n({languages:['en-GB','fr-FR'], defaultLanguage:'en-GB'}),
generatei18n(),,
svelte({
preprocess: [
sveltePreprocess({ sourceMap: !production })
],
...
}),
...
]
Precompiled translations usages
plugins: [
extracti18n({languages:['en-GB','fr-FR'], defaultLanguage:'en-GB'}),
generatei18n(),,
svelte({
preprocess: [
preprocess_compilei18n({language:"fr-FR"}),
sveltePreprocess({ sourceMap: !production })
],
...
}),
...
]
then replace your
<DynamicTranslatedApp>
</DynamicTranslatedApp>
with
<PreTranslatedApp>
</PreTranslatedApp>
TODO
- [ ] support context/description in def() helper in order to extract them and complete xlf files require a fork on xliff library to use custom attributes