How to implement lingui in a monorepo with expo and next js #2275
-
I'm working on a monorepo using create-t3-turbo, and I'm trying to share translations between I looked at the Lingui monorepo guide, but it's almost empty and doesn't provide any concrete setup instructions. Here's a simplified structure of my monorepo, it's not a complete listing, but it should give a general idea:
What I would like to do:
Also, since both apps are in the monorepo, should I set up a separate |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Create for nextjs:
For
If you have a package.json in your apps which is defining what packages from monorepo is used in particular app you can use this package.json to programatically build list of the folder to extract.
"dependencies": {
"@acme/ui": "workspace:^",
"@acme/auth": "workspace:^"
} Read
This will ensure you have a single source of truth ( Don't create Use some kind of TMS with a Translation Memory to manage translation for multiple catalogs in your monorepo. This make sure all yours apps has own catalogs which includes only those messages they need. You also can use a deps extractor per application, this way it will figure out automatically what packages are used in the app and extract only from them.
Define |
Beta Was this translation helpful? Give feedback.
Create
lingui.config.js
and extract command in both apps in the monorepo. For each config file specify the paths need to be included, such asfor nextjs:
apps/nextjs
packages/*
For
expo
:apps/expo
packages/*
If you have a package.json in your apps which is defining what packages from monorepo is used in particular app you can use this package.json to programatically build list of the folder to extract.
app/nextjs/package.json
Read
package.json
in thelingui.config.js
and transform to:apps/nextjs
packages/ui
packages/auth
This will ensure you have a single source of truth (
package.json
) for the dependnc…