Skip to content

📜 i18next-cli plugin to extract Javascript/Typescript from Svelte components

License

Notifications You must be signed in to change notification settings

dreamscached/i18next-cli-plugin-svelte

Repository files navigation

i18next-cli Svelte plugin

GitHub branch check runs NPM Downloads GitHub License

This plugin is a simple TS/JS code extractor for Svelte component files, enabling i18next-cli extract to find the translation keys in <script>

Getting started

Simply import i18next-cli-plugin-svelte and add it to plugins array. Here's an example i18next.config.js file:

import { defineConfig } from "i18next-cli";
import i18nextSveltePlugin from "i18next-cli-plugin-svelte";

export default defineConfig({
	locales: ["en", "cs"],
	extract: {
		input: "src/**/*.{ts,svelte}",
		output: "src/assets/i18n/{{language}}.json",
		mergeNamespaces: true,
	},
	plugins: [
		i18nextSveltePlugin
	]
});

About

📜 i18next-cli plugin to extract Javascript/Typescript from Svelte components

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project