Download the PHP package juksgraphic/bladetranslator without Composer
On this page you can find all versions of the php package juksgraphic/bladetranslator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juksgraphic/bladetranslator
More information about juksgraphic/bladetranslator
Files in juksgraphic/bladetranslator
Package bladetranslator
Short Description An AI-powered package to extract, translate, and manage language files directly from Laravel Blade views.
License MIT
Homepage https://github.com/juksgraphic/bladetranslator
Informations about the package bladetranslator
BladeTranslator
BladeTranslator is an AI-powered PHP/Laravel package designed to automate the extraction, translation, and management of language files directly from your Blade views.
It automatically sanitizes unneeded HTML/SVG markup, extracts translatable text, manages batch splitting during AI response truncation, self-corrects invalid AI responses, and securely stores translations in JSON format.
Features
- ๐งน Smart Blade Extraction: Removes comments,
<svg>tags, and unnecessary HTML noise before sending payloads to the AI. - ๐ค AI-Driven Translation: Flexible integration with feedback loops for self-correction when keys or placeholders are mismatched.
- ๐ฆ Dynamic Batch Splitting: Automatically splits batches into smaller chunks if the AI response gets truncated (
finish_reason: length). - ๐ Secure JSON Storage: Prevents path traversal attempts and supports optional alphabetical key sorting.
- ๐ Robust Translation Loader: Full support for dynamic placeholders (
:nameand{name}) and intelligent locale fallback chains.
Requirements
- PHP:
^8.4 - Composer
Installation
You can install the package via Composer:
Quick Start
1. Configuration (TranslatorConfig)
Initialize the package configuration with your project settings:
2. Extract and Translate Blade Views (PageTranslator)
Use PageTranslator alongside your custom AI provider (implementing ProviderInterface):
3. Load Translations (TranslationLoader)
Retrieve translated strings seamlessly with variable interpolation and fallback handling:
Testing
Run the test suite via Pest PHP:
Changelog
Please see CHANGELOG.md for more information on what has changed recently.
Contributing
Please see CONTRIBUTING.md for contribution guidelines.
Security Vulnerabilities
If you discover any security-related issues, please email [email protected] instead of using the public issue tracker.
Credits
- Kingsley Guillaume โ Lead Developer & Creator
- All Contributors
License
The MIT License (MIT). Please see License File for more information.