Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Localizer Laravel Package

devwizardhq/laravel-localizer

View on GitHub
Deep Wiki
Context7
v1.2.2
v1.2.1

What's Changed

Full Changelog: https://github.com/DevWizardHQ/laravel-localizer/compare/v1.2.0...v1.2.1

v1.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/DevWizardHQ/laravel-localizer/compare/v1.0.1...v1.1.0

v1.0.1

What's Changed

  • fix: Update import statements in InstallCommand for correct TypeScript typings

Full Changelog: https://github.com/DevWizardHQ/laravel-localizer/compare/v1.0.0...v1.0.1

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(), and lang() 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
  • 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](https://github.com/devwizard)/laravel-localizer-react

    • useLocalizer() hook
    • Vite plugin for automatic regeneration
    • Full TypeScript support
    • Inertia.js integration
  • Vue Package - [@devwizard](https://github.com/devwizard)/laravel-localizer-vue

    • useLocalizer() composable
    • Reactive locale and direction
    • Vite plugin for automatic regeneration
    • Full TypeScript support
    • Inertia.js integration

๐Ÿ› ๏ธ Commands

  • localizer:install - Interactive installation wizard
  • localizer:sync - Scan and sync translation keys
  • localizer:translate - Auto-translate between locales
  • localizer: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

๐Ÿ“ฆ 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 scaffolding
  • illuminate/contracts - Laravel framework integration
  • stichoza/google-translate-php - Auto-translation (optional)
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle