PHPackages                             androlax2/lost-in-translation - 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. androlax2/lost-in-translation

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

androlax2/lost-in-translation
=============================

Uncover missing translations and localization strings in Laravel applications

v1.0.3(4y ago)01.1k1MITPHPPHP ^7.1

Since Oct 17Pushed 4y agoCompare

[ Source](https://github.com/Androlax2/lost-in-translation)[ Packagist](https://packagist.org/packages/androlax2/lost-in-translation)[ RSS](/packages/androlax2-lost-in-translation/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (3)Dependencies (5)Versions (7)Used By (0)

Lost in Translation
===================

[](#lost-in-translation)

[![Build Status](https://camo.githubusercontent.com/dbd12dc8a86fa023965b4b6757955a2552f2d2119ea6d88df14bde530b072c05/68747470733a2f2f7472617669732d63692e6f72672f73746576656772756e77656c6c2f6c6f73742d696e2d7472616e736c6174696f6e2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/stevegrunwell/lost-in-translation)[![Coverage Status](https://camo.githubusercontent.com/e9b235df5ff44401112090dd41b083a0fcc766afa859975340b52bc3ac0f9816/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73746576656772756e77656c6c2f6c6f73742d696e2d7472616e736c6174696f6e2f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/stevegrunwell/lost-in-translation?branch=develop)

Lost in Translation is designed to help developers locate instances of [localization strings within a Laravel application](https://laravel.com/docs/5.5/localization) that haven't been provided translations.

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

[](#installation)

Lost in Translation can be installed into your Laravel project via Composer:

```
$ composer require stevegrunwell/lost-in-translation
```

By default, this will replace the default `TranslationServiceProvider` class with a sub-class that adds additional logic when a translation isn't found. To resume default behavior (even in a production environment), see [the "Configuration" section below](#configuration).

Configuration
-------------

[](#configuration)

By default, Lost in Translation will catch missing translations in two ways:

1. In environments where `APP_DEBUG` is true, a `LostInTranslation\MissingTranslationException` will be found if the application attempts to load a translation that hasn't been defined.
2. Missing translations will be written to `storage/logs/lost-in-translation.log`.

Either of these can be disabled via the package's configuration, making Lost in Translation safe to use in production. These values can be set using the following environment variables:

 TRANS\_LOG\_MISSING Determines whether or not missing translations should be logged. Default is "true". TRANS\_ERROR\_ON\_MISSING Should `MissingTranslationException` exceptions be thrown when a translation is missing? Default is "false".To override package configuration, run the following to copy the configuration to your app's `config/` directory:

```
$ php artisan vendor:publish --provider="LostInTranslation\Providers\TranslationServiceProvider"
```

This will create a new file in `config/lostintranslation.php`, where default values for your application can be set.

Extending
---------

[](#extending)

When a missing translation is found, the a `LostInTranslation\MissingTranslationFound` event will be dispatched. This event makes it easy to do something (send an email, open a GitHub issue, etc.)when a missing translation is encountered.

First, create a new event listener in your application; in this example, we're using `app/Listeners/NotifyOfMissingTranslation.php`:

```
