Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dictionator CLI

Dictionator is a fast, lightweight Go utility for centralized localization management, UI dictionary tracking, and seamless export/import of Goose PostgreSQL SQL migrations and custom template formats.


Features

  • Embedded SQLite Database: Fast local storage for localization keys and translations (localization.db or configured via DICTIONATOR_DB / LOC_DB).
  • Support for Arbitrary Locales: Flexible handling of any language codes and compound locales (en, ru, tm, en_US, ru_RU, de_DE, fr, zh_CN, es, tr, etc.).
  • Dynamic Localization Matrix (status): Visual matrix displaying completeness percentages across all active project languages.
  • Missing Locales Detection (list --missing <lang>): Instant audit of missing translations for any target language.
  • Goose PostgreSQL Migration Exporter & Importer: Bidirectional sync for PostgreSQL seed migrations (dictionaries table).
  • Custom Template Engine (export --template <file.tmpl>): Declarative Go template engine (text/template) for generating any format (JSON, TypeScript, Android XML, iOS Strings, CSV, ARB, YAML).
  • AI Assistant Integration (skill install): Automatic generation and installation of skill manifests for Antigravity IDE and Claude.

Installation & Build

# Install to system PATH (GOPATH/bin)
go install ./cmd/dictionator

# Build local binary
go build -o bin/dictionator.exe ./cmd/dictionator

Command Reference

1. View and Audit Translations

  • Project-wide translation status matrix:
    dictionator status
  • Detailed key card:
    dictionator info login.title
  • Get translation for a specific language or locale:
    dictionator get login.title ru
    dictionator get login.title en_US
  • Find keys missing a specific translation:
    dictionator list --missing de
  • List all keys for a target language:
    dictionator list --lang ru_RU

2. Add and Modify Translations

  • Add a new key with arbitrary locales:
    # Standard languages:
    dictionator add "banner.promo" --en "Special Sale" --ru "Скидка" --tm "Arzanladyş" --group "Marketing"
    
    # Regional and custom locales:
    dictionator add "auth.title" --en_US "Sign In" --ru_RU "Войти" --de_DE "Anmelden" --fr "Connexion" --group "Auth"
  • Set or update translation for a single language:
    dictionator set "banner.promo" tm "Arzanladyş"
    dictionator set "auth.title" en_US "Welcome back"
  • Delete key and all translations:
    dictionator delete "banner.promo"

3. Import and Export

  • Export to Goose PostgreSQL SQL migration:
    # Default output in migrations/YYYYMMDDHHMMSS_create_dictionary.sql:
    dictionator export sql-goose
    
    # Export to specific file path:
    dictionator export sql-goose --out migrations/20260825_create_dictionary.sql
  • Export using custom Go template (.tmpl) with optional target language:
    # Export with target language into nested JSON locales:
    dictionator export --template templates/landing.json.tmpl --lang ru --out web/landing/src/locales/ru.json
    dictionator export --template templates/landing.json.tmpl --lang en --out web/landing/src/locales/en.json
    dictionator export --template templates/landing.json.tmpl --lang tm --out web/landing/src/locales/tm.json
    
    # Export without language restriction:
    dictionator export --template templates/custom.tmpl --out exports/translations.json
  • List available built-in export formats:
    dictionator export formats
  • Import from Goose SQL migration:
    dictionator import sql-goose migrations/20250309100000_create_dictionary.sql

4. Project Initialization & AI Skills

# Initialize local database and skills:
dictionator init [--import path/to/migration.sql]

# Install globally for Antigravity IDE:
dictionator skill install antigravity

# Install globally for Claude:
dictionator skill install claude

# Install all skills locally into current workspace (.agents/ and .claude/):
dictionator skill install all --local

Environment Variables

Variable Description Default
DICTIONATOR_DB / LOC_DB Path to SQLite translations database localization.db

Repository Structure

dictionator/
├── cmd/
│   └── dictionator/
│       └── main.go              # CLI entrypoint and commands
├── internal/
│   ├── db/                      # SQLite driver and schema definitions
│   ├── generator/               # Template engine and built-in export presets
│   ├── parser/                  # Goose PostgreSQL SQL migration parser
│   ├── service/                 # Business logic, CRUD operations, statistics
│   └── skill/                   # AI assistant skill generator and help catalog
├── migrations/                  # Generated SQL migrations
├── scripts/
│   └── check_build.cmd          # Test runner and build validation script
├── go.mod
├── go.sum
└── README.md

About

Universal template-driven localization CLI built for AI agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages