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(10mo ago)331.7k↑13.3%MITPHPPHP ^8.1CI passing

Since Jul 1Pushed 10mo 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 today

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

38

—

LowBetter than 83% of packages

Maintenance53

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

329d 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

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[tallstackui/tallstackui

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

725173.2k14](/packages/tallstackui-tallstackui)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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