PHPackages                             bambamboole/laravel-lokalise - 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. bambamboole/laravel-lokalise

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

bambamboole/laravel-lokalise
============================

A laravel package to effortlessly sync translations with Lokalise

0.10.0(9mo ago)331.0k↓50%MITPHPPHP ^8.1CI passing

Since Jul 1Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/bambamboole/laravel-lokalise)[ Packagist](https://packagist.org/packages/bambamboole/laravel-lokalise)[ Docs](https://github.com/bambamboole/laravel-lokalie)[ RSS](/packages/bambamboole-laravel-lokalise/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (22)Used By (0)

Laravel Lokalise
================

[](#laravel-lokalise)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0d9fea0d450b501da1caa8c2bbf996e6c7b6848bd7476935e9e54a286acefca0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616d62616d626f6f6c652f6c61726176656c2d6c6f6b616c6973652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bambamboole/laravel-lokalise)[![Total Downloads](https://camo.githubusercontent.com/6f8a344bb3df6055970e7322eee7c97cbb3c8ef45ccbde0528a41d12baeb9cd1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62616d62616d626f6f6c652f6c61726176656c2d6c6f6b616c6973652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bambamboole/laravel-lokalise)[![GitHub Actions](https://github.com/bambamboole/laravel-lokalise/actions/workflows/main.yml/badge.svg)](https://github.com/bambamboole/laravel-lokalise/actions/workflows/main.yml/badge.svg)

This package provides a simple way to sync your Laravel translations with Lokalise without changing anything in your translations nor in your lokalise settings. It just works!

Lokalise states, that they support Laravel translations, but out of the box this is not the case.
They do not support Laravels placeholders and also not its pluralization. In Laravel it is also common to use two translation files. Multiple PHP files per locale which contain nested keys and also one JSON file per locale which uses the base locale as key.

How does it work?
-----------------

[](#how-does-it-work)

The package does a few things to give the best out-of-the-box experience.
It checks your JSON and PHP translations separately.
Dotted translation keys will get prefixed by the file name.
The translations are then processed on the fly to convert placeholders and pluralization to Lokalise compatible formats.
It then uploads the files to Lokalise.
Downloading translations works a bit different since Lokalise converts the placeholders to a non-reversible format when downloading whole files. Therefor the package makes usage of the translation keys API instead of the files API. It fetches all keys, converts the placeholders back to the Laravel format and then groups them per locale and file. Instead if just dumping the files it always merges them with the local files. Any leaf node collisions will be resolved and moved to the JSON file.

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

[](#installation)

You can install the package via composer.

```
composer require bambamboole/laravel-lokalise
```

Add the following environment variables to your `.env` file:

```
LOKALISE_API_TOKEN=your-lokalise-api-token
LOKALISE_PROJECT_ID=your-lokalise-project-id
```

Usage
-----

[](#usage)

The package is still in its early development and therefor pretty opinionated and not very flexible.

To upload your translations to Lokalise you can run the following command:

```
php artisan lokalise:upload
```

To upload only specific files You can add relative file path directly behind the command

```
php artisan lokalise:upload lang/en.json lang/en/validation.php
# or for CI
git diff --name-only | grep lang/ | xargs php artisan lokalise:upload
```

The `--replace` flag will set `replace_modified` on the [API](https://developers.lokalise.com/reference/upload-a-file) to `true`.

You can add the `--cleanup` flag to remove all translations from Lokalise which are not in your project anymore. If you add it without specifying files it will also remove all keys from files which do not exist anymore

To download your translations from Lokalise you can run the following command:

```
php artisan lokalise:download
```

### Testing

[](#testing)

```
composer test
```

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

[](#contributing)

### Ideas/Roadmap

[](#ideasroadmap)

- Add more tests
- Support nested files
- Support multi pluralisation like `'apples' => '{0} There are none|[1,19] There are some|[20,*] There are many'`
- Your idea here

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Manuel Christlieb](https://github.com/bambamboole)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance58

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~25 days

Recently: every ~30 days

Total

17

Last Release

276d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/547137a6d80cad01ed1dd065b1c6af329d9a23a4134a895cff01e078cc155500?d=identicon)[bambamboole](/maintainers/bambamboole)

---

Top Contributors

[![bambamboole](https://avatars.githubusercontent.com/u/8823695?v=4)](https://github.com/bambamboole "bambamboole (61 commits)")

---

Tags

bambamboolelaravel-lokalise

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bambamboole-laravel-lokalise/health.svg)

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[nikaia/translation-sheet

Laravel Translation via Google Spreadsheet

294606.4k1](/packages/nikaia-translation-sheet)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[highsolutions/laravel-translation-manager

Manage Laravel Translations

1518.8k](/packages/highsolutions-laravel-translation-manager)[amendozaaguiar/laravel-lat-es

Archivos de traducción al español latinoamericano para Laravel (auth, pagination, passwords, validation).

198.5k](/packages/amendozaaguiar-laravel-lat-es)[amendozaaguiar/laraveles-spanish-for-jetstream

Archivos de traducción al español latinoamericano para Laravel con Jetstream (auth, pagination, passwords, validation + todas las cadenas de Jetstream).

1412.1k](/packages/amendozaaguiar-laraveles-spanish-for-jetstream)

PHPackages © 2026

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