- How do I install laravel-lang/locales in a Laravel 13 project?
- Run `composer require laravel-lang/locales` in your project directory. No additional configuration is needed for basic usage. The package integrates automatically with Laravel’s translation system. For custom setups, check the [documentation](https://laravel-lang.com/packages-locales.html) for optional configuration.
- Does this package support right-to-left (RTL) languages like Arabic or Hebrew?
- Yes, the package includes native RTL support via the `direction` property (replacing deprecated `orientation`). It handles text directionality for languages like Arabic, Hebrew, and Persian out of the box. No extra setup is required for basic RTL functionality.
- Can I use this with Laravel’s translation files (e.g., resources/lang) without conflicts?
- Absolutely. This package is designed to complement Laravel’s built-in translation system. It provides locale metadata (e.g., country/currency names, flags) while leaving translation strings in your `resources/lang` directory untouched. It’s a zero-duplication solution.
- What Laravel versions does laravel-lang/locales support, and how do I downgrade?
- The package supports Laravel 11–13 (as of v2.11) and requires PHP 8.1+. Downgrading to older Laravel versions may require pinning to a compatible release (e.g., v2.7 for Laravel 10). Check the [release notes](https://github.com/Laravel-Lang/locales/releases) for version-specific guidance.
- How do I implement fallback chains (e.g., fr-CA → fr → en) for missing locales?
- The package includes built-in fallback logic. When a locale like `fr-CA` isn’t fully supported, it automatically falls back to `fr` and then `en`. You can customize fallbacks via the `Locales::setFallbacks()` method or configure them in your `config/app.php` under the `locale` key.
- Is there a performance impact if I use this package in a high-traffic Laravel app?
- The package has minimal runtime overhead (~50KB). For frequent locale lookups (e.g., per-request), enable caching with `Locales::cache()` to store results in memory or Redis. This reduces database or filesystem I/O, making it suitable for production environments.
- Can I extend the locale data for custom use cases (e.g., adding Braille scripts)?
- Yes, you can extend the `LocaleData` class or fork the package to add custom properties. For niche scripts like Braille, check if the underlying `laravel-lang/locale-list` dependency supports them. If not, override the `LocaleData` methods or contribute to the project.
- How do I integrate locale-specific assets like flags or calendars?
- While the package includes methods like `withCountries()` and `withCurrencies()`, asset management is disabled by default in v2.7+. To use flags or calendars, manually store assets (e.g., `public/flags/{locale}.svg`) and reference them in your Blade views or JavaScript.
- Are there alternatives to laravel-lang/locales for Laravel localization?
- Yes, alternatives include Laravel’s built-in locales (limited), `spatie/laravel-translatable`, or third-party APIs like Google’s Language API. However, this package offers a **dedicated, Laravel-native solution** with comprehensive locale metadata, RTL support, and seamless integration with Laravel’s `trans()` helper.
- How can I contribute to the project or report issues?
- Contributions are welcome! Start by reading the [CONTRIBUTING guide](https://laravel-lang.com/contributions.html). Report bugs or request features via GitHub Issues. The project follows semantic versioning, so breaking changes are documented in advance. You can also support development via [Boosty](https://boosty.to/laravel-lang).