i18n-ally
i18n-ally copied to clipboard
Multiple files merged (Turborepo monorepo)
Hello there!
I'm currently trying to implement i18n-ally into a Turborepo monorepo with two React apps using react-i18next
. It seems to be working just fine but the problem is both projects are quite similar and share multiple json files with the same name inside their respective locale
folders:
monorepo/
└── apps/
├── site/
│ └── src/
│ └── locales/
│ ├── en/
│ │ ├── common.json
│ │ └── site-specific.json
│ └── es/
│ ├── common.json
│ └── site-specific.json
└── backoffice/
└── src/
└── locales/
├── en/
│ ├── common.json
│ └── site-specific.json
└── es/
├── common.json
└── site-specific.json
The problem with this structure is that if the translations overlap (ie. common:agree
) i18n-ally picks the latest one defined in localesPaths
.
To make it more clear:
If I click go to file on this translation it will take me to
monorepo/apps/backoffice/src/locales/en/common.json
.
Is there a way to have the translations specifically grouped by each localesPath?
This is my config:
"i18n-ally.localesPaths": ["apps/app/src/locales", "apps/staff/src/locales"],
"i18n-ally.enabledFrameworks": ["react-i18next"],
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.json",
"i18n-ally.keystyle": "nested"
Thanks in advance!
I'm also having the same problem with Turborepo. Any updates on this one? 🙏
https://github.com/lokalise/i18n-ally/issues/997#issue-1871562559
When I set framework to next-intl, everything works fine. Try to choose a right framework.
Same problem :( Any updates?