Locawise: Ditch Translation Headaches, Let AI Supercharge Your App's Global Reach!
Locawise AI automates app localization via LLMs, detecting changes, translating quickly & cost-effectively, integrating with CI/CD and supporting JSON & properties files.
Locawise: AI-Powered Localization
Intro
- Tired of manual translation updates or overpriced services?
- Locawise is an AI localization tool that makes translating your application's language files effortless and efficient.
- It detects changes, translates using LLMs, and integrates into your workflow.
What is Locawise?
- A Python package that automates localization.
- Monitors localization files (
.json
,.properties
) for changes. - Uses AI (OpenAI & VertexAI) for context-aware translations.
- Respects existing translations.
- Fast: Translates ~2500 keys in under a minute.
- Cost-effective: Pennies for substantial translations.
- Uses a lock file (
i18n.lock
) for efficient change detection. - Resilient: Handles LLM rate limits.
- Also available as a GitHub Action (
locawise-action
) for automated pull requests.
Key Features
- AI-Powered Translations (OpenAI and VertexAI).
- Context-Aware: Define context, glossary, and tone via YAML.
- Flexible Configuration:
i18n.yaml
file. - CLI Tool.
- Blazing Fast: Asynchronous architecture.
- Cost-Efficient: Control LLM provider and model.
- Change Detection: Uses a lock file.
- Respects Manual Edits.
- Resilient: Retry mechanisms.
- Format Support:
.json
and.properties
(extensible).
Why Locawise?
- Traditional localization is:
- Time-consuming
- Expensive
- Error-prone
- Slows down development
- Locawise is automated, intelligent, and developer-friendly.
How It Works
- Load configuration from
i18n.yaml
. - Discover localization files.
- Check lock file (
i18n.lock
) for changes. - Translate new/modified keys using AI.
- Update target language files.
- Update lock file.
Configuration Details (i18n.yaml
)
version
: Configuration schema version.localization-root-path
: Path to language files.file-name-pattern
: Pattern for file names (e.g.,{language}.json
).source-lang-code
: Source language code (e.g., "en").target-lang-codes
: List of target language codes (e.g.,["fr", "de"]
).context
: Detailed context for AI.glossary
: Dictionary of terms for consistent translation.tone
: Desired tone of voice (e.g., "formal", "friendly").llm-model
: LLM model to use (e.g., "gpt-4o", "gemini-1.5-pro-001").llm-location
: LLM location (for VertexAI).
Choosing Your LLM Provider
- OpenAI:
- Set
OPENAI_API_KEY
environment variable. - Models:
gpt-4o
,gpt-4-turbo
,gpt-3.5-turbo
.
- Set
- Vertex AI (Google Cloud):
- Set
GOOGLE_CLOUD_PROJECT
environment variable. - Authenticate via
gcloud auth application-default login
. - Models:
gemini-1.5-flash-001
,gemini-1.0-pro
.
- Set
Using with locawise-action
for CI/CD
- Integrate Locawise into GitHub workflows.
- Automate translation on pushes.
- Create Pull Requests with updated localization files.
Supported File Formats
.json
.properties
- Future support for YAML, XML, XLIFF, ARB.