App Localization using AlgebrasCLI

Getting Started

Follow these steps to start using the Algebras CLI tool for managing localization in your applications.

1. Installation

pip install git+https://github.com/algebras-ai/algebras-cli.git

2. API Key Setup

You can create API keys on our platform

Create API Key

3. Project Setup

algebras init

Preview

See the Algebras CLI tool in action

The CLI tool provides an interactive interface for managing your application's translations

Basic Commands

Essential commands to manage your translations

Add Language

Add a new language to your project

algebras add <language>

Translate

Translate your application content

algebras translate

Update

Update existing translations

algebras update

Status

Check translation status

algebras status

Configuration

Configure your project with .algebras.config file

Project Configuration

{
  "languages": ["en", "es", "fr"],
  "path_rules": ["locales/**/*.json"],
  "api": {
    "provider": "algebras-ai",
    "model": "gpt-4"
  }
}

Quality Assurance Features

Built-in tools to maintain high-quality translations

Missing Keys Detection

Automatically identifies translation keys that exist in the main language but are missing in other languages, ensuring complete coverage across all locales.

Outdated Translations Alert

Detects when translations are out of sync by identifying keys that were updated in the main language but not in others, preventing stale content.

Automated Quality Checks

Performs comprehensive validation of all translations, including format string compatibility, placeholder consistency, and syntax verification.

Next.js Native Support

Optimized for working with Next.js projects, with built-in support for Next.js internationalization patterns and file structures.

Advanced Usage

Power features for complex localization needs

Custom Prompt Templates

Create personalized translation prompts with .algebras.prompt file

# Translation prompt template
Translate the following strings for a {{project_type}} app.
Maintain a {{tone}} tone that is consistent with our brand.
Keep variables like {{example_variable}} unchanged.

File Format Support

Supported file formats for localization:

  • JSON (.json)
  • YAML (.yml, .yaml)
  • Properties (.properties)
  • Android XML (.xml)
  • iOS Strings (.strings)
  • CSV (.csv)
  • PO (.po)

Integration with CI/CD

Add this to your CI pipeline:

# GitHub Actions example
- name: Setup Algebras CLI
  run: pip install git+https://github.com/algebras-ai/algebras-cli.git
- name: Update translations 
  run: algebras update --non-interactive
  env:
    ALGEBRAS_API_KEY: ${secrets.ALGEBRAS_API_KEY}

GitHub Actions Integration

Marketplace

Automate translation health checks in your CI/CD pipeline using the official Algebras Translation Status GitHub Action.

The Algebras Translation Status Action checks your i18n-enabled Next.js project for missing or outdated translations. It fails the workflow if any issues are found, ensuring translation quality is enforced automatically.

Quick Start: Add this workflow file to .github/workflows/check-translations.yml:

name: Check Translations

on:
  pull_request:
    branches: [ main ]
    paths:
      - '**/locale/**'
      - '**/translations/**'
      - '**/i18n/**'

jobs:
  translation-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Algebras Translation Status
        uses: algebras-ai/locale-checker-action@main
        # Optional: specify a file pattern
        # with:
        #   file_pattern: "src/locale/**/*.json"
        #   only-missing: true

Inputs:

  • file_pattern (optional): Glob for localization files (e.g. src/locale/**/*.json).
  • only-missing (optional): Set to true to only report missing keys (ignore outdated).

Example Outputs:

Success

Loaded configuration: /path/to/.algebras.config
Available languages: en, fr, es, de
Source language: en
Running CI checks...
Scanning for translation files...
Found files by language: {'en': ['src/locales/en.json'], ...}
Processing languages: fr, es, de
All translation keys are up-to-date! ✅
::notice::Translation status check passed! All translations are up-to-date.

Failure

Loaded configuration: /path/to/.algebras.config
Available languages: en, fr, es, ru
Source language: en
Running CI checks...

CI Check: Found issues with translations:

Language 'ru': Missing keys:
  - Features.feature6_description
  - Features.feature6_title
  - TodoForm.some_new_key_to_test

Language 'ru': Outdated keys:
  - Features.feature1_title (Source updated: 2024-10-08, Target: 2024-10-03)
  - Hero.title (Source updated: 2024-10-07, Target: 2024-10-03)

::error::Translation status check failed! Some translations are missing or outdated.
Error: Process completed with exit code 1.

For more details and advanced options, see the GitHub Marketplace page.

Documentation & Support

Resources to help you get the most out of the Algebras CLI tool

GitHub Repository

View the source code, contribute, and report issues on GitHub

Documentation

Comprehensive guides, tutorials, and reference documentation

Support

Need help? Reach out to us through one of these channels:

Email Support

Help Center