Skip to content

v5.1.0: Translation Manager, Cross-Platform CLI & Lang Packs

Choose a tag to compare

@jayeshmepani jayeshmepani released this 17 Aug 04:25
· 3 commits to main since this release

⭐ New Features

  • Translation Manager at /translations-manager. Routes and JSON APIs register automatically (data, languages, existing map, scan, save, add-languages). Prefix, enable flag, and middleware are configurable.
    • If the host app already has login/register/sign-in routes, guests must sign in (browser redirect or JSON 401). If there are no auth routes, the manager is open.
    • Publish tags: gemini-translator-config, gemini-translator-views, gemini-translator-assets, gemini-translator-manager. CSS/JS are inlined so the page works without publishing assets.
    • Semantic component CSS (no Tailwind/Bootstrap utilities), native <dialog> / <search> / popover, light/dark theme (gemini-translator-theme), sticky KEY column, pagination footer (default 5 rows; last two pages stay visible with an ellipsis).
    • Filters: Type / Module / Pack / Scope / PHP files / Language / show-only-missing / Highlight script faults. Add Languages, Sync, Save.
  • Highlight script faults (off by default, stored as gemini-translator-malform-detector). Marks cells whose writing system does not match the locale (including leftover Latin in Gujarati, Hindi, and similar). Placeholders (:name, {0}, [2,*]) and Common marks (danda ) are ignored. Review-only — it does not rewrite files.
  • Lang packs in the manager and the CLI. Extra folders such as lang/app3/ and lang/web/ are separate trees from lang/. After you pick a module that has extra packs, the CLI asks which packs to process, then lists JSON/PHP files from those packs only.
  • Scans registered loadJsonTranslationsFrom() / loadTranslationsFrom() directories and published resources/lang/modules/{name} (published copy wins). Composer vendor/ lang trees are skipped.
  • 249-language catalog with display names and fallbacks (zhzh_CN, ptpt_BR, papa_GURU, and similar).
  • Multi-OS adapters: Linux/macOS use Laravel Prompts + spatie/fork (pcntl). Windows uses kernel32 menus (FFI) and Symfony Process workers for parallel chunks. --driver=process is available on every OS. Sequential sync remains the fallback.
  • --refresh-clean: rebuild existing keys only, ignoring stale file wording. Official Laravel English is the source for auth / pagination / passwords / validation.
  • Configurable Gemini model: --model, GEMINI_MODEL / GEMINI_TRANSLATOR_MODEL, then config. Default is gemini-3.5-flash-lite.
  • Dated free-tier quota snapshot in config/gemini-translator.php (as of 2026-08-13). Edit, add, or zero rows when Google changes RPM/RPD. GEMINI_TRANSLATOR_APPLY_FREE_TIER_CAPS can turn snapshot caps off.

🔧 Improvements

  • Interactive prompts and parallel work go through a platform factory instead of PHP_OS_FAMILY branches inside the command.
  • --driver=fork on Windows runs Process workers (it no longer falls back to sequential sync).
  • Windows FFI menus match Laravel Prompts (boxed list, checkboxes, arrows, space, enter).
  • --refresh is the original refresh again: existing keys only, current file wording is the source.
  • JSON writes keep dotted PHP-style keys (messages.welcome, validation.required) when that group is selected.
  • Translation prompts send source text plus writing-system checks that reduce mixed-script, leftover-English, placeholder, and plural-token drift. Detected bad output falls back to the source. The checks do not eliminate every mixed or off-language row.
  • Cannot-write errors name the PHP process user (not a hard-coded www-data).
  • Command summary records processed_chunks.

🐛 Bug Fixes

  • JSON-only file selection no longer treats file.subkey keys that belong to a PHP lang group as JSON keys.
  • Selecting a single CLI file group returns that file (it previously returned array_keys of a list).

Notice — AI translations

Gemini translations are generally high quality. The package sends source text, per-locale script rules, and a writing-system check so most output matches the language you asked for. Gemini can still mix writing systems, slip in another language, or return wording that is not literal or expected (for example Gujarati mixed with Hindi, Kannada, or English). The check reduces those cases; it does not catch every mistake. Human review is still recommended for production-critical text. Use Highlight script faults in the manager, --refresh or --refresh-clean for leftover faults, and --context for domain terms.

📋 Requirements

  • PHP 8.3 or higher
  • Laravel 11.0, 12.0, or 13.0
  • Google Gemini API key
  • pcntl for the Unix fork driver; ffi for native Windows menus (optional)