first commit

This commit is contained in:
s2
2024-12-13 08:53:01 +01:00
commit 2746dc9c4e
5477 changed files with 682458 additions and 0 deletions

47
i18next-scanner.config.js Normal file
View File

@@ -0,0 +1,47 @@
const fs = require('fs');
const path = require('path');
module.exports = {
input: [
'src/**/*.{js,ejs}'
],
output: './',
options: {
debug: false,
func: {
list: ['i18next.t', 'i18n.t', 'this.i18n.tr'],
extensions: ['.js', '.ejs']
},
lngs: ['en', 'it', 'de'],
ns: [
'translation'
],
defaultLng: 'en',
defaultNs: 'translation',
resource: {
loadPath: 'i18n/{{lng}}.json',
savePath: 'i18n/{{lng}}.json',
jsonIndent: 4,
lineEnding: '\n'
},
nsSeparator: false, // namespace separator
keySeparator: false, // key separator
interpolation: {
prefix: '{{',
suffix: '}}'
},
removeUnusedKeys: true
},
transform: function customTransform(file, enc, done) {
const {ext} = path.parse(file.path);
const content = fs.readFileSync(file.path, enc);
if (ext === '.js' || ext === '.ejs') {
let p = this.parser;
p.parseFuncFromString(content, function(key) {
p.set(key, '⚠ ' + key + ' ⚠');
});
}
done();
}
};