v1.0.0
🎉 Initial Stable Release
This is the first stable release of Laravel Localizer, a powerful localization package that bridges Laravel translations to your SPA frontend (React/Vue) with automatic TypeScript generation.
✨ Core Features
-
Translation Management
- Create, read, update, and delete locales
- Support for both JSON and PHP translation files
- Bulk operations for efficient translation management
- Nested translation support with dot notation
- HTML entity escaping for security
- In-memory caching for optimal performance
-
Automatic Translation Scanning
- Scan codebase for
__(),trans(), andlang()calls - Support for multiple file extensions (PHP, Blade, JS, JSX, TS, TSX, Vue)
- Handles escaped quotes and special characters
- Configurable include/exclude patterns
- Preserves existing translations during sync
- Scan codebase for
-
TypeScript Generation
- Generate TypeScript files from Laravel translations
- Auto-generated index file for easy imports
- Type-safe translation keys
- Vendor package translation support
- Proper escaping for special characters
-
Auto-translation
- Integrate with Google Translate for automatic translations
- Queued job processing for background translation
- Rate limiting to avoid API throttling
- Skip already translated keys
- Support for nested PHP translation arrays
🎨 Frontend Integration
-
React Package -
@devwizard/laravel-localizer-reactuseLocalizer()hook- Vite plugin for automatic regeneration
- Full TypeScript support
- Inertia.js integration
-
Vue Package -
@devwizard/laravel-localizer-vueuseLocalizer()composable- Reactive locale and direction
- Vite plugin for automatic regeneration
- Full TypeScript support
- Inertia.js integration
🛠️ Commands
localizer:install- Interactive installation wizardlocalizer:sync- Scan and sync translation keyslocalizer:translate- Auto-translate between localeslocalizer:generate- Generate TypeScript files
🔧 Middleware
- LocalizerMiddleware - Automatic locale detection
- Query parameter (
?locale=fr) - Request header (
X-Locale) - Session storage
- User model method (
$user->getLocale()) - Browser language (
Accept-Language) - Fallback to default locale
- Share locale data with Inertia.js
- Query parameter (
📦 Configuration
- Extensive configuration options
- Support for multiple locales
- Locale metadata (label, flag, direction)
- RTL language support
- Customizable paths and scan patterns
🧪 Testing
- Comprehensive test suite with 80+ test cases
- Unit tests for core functionality
- Command tests for all Artisan commands
- Middleware tests for locale detection
- Job tests for translation processing
- 100% coverage of critical paths
📚 Documentation
- Complete README with examples
- API documentation
- Deployment guidelines
- Frontend integration guides
- Configuration reference
🔒 Security
- HTML entity escaping
- Safe file operations
- Protected against XSS
- Validated locale codes
⚡ Performance
- In-memory caching
- Efficient file operations
- Build-time TypeScript generation
- Lazy loading support
📝 Requirements
- PHP 8.4+
- Laravel 11.0+ or 12.0+
- Composer
🔗 Dependencies
spatie/laravel-package-tools- Package scaffoldingilluminate/contracts- Laravel framework integrationstichoza/google-translate-php- Auto-translation (optional)
Full Changelog: https://github.com/DevWizardHQ/laravel-localizer/commits/v1.0.0