Lingo.dev Compiler is in active development. We use it ourselves and strive to provide the best developer experience for all supported frameworks. However, every project is unique and may present its own challenges.
This guide will help you debug the Compiler locally in your project.
git clone git@github.com:lingodotdev/lingo.dev.git
cd lingo.dev
pnpm install
pnpm buildLingo.dev uses pnpm as its package manager.
In the lingo.dev/packages/cli directory, link the CLI package using your project's package manager:
npm link
# or
yarn link
# or
pnpm linkUse the package manager that matches your project (npm, yarn, or pnpm).
To enable live-reloading for development, run the following in the root of the lingo.dev repo:
pnpm --filter "./packages/{compiler,react}" devIf you haven't already, add Lingo.dev to your project:
npm install lingo.devFor full setup and configuration, see the Lingo.dev Compiler docs.
npm link lingo.devFor local development and testing with the Lingo.dev Compiler:
npm run devThe exact command may vary depending on your project setup and package manager.
You can now use your debugger or classic console.log statements in the Compiler and React packages to inspect what happens during your project build.
- The Compiler entry point is at
packages/compiler/src/index.ts. - The
loadmethod:- Loads and generates
lingo/dictionary.jsusingLCPServer.loadDictionaries.
- Loads and generates
- The
transformmethod:- Applies mutations to process source code (see methods in
composeMutations). - Generates
lingo/meta.jsonbased on the translatable content in your app. - Injects Compiler-related components (
LingoComponent,LingoAttributeComponent). - Replaces the
loadDictionarymethod withloadDictionary_internal.
- Applies mutations to process source code (see methods in
For more details, check out the Lingo.dev Compiler documentation or join our Discord for help!