Skip to content

v3.8: The Reliability & Quality Update

Latest

Choose a tag to compare

@jayeshmepani jayeshmepani released this 10 Nov 12:23

Release Notes

This release builds directly on the foundation of the "Enterprise Edition" (v3.7) by focusing on rock-solid reliability, output quality, and cross-platform compatibility. We've eliminated annoying placeholders, fixed critical output bugs, and ensured the tool works flawlessly for Windows and CI/CD users.

TL;DR: The tool is now automation-friendly and diff-friendly. It skips interactive prompts in CI/CD, guarantees stable file sorting, and hardens the AI integration with intelligent fallbacks.


🚀 Key Enhancements

New: Intelligent Fallbacks - No More "NEEDS TRANSLATION"!

The most requested improvement is here. If the AI fails to return a translation, the system now intelligently falls back to the known en source text or the key itself. Your generated files are always usable and ready for review, not filled with useless placeholders.

🧠 New: Hyper-Strict AI Prompting Engine

The prompt sent to Gemini has been re-engineered with a stricter rule set. This resolves a critical bug where the AI would create nested objects in JSON files. All JSON output is now guaranteed to be flat and valid.

💅 New: Deterministic PHP Arrays with Recursive Sorting

Generated PHP translation files are now sorted recursively. This ensures that not only top-level keys but also all nested array keys are sorted alphabetically, leading to clean, stable, and minimal diffs in your version control.

New: Full Windows & CI/CD Compatibility

The tool now detects non-interactive environments (like GitHub Actions, Docker) and automatically proceeds without hanging on prompts. It also includes a dedicated, functional prompt for Windows users, ensuring a smooth experience for everyone.


⚠️ Breaking Changes & Upgrade Guide

Please read these notes carefully before upgrading.

1. Default Languages Changed to en

The --langs option now defaults to en only (previously en,ru,uz) to prevent accidental multi-language runs.

  • Action Required: If you rely on multiple locales, you must now pass them explicitly:
    php artisan translations:extract-and-generate --langs=en,ru,uz

2. Deterministic Sorting May Reorder Arrays

The new recursive sorting will likely reorder nested arrays in your existing PHP language files.

  • Action Required: Expect a one-time, larger-than-usual diff in your language files after the first run. This is expected and will lead to much cleaner diffs in the future.

3. Update Banner Text

  • Action Required: Remember to update the version number in the showWelcome() method from (v3.7) to (v3.8) for consistency.

Full Changelog

Click to expand for detailed changes
  • New: ksortRecursive() method added and implemented when writing PHP language files.
  • New: Robust detection of non-interactive and Windows environments in promptForMultiChoice().
  • Improved: The AI fallback logic in staticStructureTranslationsFromGemini() now uses the $sourceTextMap instead of generating placeholders.
  • Improved: The AI prompt in staticTranslateKeysWithGemini() is now much stricter to enforce flat JSON and improve consistency.
  • Fixed: The framework language loader in loadFrameworkTranslations() now safely iterates files and filters by extension.
  • Fixed: Parallel tasks now explicitly capture the $sourceTextMap to ensure correct fallbacks in fork mode.
  • Changed: The default value for the --langs option in the command signature is now en.