Skip to content

Releases: DevWizardHQ/laravel-localizer-react

v1.0.1

10 Nov 06:47

Choose a tag to compare

What's Changed

  • fix: bump version to 1.0.1 in package.json

Full Changelog: v1.0.0...v1.0.1

v1.0.0

10 Nov 04:18

Choose a tag to compare

🎉 Initial Stable Release

This is the first stable release of Laravel Localizer React, providing seamless integration between Laravel translations and React applications.

✨ Features

useLocalizer Hook

A powerful React hook for accessing Laravel translations with full TypeScript support:

  • Translation Functions

    • __() - Main translation function with placeholder replacement and fallback support
    • trans() - Alias for __() (Laravel compatibility)
    • lang() - Alias for __() (Laravel compatibility)
    • has() - Check if translation key exists
    • choice() - Pluralization support with replacement variables
  • Locale Information

    • locale - Current locale code (e.g., 'en', 'fr')
    • dir - Text direction ('ltr' or 'rtl')
    • availableLocales - Available locales with metadata (label, flag, direction)
    • translations - All translations for current locale

Placeholder Replacement

  • Supports both :placeholder and {placeholder} formats
  • Multiple placeholders in single string
  • Numeric and string replacements
  • Nested placeholder support

Pluralization

  • Laravel-compatible pluralization format
  • Support for zero, one, and many forms
  • Placeholder replacement in pluralized strings
  • Custom count-based rules

Vite Plugin

Automatic TypeScript generation with hot module replacement:

  • Watches language files for changes
  • Non-blocking command execution
  • Configurable watch patterns
  • Debug logging option
  • Integrates with Laravel Artisan commands

Inertia.js Integration

Seamless integration with Inertia.js:

  • Automatic locale detection from page props
  • Reactive locale updates
  • Shared locale data
  • RTL support via page props

🎯 TypeScript Support

  • Full type definitions
  • IntelliSense support in IDEs
  • Type-safe placeholder replacements
  • Strict mode compatible
  • Exported types for custom implementations

🧪 Testing

  • Comprehensive test suite with Jest
  • React Testing Library integration
  • 100% code coverage
  • Mock Inertia.js integration
  • Example test patterns

📦 Package Configuration

  • ESM-only distribution (modern bundlers)
  • Tree-shakeable exports
  • Separate entry points for hook and Vite plugin
  • Proper peer dependencies
  • Side-effect free

🔧 Build System

  • Built with tsup for optimal bundling
  • Source maps for debugging
  • Minified production builds
  • Declaration files included

� Documentation

  • Complete README with examples
  • API reference
  • Setup guide
  • Integration examples
  • TypeScript usage patterns

🔗 Dependencies

  • React 18 or 19 (peer dependency)
  • Inertia.js v1 or v2 (peer dependency)
  • Vite 5+ (peer dependency for plugin)
  • minimatch for pattern matching in Vite plugin

⚡ Performance

  • Memoized translation lookups
  • Cached locale data
  • Optimized re-renders
  • Lazy evaluation

🎨 Developer Experience

  • Hot module replacement in development
  • Automatic regeneration on file changes
  • Clear error messages
  • Debug mode for troubleshooting

📝 Requirements

  • Node.js 16+
  • React 18+
  • Inertia.js v1 or v2
  • Laravel Localizer backend package

v0.0.4

09 Nov 10:59

Choose a tag to compare

v0.0.3

09 Nov 10:36

Choose a tag to compare

@beta
Full Changelog: v0.0.2...v0.0.3

v0.0.1

09 Nov 08:36

Choose a tag to compare

v0.0.1 - 2025-11-09

🎉 Initial Beta Release

  • useTranslation Hook: React hook for accessing Laravel translations

    • __() - Main translation function with replacements and fallback
    • trans() - Alias for __()
    • lang() - Alias for __()
    • has() - Check if translation key exists
    • choice() - Pluralization support
    • locale - Current locale code
    • dir - Text direction (ltr/rtl)
    • availableLocales - Available locales with metadata
    • translations - All translations for current locale
  • Vite Plugin: Automatic TypeScript generation

    • Watches lang/** directory for changes
    • Debounced regeneration (300ms)
    • Runs php artisan localizer:generate --all automatically
    • Zero configuration required
  • TypeScript Support: Full type safety

    • Comprehensive interfaces for all types
    • IntelliSense support in IDEs
    • Strict mode compatible
  • Inertia.js Integration: Seamless integration with Inertia.js

    • Works with both Inertia v1 and v2
    • Supports React 18 and 19
    • Automatic page props detection

📚 Documentation

  • Comprehensive README with usage examples
  • API documentation with TypeScript interfaces
  • Migration guide from v1 to v2

🧪 Testing

  • Jest configuration
  • Comprehensive test suite with 100% coverage
  • Testing Library for React components
  • ESM module support

🛠️ Development Tools

  • ESLint configuration with TypeScript and React rules
  • Prettier for code formatting
  • tsup for building and bundling
  • GitHub Actions for CI/CD

📦 Package Configuration

  • ESM-only distribution
  • Tree-shakeable exports
  • Proper package.json exports field
  • Peer dependencies: React 18+, Inertia v1/v2, Vite 5+

Full Changelog: https://github.com/DevWizardHQ/laravel-localizer-react/commits/v0.0.1