i18next / i18next-parser

Parse your code to extract translation keys/values and manage your catalog files
MIT License
486 stars 198 forks source link

Can't extract translations from siblings folders #990

Open pybuche opened 8 months ago

pybuche commented 8 months ago

πŸ› Bug Report

I'm currently working on a yarn workspace monorepo and I need to extract translations from two different workspace. I decided to create a new workspace called i18n so I setup the i18n object there, store the translations and define extraction scripts there. However it seems that the input configuration field doesn't look into siblings folders. For instance, with such a tree structure:

i18n/
β”œβ”€ i18n.js
β”œβ”€ i18next-parser-config.js
β”œβ”€ package.json
app1/
β”œβ”€ file.js
β”œβ”€ package.json
app2/
β”œβ”€ file.js
β”œβ”€ package.json

And an i18next-parser-config.js being:

export default {
  defaultNamespace: "common",
  input: ["../**/*.js"],
  output: "locales/$LOCALE/$NAMESPACE.json"
}

It parsers files from i18n/, but not from app1/ or app2/

To Reproduce

I managed to create a minimal repository

Expected behavior

I'd expect the parser to browser folders where I'm asking it to do. Is there a way to do it with the current configuration? Am I missing something? Thanks!

Your Environment

13eel commented 6 months ago

Seems like a duplicate of #939

Try using version 8.8.0