Documentation
Everything you need to get started with Langctl
Quick Start
Get up and running with Langctl in under 2 minutes.
# Install Langctl globally
$ npm install -g langctl
# Navigate to your project
$ cd my-project
# Initialize Langctl
$ langctl init
# Scan for translation keys
$ langctl scan
# Translate to multiple languages
$ langctl translate --target es,fr,de --ai That's it! Your translations are ready to use in your application.
Installation
Requirements
- Node.js 16 or higher
- npm or yarn
- A Langctl account (sign up at app.langctl.com)
Install via npm
$ npm install -g langctl Install via yarn
$ yarn global add langctl Verify Installation
$ langctl --version
v1.0.0 Configuration
After running langctl init, a langctl.config.json file will be created in your project root.
Sample Configuration
{
"projectId": "your-project-id",
"sourceLanguage": "en",
"targetLanguages": ["es", "fr", "de"],
"translationFiles": {
"pattern": "src/i18n/{lang}.json",
"format": "json"
},
"scanPaths": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.js",
"src/**/*.jsx"
],
"exclude": [
"node_modules",
"dist",
"build"
],
"ai": {
"enabled": true,
"contextHints": []
}
} Configuration Options
projectId Your Langctl project ID from the dashboard
sourceLanguage The source language of your application (e.g., "en")
targetLanguages Array of target languages to translate into
translationFiles Pattern and format for your translation files
CLI Commands
langctl init
Initialize Langctl in your project
$ langctl init langctl scan
Scan your codebase for translation keys
$ langctl scan [options] --path - Specify custom scan path
--output - Output format (json, yaml)
langctl translate
Translate keys to target languages
$ langctl translate [options] --target - Target languages (comma-separated)
--ai - Use AI-powered translation
--force - Overwrite existing translations
langctl push
Push translations to the cloud
$ langctl push langctl pull
Pull latest translations from the cloud
$ langctl pull langctl status
Check translation status
$ langctl status Common Workflows
Adding New Translations
# 1. Add new keys to your source file
# 2. Scan for new keys
$ langctl scan
# 3. Translate new keys
$ langctl translate --ai
# 4. Push to cloud
$ langctl push Team Collaboration
# Pull latest translations before starting work
$ langctl pull
# Make your changes...
# Push your updates
$ langctl push Framework Integrations
Langctl works with any framework. Here are some common setups:
Angular
Use with @angular/localize or ngx-translate
translationFiles: "src/assets/i18n/{lang}.json" React / Next.js
Use with react-i18next or next-intl
translationFiles: "public/locales/{lang}/common.json" Vue
Use with vue-i18n
translationFiles: "src/locales/{lang}.json" API Reference
Coming soon. For now, the CLI provides all necessary functionality.