| name | lokalise-local-dev-loop |
| description | Configure Lokalise local development with file sync and hot reload.
Use when setting up a development environment, configuring translation sync,
or establishing a fast iteration cycle with Lokalise.
Trigger with phrases like "lokalise dev setup", "lokalise local development",
"lokalise dev environment", "develop with lokalise", "lokalise sync".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Bash(lokalise2:*), Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","lokalise","lokalise-local"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Lokalise Local Dev Loop
Overview
Set up a complete local development workflow with Lokalise: project structure for i18n files, CLI push/pull commands, file watching for auto-upload, mock translations for offline development, framework integration (React i18next, Vue i18n), and a pre-commit hook to keep translations synced.
Prerequisites
- Lokalise API token exported as
LOKALISE_API_TOKEN
- Lokalise project ID exported as
LOKALISE_PROJECT_ID
- Node.js 18+ with npm or pnpm
lokalise2 CLI installed
- Git (for pre-commit hook)
Instructions
- Set up the project directory structure for i18n files, compatible with Lokalise's
bundle_structure and most i18n frameworks.
project-root/
├── src/
│ └── locales/
│ ├── en.json # Base language (source of truth)
│ ├── fr.json # Downloaded from Lokalise
│ ├── de.json
│ ├── es.json
│ └── index.ts # Barrel export + type definitions
├── scripts/
│ ├── i18n-push.sh # Upload source to Lokalise
│ ├── i18n-pull.sh # Download translations from Lokalise
│ └── i18n-mock.ts # Generate mock translations
├── .env.local # LOKALISE_API_TOKEN, LOKALISE_PROJECT_ID
└── package.json # i18n:push, i18n:pull, i18n:sync scripts
Barrel export with type safety (src/locales/index.ts):
import en from "./en.json";
export type TranslationKeys = typeof en;
export const defaultLocale = "en" as const;
export const supportedLocales = ["en", "fr", "de", "es"] as const;
export = ( supportedLocales)[];
(): <> {
mod = ();
mod.;
}