-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18next-parser.config.js
More file actions
32 lines (32 loc) · 926 Bytes
/
Copy pathi18next-parser.config.js
File metadata and controls
32 lines (32 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module.exports = {
locales: ['en', 'fa'],
defaultNamespace: 'translation',
output: 'locales/$LOCALE/$NAMESPACE.json',
input: ['src/**/*.{ts,tsx}'],
keySeparator: false, // Use flat structure
namespaceSeparator: ':',
keepRemoved: true, // Don't remove existing translations
verbose: true,
// Add support for ctx.t() function calls
contextSeparator: '_',
// Parse function calls like ctx.t('key')
func: {
list: ['t', 'ctx.t'],
extensions: ['.ts', '.tsx']
},
// Parse template literals
trans: {
component: 'Trans',
i18nKey: 'i18nKey',
defaultsKey: 'defaults',
fallbackKey: function(ns, value) {
return value;
}
},
// Skip creating separate files for non-translation keys
skipDefaultValues: true,
// Use the key as default value for missing translations
useKeysAsDefaultValue: true,
// Only process translation namespace
namespaces: ['translation']
};