i18next-parser.config.ts 946 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
// i18next-parser.config.ts
import { getLanguages } from './src/lib/i18n/index.ts';

const getLangCodes = async () => {
	const languages = await getLanguages();
	return languages.map((l) => l.code);
};

export default {
	contextSeparator: '_',
	createOldCatalogs: false,
	defaultNamespace: 'translation',
Ased Mammad's avatar
Ased Mammad committed
13
14
15
	defaultValue: function (locale, namespace, key, value) {
		return key;
	},
16
17
18
19
20
	indentation: 2,
	keepRemoved: false,
	keySeparator: false,
	lexers: {
		svelte: ['JavascriptLexer'],
Ased Mammad's avatar
Ased Mammad committed
21
		js: ['JavascriptLexer'],
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
		ts: ['JavascriptLexer'],

		default: ['JavascriptLexer']
	},
	lineEnding: 'auto',
	locales: await getLangCodes(),
	namespaceSeparator: false,
	output: 'src/lib/i18n/locales/$LOCALE/$NAMESPACE.json',
	pluralSeparator: '_',
	input: 'src/**/*.{js,svelte}',
	sort: true,
	verbose: true,
	failOnWarnings: false,
	failOnUpdate: false,
	customValueTemplate: null,
	resetDefaultValueLocale: null,
	i18nextOptions: null,
	yamlOptions: null
};