PHPackages                             begimov/localization-helper - 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. begimov/localization-helper

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

begimov/localization-helper
===========================

Package for convenient work with Laravel's localization features

v1.1.1(6y ago)046MITPHP

Since Jan 15Pushed 6y agoCompare

[ Source](https://github.com/begimov/localization-helper)[ Packagist](https://packagist.org/packages/begimov/localization-helper)[ Docs](https://github.com/awes-io/localization-helper)[ RSS](/packages/begimov-localization-helper/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

 [ ![Awes.io logo](https://camo.githubusercontent.com/3411caf1ea53cc7f92a106e51ad617072eed81a7d52da1aca5eea4f96b6d001b/68747470733a2f2f7374617469632e617765732e696f2f70726f6d6f2f4c6f676f5f7369676e5f636f6c6f722e737667) ](https://www.awes.io/?utm_source=github&utm_medium=repository)

Localization Helper
===================

[](#localization-helper)

Package for convenient work with Laravel's localization features and fast language files generation.

 [ ![Coverage report](https://camo.githubusercontent.com/7035926833899841248ae1e7d03a77337ca1e1512fbccd97df1a5b8291fa6f02/68747470733a2f2f7265706f2e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f6261646765732f6d61737465722f636f7665726167652e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![Last version](https://camo.githubusercontent.com/d573f5c48348fa71d181422b4a50fd2435105723eeeb37be9f40d06863c380f5/68747470733a2f2f7777772e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f76657273696f6e2e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![Build status](https://camo.githubusercontent.com/cf141a6a1f2afa1f3739cede7dfa796bea339820ea94ae373a61b584f17710bb/68747470733a2f2f7265706f2e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f6261646765732f6d61737465722f6275696c642e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![Downloads](https://camo.githubusercontent.com/ae9294f9a9fbe0a75b9083fef34bc003b1168edd885f24ee7000db79bd8103f2/68747470733a2f2f7777772e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f646f776e6c6f6164732e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![License](https://camo.githubusercontent.com/c0c81734a01a077f635d51ab03b0bf2a034ebc442cb9e0b122a3e988642973b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![CDN Ready](https://camo.githubusercontent.com/e3dc1d9be2506cbb2f01937d05acfb666756b26cdd01d135b100b543c43bf5cd/68747470733a2f2f7777772e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f7374617475732e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![laravel](https://camo.githubusercontent.com/6c8450706caac3ca057866b48ac77f9927d9b206811b156a7c3f05b8e1252b3b/68747470733a2f2f7374617469632e706b676b69742e636f6d2f6261646765732f6c61726176656c2e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![Last commit](https://camo.githubusercontent.com/0d6ca79aa6f30b07674fd1d1826d91284193728e1da6b67eda4b22897695fd7b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722e737667) ](https://www.awes.io/?utm_source=github&utm_medium=shields) [ ![Analytics](https://camo.githubusercontent.com/529f348936d27d6e7e109e3a4442b66e39d2ee2fd18224dbaef389668520cb4a/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d3133343433313633362d312f617765732d696f2f7265706f7369746f7279) ](https://github.com/awes-io/awes-io) [ ![Hosted by Package Kit](https://camo.githubusercontent.com/31a8a2063d3a2b5eae3ae31d0be49d4366bfcd848455e6a6cd39bb7b71cb2b97/68747470733a2f2f7777772e706b676b69742e636f6d2f6261646765732f686f737465642e737667) ](https://www.pkgkit.com/?utm_source=github&utm_medium=shields) [ ![Patreon](https://camo.githubusercontent.com/cc15e6db5bcba81594411e6ec54eb020345f90a5d21b37616523a18112cd41ff/68747470733a2f2f7374617469632e706b676b69742e636f6d2f6261646765732f70617472656f6e2e737667) ](https://www.patreon.com/join/awesdotio)

 [![Localization Helper](https://camo.githubusercontent.com/990ff8a6ba1e4b0fab7359fbb674717df288e74e9b29d6d7efa14e1d52e9e920/68747470733a2f2f7374617469632e617765732e696f2f6769746875622f6c6f63616c697a6174696f6e2d68656c7065722e676966)](https://camo.githubusercontent.com/990ff8a6ba1e4b0fab7359fbb674717df288e74e9b29d6d7efa14e1d52e9e920/68747470733a2f2f7374617469632e617765732e696f2f6769746875622f6c6f63616c697a6174696f6e2d68656c7065722e676966)

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

[](#installation)

Via Composer

```
$ composer require awes-io/localization-helper
```

In Laravel 5.5+, service provider and facade will be automatically registered. For older versions, follow the steps below:

Register service provider in `config/app.php`:

```
'providers' => [
// [...]
        AwesIO\LocalizationHelper\LocalizationHelperServiceProvider::class,
],
```

You may also register `LaravelLocalization` facade:

```
'aliases' => [
// [...]
        'LocalizationHelper' => AwesIO\LocalizationHelper\Facades\LocalizationHelper::class,
],
```

Config
------

[](#config)

### Config Files

[](#config-files)

In order to edit default configuration you may execute:

```
php artisan vendor:publish --provider="AwesIO\LocalizationHelper\LocalizationHelperServiceProvider"

```

After that, `config/localizationhelper.php` will be created.

Usage
-----

[](#usage)

 [![Localization Helper](https://camo.githubusercontent.com/f1ea3f38b0ff31f71d6e346e31293eb944d3d61863e53bd37e7d3ea344190211/68747470733a2f2f7374617469632e617765732e696f2f6769746875622f6c6f63616c697a6174696f6e2d68656c7065722e706e67)](https://camo.githubusercontent.com/f1ea3f38b0ff31f71d6e346e31293eb944d3d61863e53bd37e7d3ea344190211/68747470733a2f2f7374617469632e617765732e696f2f6769746875622f6c6f63616c697a6174696f6e2d68656c7065722e706e67)

Package registers global helper function `_p($file_key, $default, $placeholders)`:

```
_p('auth.login', 'Login'); // "Login"
```

It will create new localization file `auth.php` (if it doesn't exist) and write second parameter as language string under `login` key:

```
return [
    "login" => "Login"
];
```

On second call with same file/key `_p('auth.login')`, localization string will be returned, file will remain untouched.

Placeholders are also supported:

```
_p(
    'mail.invitation',
    'You’re invited to join :company company workspace',
    ['company' => 'Awesio']
);
```

If key is returned, it means that string already exists in localization file and you are trying to add new one using its value as an array.

```
// in localization file.php
return [
    "test" => "Test string"
];

_p('file.test.new', 'Test string'); // will return "file.test.new"

_p('file.test_2.new', 'Test string'); // will return "Test string"

// and modify localization file:
return [
    "test" => "Test string",
    "test_2" => [
        "new" => "Test string"
    ]
];
```

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

The coverage of the package is [![Coverage report](https://camo.githubusercontent.com/7035926833899841248ae1e7d03a77337ca1e1512fbccd97df1a5b8291fa6f02/68747470733a2f2f7265706f2e706b676b69742e636f6d2f344742574f2f617765732d696f2f6c6f63616c697a6174696f6e2d68656c7065722f6261646765732f6d61737465722f636f7665726167652e737667)](https://www.awes.io/?utm_source=github&utm_medium=shields).

You can run the tests with:

```
composer test
```

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

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Credits
-------

[](#credits)

- [Galymzhan Begimov](https://github.com/begimov)
- [All Contributors](contributing.md)

License
-------

[](#license)

[MIT](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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 ~35 days

Recently: every ~44 days

Total

6

Last Release

2497d ago

Major Versions

v0.0.2 → v1.0.02019-02-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/667d93dfec3b7f7c4ef6793a61543a8c2789b8d8016fa19e1dcc7c83a21502be?d=identicon)[begimov](/maintainers/begimov)

---

Top Contributors

[![begimov](https://avatars.githubusercontent.com/u/3600510?v=4)](https://github.com/begimov "begimov (9 commits)")[![AlexFN](https://avatars.githubusercontent.com/u/49072623?v=4)](https://github.com/AlexFN "AlexFN (3 commits)")[![JShantal](https://avatars.githubusercontent.com/u/9612943?v=4)](https://github.com/JShantal "JShantal (3 commits)")[![yevhenlisovenko](https://avatars.githubusercontent.com/u/11060056?v=4)](https://github.com/yevhenlisovenko "yevhenlisovenko (2 commits)")

---

Tags

phplaravellocalizationlanguagetranslationlocale

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/begimov-localization-helper/health.svg)

```
[![Health](https://phpackages.com/badges/begimov-localization-helper/health.svg)](https://phpackages.com/packages/begimov-localization-helper)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)[codezero/laravel-localizer

Automatically detect and set an app locale that matches your visitor's preference.

50394.3k4](/packages/codezero-laravel-localizer)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)

PHPackages © 2026

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