Use Cases
Why Use Algebras CLI?
Section titled “Why Use Algebras CLI?”Algebras CLI is a wrapper for our AI-powered translation engine that simplifies usage for developers. Instead of manually managing translation files or hiring expensive translation services, you can automate the entire process with a few simple commands.
Translating i18n JavaScript Applications
Section titled “Translating i18n JavaScript Applications”Next.js and React Applications
Section titled “Next.js and React Applications”Translate JSON-based translation files commonly used with next-i18next, react-i18next, and other JavaScript i18n libraries.
What you do:
- Initialize:
algebras init(auto-detectspublic/locales/en/*.jsonfiles) - Add languages:
algebras add fr es de ja - Translate:
algebras translate
Example setup:
source_files: "public/locales/en/common.json": destination_path: "public/locales/%algebras_locale_code%/common.json"Why this helps: Your JSON translation files are automatically created and maintained. When you add new keys, run algebras update to translate only what’s new, keeping everything in sync.
Vue.js and Nuxt.js Applications
Section titled “Vue.js and Nuxt.js Applications”Translate YAML or JSON files used in Vue i18n configurations.
What you do:
- Configure source files in
.algebras.config - Add target languages:
algebras add fr es - Run translations:
algebras translate
Why this helps: Supports both JSON and YAML formats commonly used in Vue ecosystems. The CLI handles the file structure automatically.
Svelte and SvelteKit Applications
Section titled “Svelte and SvelteKit Applications”Translate TypeScript or JSON translation files used in Svelte projects.
What you do:
- Set up configuration for your TypeScript translation files
- Add languages:
algebras add de fr - Translate:
algebras translate
Why this helps: Works with TypeScript translation files, maintaining type safety while automating translations.
Angular Applications
Section titled “Angular Applications”Translate XLIFF files used in Angular’s i18n system.
What you do:
- Configure XLIFF source files in
.algebras.config - Add languages:
algebras add es pt_BR - Translate:
algebras translate
Why this helps: Native client-side i18n support for Angular’s standard XLIFF format. No need for separate translation management tools.
HTML Files with Embedded Translations
Section titled “HTML Files with Embedded Translations”Translate static HTML files or templates that contain translatable content.
What you do:
- Configure HTML source files
- Add languages:
algebras add fr es - Translate:
algebras translate(createsindex.fr.html,index.es.html, etc.)
Example setup:
source_files: "html_files/index.html": destination_path: "html_files/index.%algebras_locale_code%.html"Why this helps: Useful for static sites, email templates, or documentation that needs multiple language versions.
Translating iOS and Android Applications
Section titled “Translating iOS and Android Applications”iOS Applications
Section titled “iOS Applications”Translate .strings and .stringsdict files used in iOS localization.
What you do:
- Configure your iOS localization files:
source_files:"ios/App/en.lproj/Localizable.strings":destination_path: "ios/App/%algebras_locale_code%.lproj/Localizable.strings"
- Add languages:
algebras add fr_CA es_MX ja - Translate:
algebras translate
Why this helps: Automatically creates the correct .lproj directory structure for iOS. Handles both regular strings and pluralization strings (.stringsdict files).
Android Applications
Section titled “Android Applications”Translate XML string resources located in values/ directories.
What you do:
- Configure Android string resources:
source_files:"app/src/main/res/values/strings.xml":destination_path: "app/src/main/res/values-%algebras_locale_code%/strings.xml"
- Add languages:
algebras add fr es-ru ja - Translate:
algebras translate
Why this helps: Creates the correct values-es/, values-fr/ directory structure automatically. Handles Android’s locale code format (e.g., es-rMX for Mexican Spanish).
Flutter Applications
Section titled “Flutter Applications”Translate ARB (Application Resource Bundle) files used in Flutter i18n.
What you do:
- Configure ARB files:
source_files:"lib/l10n/app_en.arb":destination_path: "lib/l10n/app_%algebras_locale_code%.arb"
- Add languages:
algebras add fr es de - Translate:
algebras translate
Why this helps: Flutter’s standard localization format is fully supported. Works seamlessly with Flutter’s code generation for localization.
Mobile App UI Constraints
Section titled “Mobile App UI Constraints”Ensure translations fit within mobile UI constraints.
What you do: Use the --ui-safe flag: algebras translate --ui-safe
Why this helps: Mobile buttons, labels, and UI elements have fixed widths. The UI-safe mode ensures translations don’t exceed original text length, preventing layout breaks.
Translating Localization Tables in CSV/XLSX Formats
Section titled “Translating Localization Tables in CSV/XLSX Formats”CSV Translation Files
Section titled “CSV Translation Files”Manage multi-language translations stored in CSV format, where each row is a key and columns are languages.
What you do:
- Configure CSV source files in
.algebras.config - Add target language columns:
algebras add es de fr - Translate:
algebras translate
Why this helps: Perfect for non-developers who work with spreadsheets. Content teams can edit translations in Google Sheets or Excel, then use Algebras CLI to sync and translate.
XLSX Translation Files
Section titled “XLSX Translation Files”Work with Excel files for translation management, ideal for teams using spreadsheet-based workflows.
What you do:
- Configure XLSX source files
- Add languages:
algebras add ja zh_Hans - Translate:
algebras translate --ui-safe(optional)
Why this helps: Enterprise teams often prefer Excel for translation management. Algebras CLI reads and writes Excel files directly, maintaining formulas and formatting.
Glossary Management from Spreadsheets
Section titled “Glossary Management from Spreadsheets”Upload and maintain translation glossaries from CSV or XLSX files for consistent terminology.
What you do:
- Create a glossary CSV/XLSX with terms and translations
- Upload:
algebras glossary push terms.csv --name "Product Glossary" - Use in translations:
algebras translate --glossary-id your-glossary-id
Why this helps: Maintain consistency across large projects. Financial, medical, legal, and technical terms need precise translations that glossaries ensure.
Backend and Framework Translations
Section titled “Backend and Framework Translations”Django Applications
Section titled “Django Applications”Translate Gettext PO files used in Django’s localization system.
What you do:
- Configure PO files:
source_files:"locale/en/LC_MESSAGES/django.po":destination_path: "locale/%algebras_locale_code%/LC_MESSAGES/django.po"
- Add languages:
algebras add es fr de - Translate:
algebras translate
Why this helps: Native support for Django’s standard Gettext format. No need to manually edit PO files or use separate translation tools.
Flask Applications
Section titled “Flask Applications”Translate Gettext PO files in Flask projects, similar to Django workflow.
What you do:
- Set up PO file configuration
- Add languages:
algebras add pt es - Translate:
algebras translate
Why this helps: Streamlines Flask localization using the standard Gettext approach.
FastAPI Applications
Section titled “FastAPI Applications”Translate JSON, YAML, or custom format translation files used in FastAPI projects.
What you do:
- Configure your translation file format (JSON/YAML typically)
- Add languages:
algebras add es fr - Translate:
algebras translate
Why this helps: Flexible format support works with any translation file structure your FastAPI application uses.
Java and Spring Applications
Section titled “Java and Spring Applications”Translate Java Properties files used in ResourceBundle configurations.
What you do:
- Configure properties files:
source_files:"src/main/resources/messages.properties":destination_path: "src/main/resources/messages_%algebras_locale_code%.properties"
- Add languages:
algebras add es_ES fr_FR de_DE - Translate:
algebras translate
Why this helps: Java ResourceBundle standard format is fully supported. Works with Spring Boot and other Java frameworks using properties files.
Ruby on Rails Applications
Section titled “Ruby on Rails Applications”Translate YAML files used in Rails i18n system.
What you do:
- Configure Rails locale files:
source_files:"config/locales/en.yml":destination_path: "config/locales/%algebras_locale_code%.yml"
- Add languages:
algebras add es fr de - Translate:
algebras translate
Why this helps: Rails standard YAML locale format is automatically handled. Maintains Rails’ nested structure and formatting.
CI/CD Automations
Section titled “CI/CD Automations”Automated Translation Checks in CI
Section titled “Automated Translation Checks in CI”Ensure translation files are complete and up-to-date before deployments.
What you do:
Add algebras ci to your CI/CD pipeline (GitHub Actions, GitLab CI, Jenkins, etc.)
Example GitHub Actions:
- name: Check translations run: algebras ciWhy this helps: Catches missing translations before production. Fails the build if new keys aren’t translated, preventing incomplete deployments.
Automated Translation Updates
Section titled “Automated Translation Updates”Automatically update translations when source files change.
What you do:
- Add translation step to your CI pipeline
- Run:
algebras update --only-missing - Commit and push translation files automatically
Why this helps: Keeps translations in sync with code changes automatically. No manual intervention needed when developers add new features.
Pre-Deployment Translation Sync
Section titled “Pre-Deployment Translation Sync”Ensure all languages are translated and validated before release.
What you do:
- In your deployment pipeline, run:
algebras ci - If missing translations found, run:
algebras translate --only-missing - Fail build if critical translations are missing
Why this helps: Prevents releasing features with untranslated content. Ensures quality and completeness across all supported languages.
Scheduled Translation Updates
Section titled “Scheduled Translation Updates”Set up scheduled jobs to keep translations updated regularly.
What you do: Create a cron job or scheduled task that runs:
algebras update --only-missingWhy this helps: Keeps translations current even if developers forget to run updates. Useful for active projects with frequent content changes.
Advanced Use Cases
Section titled “Advanced Use Cases”Multi-Framework Projects
Section titled “Multi-Framework Projects”Translate projects using multiple frameworks simultaneously (e.g., React frontend + Django backend).
What you do:
Configure all source files in .algebras.config:
- React JSON files
- Django PO files
- Android XML files
Run: algebras translate to translate everything at once.
Why this helps: One command handles multiple file formats. All translations stay synchronized across your entire stack.
UI-Safe Translations
Section titled “UI-Safe Translations”Ensure translations don’t break UI layouts by maintaining text length constraints.
What you do: Use --ui-safe flag: algebras translate --ui-safe
Why this helps: Critical for mobile apps and fixed-width UI elements. Translations stay within original length bounds, preventing layout breaks.
Custom Translation Prompts
Section titled “Custom Translation Prompts”Provide domain-specific instructions for better translation quality.
What you do:
- Create a prompt file:
custom-prompt.txt - Use it:
algebras translate --prompt-file custom-prompt.txt - Or set default:
algebras configure --prompt "Translate maintaining a professional tone"
Why this helps: Get translations that match your brand voice, industry standards, or specific requirements. Better than generic translations.
Batch Processing for Large Projects
Section titled “Batch Processing for Large Projects”Optimize translation speed for projects with thousands of strings.
What you do: Configure batch processing:
algebras configure --batch-size 50 --max-parallel-batches 10algebras translateWhy this helps: Process large translation jobs faster by running multiple batches in parallel, while respecting API rate limits.
Multiple Source Languages
Section titled “Multiple Source Languages”Support content creation in multiple source languages.
What you do: Create separate config files:
.algebras.configfor English → Spanish, German.algebras-zh_Hans.configfor Chinese → Korean, Japanese
Use: algebras -f .algebras-zh_Hans.config translate
Why this helps: Platforms with content creators in different languages need flexible translation workflows. Each source language can have its own target languages.
Translation Review Workflows
Section titled “Translation Review Workflows”Generate translations, review them manually, then update incrementally.
What you do:
- Generate:
algebras translate - Review:
algebras review --language fr - Edit files manually as needed
- Update new content:
algebras update --only-missing
Why this helps: AI translations are a great starting point. Review workflows let teams refine translations while still automating the bulk of the work.