Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 1.16 KB

README.md

File metadata and controls

60 lines (47 loc) · 1.16 KB

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