Skip to content

Commit f4be39e

Browse files
author
Jakub Łobos
committed
add i18n parser
1 parent ec4ec2e commit f4be39e

File tree

6 files changed

+8816
-5760
lines changed

6 files changed

+8816
-5760
lines changed

i18next-parser.config.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
export default {
2+
contextSeparator: ":",
3+
// Key separator used in your translation keys
4+
createOldCatalogs: false,
5+
// Save the \_old files
6+
defaultNamespace: "translation",
7+
// Default namespace used in your i18next config
8+
defaultValue: "__NOT_TRANSLATED__",
9+
// Default value to give to empty keys
10+
indentation: 4,
11+
// Indentation of the catalog files
12+
keepRemoved: false,
13+
// Keep keys from the catalog that are no longer in code
14+
keySeparator: ".",
15+
// Key separator used in your translation keys
16+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
17+
// see below for more details
18+
lexers: {
19+
ts: ["JavascriptLexer"],
20+
tsx: ["JsxLexer"],
21+
default: ["JavascriptLexer"],
22+
},
23+
lineEnding: "auto",
24+
// Control the line ending. See options at https://github.com/ryanve/eol
25+
locales: ["en", "pl", "de"],
26+
// An array of the locales in your applications
27+
namespaceSeparator: ":",
28+
// Namespace separator used in your translation keys
29+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
30+
output: "public/static/locales/$LOCALE.json",
31+
// Supports $LOCALE and $NAMESPACE injection
32+
// Supports JSON (.json) and YAML (.yml) file formats
33+
// Where to write the locale files relative to process.cwd()
34+
input: undefined,
35+
// An array of globs that describe where to look for source files
36+
// relative to the location of the configuration file
37+
sort: true,
38+
// Whether or not to sort the catalog
39+
skipDefaultValues: false,
40+
// Whether to ignore default values.
41+
useKeysAsDefaultValue: false,
42+
// Whether to use the keys as the default value; ex. "Hello": "Hello", "World": "World"
43+
// This option takes precedence over the `defaultValue` and `skipDefaultValues` options
44+
verbose: false,
45+
// Display info about the parsing including some stats
46+
failOnWarnings: false,
47+
// Exit with an exit code of 1 on warnings
48+
customValueTemplate: null,
49+
// If you wish to customize the value output the value as an object, you can set your own format.
50+
// ${defaultValue} is the default value you set in your translation function.
51+
// Any other custom property will be automatically extracted.
52+
//
53+
// Example:
54+
// {
55+
// message: "${defaultValue}",
56+
// description: "${maxLength}", // t('my-key', {maxLength: 150})
57+
// }
58+
};

0 commit comments

Comments
 (0)