Use ts for i18next-parser config to avoid invalid properties

This commit is contained in:
Michael Telatynski
2023-11-17 12:38:56 +00:00
parent 9fad8dc080
commit 49544f5aed

30
i18next-parser.config.ts Normal file
View File

@@ -0,0 +1,30 @@
export default {
keySeparator: false,
namespaceSeparator: false,
contextSeparator: "|",
pluralSeparator: "_",
createOldCatalogs: false,
defaultNamespace: "app",
lexers: {
ts: [
{
lexer: "JavascriptLexer",
functions: ["t", "translatedError"],
namespaceFunctions: ["useTranslation", "withTranslation"],
},
],
tsx: [
{
lexer: "JsxLexer",
functions: ["t", "translatedError"],
namespaceFunctions: ["useTranslation", "withTranslation"],
},
],
},
locales: ["en-GB"],
output: "public/locales/$LOCALE/$NAMESPACE.json",
input: ["src/**/*.{ts,tsx}"],
sort: true,
// The key becomes the English version of the string
defaultValue: (_l, _ns, key) => key,
};