Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 8.9.0, parsing is ignoring files outside the configuration file folder. #939

Open
giovannetti-eric opened this issue Oct 24, 2023 · 7 comments

Comments

@giovannetti-eric
Copy link

馃挜 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
    • ...

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
@giovannetti-eric giovannetti-eric changed the title Since 8.9.0, parsing ignore files outside the configuration file folder. Since 8.9.0, parsing is ignoring files outside the configuration file folder. Oct 24, 2023
daniellockyer added a commit to TryGhost/Ghost that referenced this issue Oct 25, 2023
refs i18next/i18next-parser#939

- a bug in the parser means that files outside of the package are not
  being parsed
@daniellockyer
Copy link

We've also run into this at Ghost - the commit above is the revert back to v8.8.0

daniellockyer added a commit to TryGhost/Ghost that referenced this issue Oct 25, 2023
refs i18next/i18next-parser#939

- a bug in the parser means that files outside of the package are not
  being parsed
@daniellockyer
Copy link

@karellm Is this issue a bug, or an intentional breaking change? We've had to pause all updates to i18next-parser due to this

@donskov
Copy link

donskov commented Jan 17, 2024

Such a problem also appeared. Any progress?

@crispclean
Copy link

Also bumped into this issue.

@moonray
Copy link

moonray commented Jan 25, 2024

Same issue. I had to downgrade to 8.8.0
Is there a breaking tweak to config necessary? Changelog did not mention anything.

@moonray
Copy link

moonray commented Jan 25, 2024

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,
};

@karellm
Copy link
Member

karellm commented Jan 25, 2024

It's not intentional but have limited time to look at it currently. If someone can open a PR that would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants