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

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

tio/laravel
===========

Add this package to localize your Laravel application (PHP, JSON or GetText).

v1.23(3y ago)170318.5k↑13.9%21[1 PRs](https://github.com/translation/laravel/pulls)MITPHPPHP &gt;=7.0CI passing

Since Mar 23Pushed 1y ago9 watchersCompare

[ Source](https://github.com/translation/laravel)[ Packagist](https://packagist.org/packages/tio/laravel)[ Docs](https://github.com/translation/laravel)[ RSS](/packages/tio-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (26)Used By (0)

[Translation.io](https://translation.io/laravel) client for Laravel 5.5+ to 12.x
================================================================================

[](#translationio-client-for-laravel-55-to-12x)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://github.com/translation/laravel/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/translation/laravel/actions/workflows/test.yml)[![Test Coverage](https://camo.githubusercontent.com/5fbba3a8e224f92fbbbb2ca41810b3d09f14897dbc4e596954a63223a9d26f99/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35353265316464633366336636303464343930382f746573745f636f766572616765)](https://codeclimate.com/github/translation/laravel/test_coverage)[![Maintainability](https://camo.githubusercontent.com/732604159980a115980d2538d1dd467dc870350d4d1af4e6d4bb37b1f1847239/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35353265316464633366336636303464343930382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/translation/laravel/maintainability)[![Package Version](https://camo.githubusercontent.com/23cd510612c74332b291d5bf53eb136f98cb0bc2277748961d4552048606ca34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74696f2f6c61726176656c3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tio/laravel)[![Downloads](https://camo.githubusercontent.com/3545e5882abfcfd72923f07ac5b956595f2933c98d9baa89e31448d83975c02c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74696f2f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tio/laravel)

Add this package to localize your **Laravel** application.

Use the official Laravel syntax (with [PHP](#laravel-localization-php-keyvalues) or [JSON](#laravel-localization-json-source-text) files), or use the [GetText](#gettext) syntax.

Write only the source text, and keep it synchronized with your translators on [Translation.io](https://translation.io/laravel).

[ ![Translation.io interface](https://camo.githubusercontent.com/3739639bf2e8ae42c2af127bf121dd10b1116ca988a0ea27b2ff620ceada4d0b/68747470733a2f2f7472616e736c6174696f6e2e696f2f676966732f7472616e736c6174696f6e2e676966)](https://translation.io/laravel)[Technical Demo](https://translation.io/videos/laravel.mp4) (2.5min)

Need help?

Table of contents
-----------------

[](#table-of-contents)

- [Localization syntaxes](#localization-syntaxes)
    - [Laravel Localization (PHP key/values)](#laravel-localization-php-keyvalues)
    - [Laravel Localization (JSON source text)](#laravel-localization-json-source-text)
    - [GetText](#gettext)
- [Installation](#installation)
- [Usage](#usage)
    - [Sync](#sync)
    - [Sync and Show Purgeable](#sync-and-show-purgeable)
    - [Sync and Purge](#sync-and-purge)
- [Manage Languages](#manage-languages)
    - [Add or Remove Language](#add-or-remove-language)
    - [Edit Language](#edit-language)
    - [Custom Languages](#custom-languages)
- [Change the current locale](#change-the-current-locale)
    - [Globally](#globally)
    - [Locally](#locally)
- [Frontend Localization](#frontend-localization)
    - [Using this package](#using-this-package)
    - [Using our official React &amp; JavaScript package](#using-our-official-react--javascript-package)
- [Advanced Configuration Options](#advanced-configuration-options)
    - [Ignored PHP keys](#ignored-php-keys)
- [Testing](#testing)
- [Contributing](#contributing)
- [List of clients for Translation.io](#list-of-clients-for-translationio)
    - [Ruby on Rails (Ruby)](#ruby-on-rails-ruby)
    - [Laravel (PHP)](#laravel-php)
    - [React, React Native and JavaScript](#react-react-native-and-javascript)
    - [Angular](#angular)
    - [Others](#others)
- [License](#license)

Localization syntaxes
---------------------

[](#localization-syntaxes)

### Laravel Localization (PHP key/values)

[](#laravel-localization-php-keyvalues)

The [default Laravel method to localize](https://laravel.com/docs/master/localization#using-short-keys).

```
// Regular
__('inbox.title');

// Regular with sublevel key
__('inbox.menu.title');

// Pluralization
trans_choice('inbox.messages', $number);

// Interpolation
__('inbox.hello', ['name' => $user->name]);
```

With the PHP file `lang/en/inbox.php`:

```
