Since 8.9.0, parsing is ignoring files outside the configuration file folder.
giovannetti-eric opened this issue ยท 10 comments
๐ฅ Regression Report
I'm using NextJS, with Turborepo
My file structure is like:
- apps
- Project A
- Project B
- ...
- packages
- i18n
- i18next-parser.app.config.js
- Package A
- Package B
- ...
- i18n
My configuration file:
module.exports = {
contextSeparator: false,
createOldCatalogs: false,
defaultNamespace: "app",
defaultValue: "",
indentation: 2,
keepRemoved: false,
keySeparator: false,
lineEnding: "auto",
locales: ["en"],
namespaceSeparator: false,
output: "./dist/keys/$NAMESPACE.json",
pluralSeparator: "_",
input: [
"../../apps/**/*{.tsx,.ts,.js}",
"../../packages/**/*{.tsx,.ts,.js}",
],
sort: true,
skipDefaultValues: false,
useKeysAsDefaultValue: false,
verbose: false,
failOnWarnings: false,
failOnUpdate: false,
customValueTemplate: null,
resetDefaultValueLocale: null,
i18nextOptions: null,
yamlOptions: null,
};
Before 8.9.0, running i18next -c ./i18next-parser.app.config.js
was parsing all related files in apps and packages folders. Now, only files into i18n
folder are parsed.
Last working version
Worked up to version: 8.8.0
Stopped working in version: 8.9.0
Expected behavior
The input
parameter should allow me to parse files outside the configuration file folder.
Your Environment
- runtime version: node v18.17.1
- i18next version: 23.2.7
- os: macOs 14
We've also run into this at Ghost - the commit above is the revert back to v8.8.0
@karellm Is this issue a bug, or an intentional breaking change? We've had to pause all updates to i18next-parser due to this
Such a problem also appeared. Any progress?
Also bumped into this issue.
Same issue. I had to downgrade to 8.8.0
Is there a breaking tweak to config necessary? Changelog did not mention anything.
To follow up, I use a monorepo.
This is what my i18next-parser.config.js looks like
module.exports = {
contextSeparator: '_',
createOldCatalogs: false,
defaultNamespace: 'translation',
defaultValue: (locale, namespace, key) => {
if (locale === 'en-US') {
return key;
}
return '__NOT_TRANSLATED__';
},
indentation: 2,
keepRemoved: false
keySeparator: false,
lexers: {
js: ['JavascriptLexer'],
ts: ['JavascriptLexer'],
jsx: ['JsxLexer'],
tsx: ['JsxLexer'],
default: ['JavascriptLexer'],
},
lineEnding: 'auto',
locales: ['en-US', 'nl-NL'],
namespaceSeparator: false,
output: '../../locales/$LOCALE.json',
pluralSeparator: '____',
input: '../*/src/**/*.{js,ts,jsx,tsx}',
sort: false,
skipDefaultValues: false,
useKeysAsDefaultValue: false,
verbose: false,
failOnWarnings: false,
customValueTemplate: null,
};
It's not intentional but have limited time to look at it currently. If someone can open a PR that would be greatly appreciated.
This seems to be working again in 8.13.0
@giovannetti-eric I would give this another go
This seems to be working again in 8.13.0 @giovannetti-eric I would give this another go
I kept having the same problem with 8.13.0
, will still be using 8.8.0
I have not tested the 8.13.0
but the 9.0.0
seems to work as intended.