v5.1.0: Translation Manager, Cross-Platform CLI & Lang Packs
⭐ 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/andlang/web/are separate trees fromlang/. 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 publishedresources/lang/modules/{name}(published copy wins). Composervendor/lang trees are skipped. - 249-language catalog with display names and fallbacks (
zh→zh_CN,pt→pt_BR,pa→pa_GURU, and similar). - Multi-OS adapters: Linux/macOS use Laravel Prompts +
spatie/fork(pcntl). Windows useskernel32menus (FFI) and Symfony Process workers for parallel chunks.--driver=processis available on every OS. Sequentialsyncremains the fallback. --refresh-clean: rebuild existing keys only, ignoring stale file wording. Official Laravel English is the source forauth/pagination/passwords/validation.- Configurable Gemini model:
--model,GEMINI_MODEL/GEMINI_TRANSLATOR_MODEL, then config. Default isgemini-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_CAPScan turn snapshot caps off.
🔧 Improvements
- Interactive prompts and parallel work go through a platform factory instead of
PHP_OS_FAMILYbranches inside the command. --driver=forkon Windows runs Process workers (it no longer falls back to sequentialsync).- Windows FFI menus match Laravel Prompts (boxed list, checkboxes, arrows, space, enter).
--refreshis 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.subkeykeys that belong to a PHP lang group as JSON keys. - Selecting a single CLI file group returns that file (it previously returned
array_keysof 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
pcntlfor the Unix fork driver;ffifor native Windows menus (optional)