pull/2666/head
Mikael Finstad 7 months ago
parent 251204215b
commit 2512048a24
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -0,0 +1,35 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import type { defineConfig } from 'i18next-cli';
const configBase: Parameters<typeof defineConfig>[0] = {
extract: {
input: [
'src/renderer/**/*.{ts,tsx}',
'src/main/**/*.ts',
'src/common/**/*.ts',
'src/preload/**/*.ts',
],
output: 'locales/{{language}}/{{namespace}}.json',
defaultNS: 'translation',
functions: [
't',
'*.t',
],
transComponents: [
'Trans',
],
ignoredAttributes: ['data-testid', 'aria-label', 'role'],
// Keep in sync between i18next-parser.config.js and i18nCommon.js:
keySeparator: false,
nsSeparator: false,
},
types: {
input: [
'locales/{{language}}/{{namespace}}.json',
],
output: 'src/types/i18next.d.ts',
},
};
export default configBase;

@ -0,0 +1,10 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig } from 'i18next-cli';
import configBase from './i18next.config.base.js';
export default defineConfig({
...configBase,
locales: ['en'],
});

@ -2,36 +2,9 @@
import { defineConfig } from 'i18next-cli'; import { defineConfig } from 'i18next-cli';
import { langNames, mapLang, SupportedLanguage } from './src/common/i18n.js'; import { langNames, mapLang, SupportedLanguage } from './src/common/i18n.js';
import configBase from './i18next.config.base.js';
export default defineConfig({ export default defineConfig({
...configBase,
locales: Object.keys(langNames).map((lng) => mapLang(lng as SupportedLanguage)), locales: Object.keys(langNames).map((lng) => mapLang(lng as SupportedLanguage)),
extract: {
input: [
'src/renderer/**/*.{ts,tsx}',
'src/main/**/*.ts',
'src/common/**/*.ts',
'src/preload/**/*.ts',
],
output: 'locales/{{language}}/{{namespace}}.json',
defaultNS: 'translation',
functions: [
't',
'*.t',
],
transComponents: [
'Trans',
],
ignoredAttributes: ['data-testid', 'aria-label', 'role'],
// Keep in sync between i18next-parser.config.js and i18nCommon.js:
keySeparator: false,
nsSeparator: false,
},
types: {
input: [
'locales/{{language}}/{{namespace}}.json',
],
output: 'src/types/i18next.d.ts',
},
}); });

@ -25,7 +25,7 @@
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"version": "tsx script/postversion.mts && git add no.mifi.losslesscut.appdata.xml", "version": "tsx script/postversion.mts && git add no.mifi.losslesscut.appdata.xml",
"pack-linux": "yarn build && electron-builder --linux", "pack-linux": "yarn build && electron-builder --linux",
"scan-i18n": "i18next-cli extract", "scan-i18n": "i18next-cli -c i18next.config.scan.ts extract",
"generate-licenses": "yarn licenses generate-disclaimer > licenses.txt && echo '\n\nffmpeg is licensed under GPL v2+:\n\nhttp://www.gnu.org/licenses/old-licenses/gpl-2.0.html' >> licenses.txt" "generate-licenses": "yarn licenses generate-disclaimer > licenses.txt && echo '\n\nffmpeg is licensed under GPL v2+:\n\nhttp://www.gnu.org/licenses/old-licenses/gpl-2.0.html' >> licenses.txt"
}, },
"author": { "author": {

@ -5,7 +5,7 @@
}, },
"include": [ "include": [
"electron.vite.config.ts", "electron.vite.config.ts",
"i18next.config.ts", "i18next.config*.ts",
"script/**/*", "script/**/*",
], ],
} }
Loading…
Cancel
Save