PHPackages                             blumewas/laravel-locale-fallbacks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. blumewas/laravel-locale-fallbacks

ActiveLibrary[Localization &amp; i18n](/categories/localization)

blumewas/laravel-locale-fallbacks
=================================

Opiniated variant on how localizations should be resolved

00[4 PRs](https://github.com/blumewas/laravel-locale-fallbacks/pulls)PHPCI passing

Since Oct 13Pushed 2mo agoCompare

[ Source](https://github.com/blumewas/laravel-locale-fallbacks)[ Packagist](https://packagist.org/packages/blumewas/laravel-locale-fallbacks)[ RSS](/packages/blumewas-laravel-locale-fallbacks/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (6)Used By (0)

Opiniated variant on how localizations should be resolved
=========================================================

[](#opiniated-variant-on-how-localizations-should-be-resolved)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ca495a4c879b947435805b6c01f0fe917e1c1bf7d4581f5ab37b5a0a62dc1497/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c756d657761732f6c61726176656c2d6c6f63616c652d66616c6c6261636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/blumewas/laravel-locale-fallbacks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/50b25e989271f9cf6703a130ab8546573b64d16bd8c050e3747c0a4a89a0f0af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626c756d657761732f6c61726176656c2d6c6f63616c652d66616c6c6261636b732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/blumewas/laravel-locale-fallbacks/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/2a58f4b047fb290fc08eb3caa1c492ad49d997bc4c541e0eaef1a9b2155da5e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626c756d657761732f6c61726176656c2d6c6f63616c652d66616c6c6261636b732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/blumewas/laravel-locale-fallbacks/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ac2bbb6fe2f5c9da306acc8eac08b2cd807ebcb0be7a530161a2c333c9b03602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c756d657761732f6c61726176656c2d6c6f63616c652d66616c6c6261636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/blumewas/laravel-locale-fallbacks)

Opiniated variant on how localizations for an app should be loaded.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require blumewas/laravel-locale-fallbacks
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-locale-fallbacks-config"
```

This is the contents of the published config file:

```
return [
    /**
     * Define the fallback chain for each locale.
     * The keys are the locale codes, and the values are arrays of fallback locales.
     * For example, if 'de' falls back to 'en', you would set:
     * 'de' => ['en'].
     * This means that if a translation is not found in 'de', it will look for
     * the translation in 'en'.
     * You can define multiple fallbacks for a locale.
     * For example, 'de' => ['en', 'fr'] means it will first
     * try 'en', and if not found, it will try 'fr'.
     * A fallback chain is also composed. E.g. if 'de' falls back to 'en',
     * and 'de-DE' falls back to 'de', we will first try 'de-DE',
     * then 'de', and finally 'en'. This would be equivalent to:
     * 'de-DE' => ['de', 'en'],
     * 'de' => ['en'].
     */
    'fallbacks' => [
        'de' => ['en'],
    ],

    /**
     * Whether to automatically add two-letter language codes as fallbacks.
     * This is useful for apps that have regional variations of languages
     * (e.g., 'en-US' and 'en-GB') and want to ensure that
     * the two-letter code ('en') is always available as a fallback.
     */
    'autofallback_two_letter_codes' => true,
];
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [blumewas](https://github.com/blumewas)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance56

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5960093?v=4)[Andreas Schneider](/maintainers/blumewas)[@blumewas](https://github.com/blumewas)

---

Top Contributors

[![blumewas](https://avatars.githubusercontent.com/u/5960093?v=4)](https://github.com/blumewas "blumewas (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/blumewas-laravel-locale-fallbacks/health.svg)

```
[![Health](https://phpackages.com/badges/blumewas-laravel-locale-fallbacks/health.svg)](https://phpackages.com/packages/blumewas-laravel-locale-fallbacks)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
