PHPackages                             laraeast/laravel-locales - 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. laraeast/laravel-locales

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

laraeast/laravel-locales
========================

The package used to support multi locales in your application.

v4.3.2(7mo ago)064.8k↑84.7%3MITPHPPHP ^8.1CI passing

Since Nov 28Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/laraeast/laravel-locales)[ Packagist](https://packagist.org/packages/laraeast/laravel-locales)[ RSS](/packages/laraeast-laravel-locales/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (5)Versions (23)Used By (3)

Laravel Multi Locales Package
=============================

[](#laravel-multi-locales-package)

[![Build Status](https://github.com/laraeast/laravel-locales/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/laraeast/laravel-locales/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/2b6af6dafadbdb76867b38d55ffc832943a9fdf73139b00ee3ae2c3d61cc3566/68747470733a2f2f706f7365722e707567782e6f72672f6c617261656173742f6c61726176656c2d6c6f63616c65732f642f746f74616c2e737667)](https://packagist.org/packages/laraeast/laravel-locales)[![Latest Stable Version](https://camo.githubusercontent.com/7ac3e46e13d4a9ae42671b35a08d32e27ae6041d76004383caf02695c8476368/68747470733a2f2f706f7365722e707567782e6f72672f6c617261656173742f6c61726176656c2d6c6f63616c65732f762f737461626c652e737667)](https://packagist.org/packages/laraeast/laravel-locales)[![License](https://camo.githubusercontent.com/f01af8dca7e9de80354640eaa74326155493b5a2a522ec2f0d5cc7de1e025baa/68747470733a2f2f706f7365722e707567782e6f72672f6c617261656173742f6c61726176656c2d6c6f63616c65732f6c6963656e73652e737667)](https://packagist.org/packages/laraeast/laravel-locales)

> The package used to support multi locales in your application.

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

[](#installation)

1. Install package

    ```
    composer require laraeast/laravel-locales
    ```
2. Edit config/app.php (Skip this step if you are using laravel 5.5+)

    service provider:

    ```
    Laraeast\LaravelLocales\Providers\LocalesServiceProvider::class,
    ```

    class aliases:

    ```
    'Locales' => Laraeast\LaravelLocales\Facades\Locales::class,
    ```
3. Configure your custom locales:

    ```
    php artisan vendor:publish --tag="locales:config"
    ```

Usage
-----

[](#usage)

#### Locales selector dropdown:

[](#locales-selector-dropdown)

```

    {{ Locales::getSvgFlag(width: 25, height: 25) }}
    {{ Locales::getName() }}

    @foreach(Locales::get() as $locale)

                {{ $locale->getName() }}

    @endforeach

```

#### API

[](#api)

```
Locales::get();
// array of supported locales

Locales::set('en');

Locales::current();
// the current locale instance

Locales::current()->getCode();
// or
Locales::getCode();
// return : en

Locales::current()->getName();
// or
Locales::getName();
// return : English

Locales::current()->getName();
// or
Locales::getDir();
// return : ltr

Locales::current()->getSvgFlag();
// or
Locales::getSvgFlag();
// return : svg (html)

Locales::from('en');
// return : \Laraeast\LaravelLocales\Enums\Language::EN

Locales::codes();
// return array of configured languages codes: ['en', 'ar', 'fr'. '...etc']

Locales::names();
// return array of configured languages names: ['English', 'العربية', 'Français'. '...etc']

Locales::flags(width: 30, height: 30);
// return array of configured languages svg flags with width=30 and height=30
```

#### Generate locales file in JS:

[](#generate-locales-file-in-js)

```
php artisan locales:generate-js
```

This command will generate javascript file contains the configured languages, So if you change the languages, You should rul this command to update the javascript file.

Example Generated file `resources/js/data/supported-locales.ts`:

```
export default [
    {
        "name": "English",
        "code": "en",
        "dir": "ltr",
        "flag": ""
    },
    {
        "name": "French",
        "code": "fr",
        "dir": "ltr",
        "flag": ""
    }
];
```

It recommended to use [locales-manager](https://www.npmjs.com/package/locales-manager) js plugin to works with javascript.

```
npm i locales-manager --save-dev
```

```
import Locales from "locales-manager";
import supportedLocales from "./data/supported-locales";

let locales = new Locales(supportedLocales);

locales.setLocale('ar')

console.log(locales.current().getName()) // Arabic
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance62

Regular maintenance activity

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.2% 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.

###  Release Activity

Cadence

Every ~120 days

Recently: every ~38 days

Total

22

Last Release

234d ago

Major Versions

v1.0.4 → v2.0.02020-06-18

v2.0.1 → v3.0.02020-08-29

v3.3.0 → v4.0.02025-05-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23261109?v=4)[Ahmed Fathy](/maintainers/ahmed-aliraqi)[@ahmed-aliraqi](https://github.com/ahmed-aliraqi)

---

Top Contributors

[![ahmed-aliraqi](https://avatars.githubusercontent.com/u/23261109?v=4)](https://github.com/ahmed-aliraqi "ahmed-aliraqi (35 commits)")[![AlShahawi](https://avatars.githubusercontent.com/u/5667648?v=4)](https://github.com/AlShahawi "AlShahawi (1 commits)")

### Embed Badge

![Health badge](/badges/laraeast-laravel-locales/health.svg)

```
[![Health](https://phpackages.com/badges/laraeast-laravel-locales/health.svg)](https://phpackages.com/packages/laraeast-laravel-locales)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M120](/packages/laravel-mcp)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)

PHPackages © 2026

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