i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

Multiple files merged (Turborepo monorepo)

Open guidovizoso opened this issue 1 year ago • 3 comments

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: image 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!

guidovizoso avatar Feb 09 '24 19:02 guidovizoso

I'm also having the same problem with Turborepo. Any updates on this one? 🙏

nerdmax avatar Mar 10 '24 09:03 nerdmax

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.

xicheng412 avatar Apr 19 '24 14:04 xicheng412

Same problem :( Any updates?

kekswar avatar Jul 26 '24 13:07 kekswar