PHPackages                             rogervila/laravel-csv-translations - 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. rogervila/laravel-csv-translations

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

rogervila/laravel-csv-translations
==================================

Load Laravel localizations from a CSV File

2.3.0(2y ago)34.3k[1 PRs](https://github.com/rogervila/laravel-csv-translations/pulls)MITPHPCI passing

Since Mar 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rogervila/laravel-csv-translations)[ Packagist](https://packagist.org/packages/rogervila/laravel-csv-translations)[ RSS](/packages/rogervila-laravel-csv-translations/feed)WikiDiscussions main Synced today

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

[![Laravel CSV Translations](https://camo.githubusercontent.com/6294aff8d1a1ef5fe9b87b03bd079847b6b50396d8f159dc279271622d0c68cc/68747470733a2f2f692e6962622e636f2f566d5a5953534d2f6373762e706e67)](https://camo.githubusercontent.com/6294aff8d1a1ef5fe9b87b03bd079847b6b50396d8f159dc279271622d0c68cc/68747470733a2f2f692e6962622e636f2f566d5a5953534d2f6373762e706e67)

[![Build Status](https://github.com/rogervila/laravel-csv-translations/workflows/build/badge.svg)](https://github.com/rogervila/laravel-csv-translations/actions)[![StyleCI](https://camo.githubusercontent.com/dfc738ca9311e674ba3df904cc7abda1694768828c41a4a78608e2ac75428a62/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231313635373132312f736869656c643f6272616e63683d6d61696e)](https://github.styleci.io/repos/211657121)[![Quality Gate Status](https://camo.githubusercontent.com/0b2ecb7ad3c50cc588d3dba67cd7adf802dabfa33170f76ca0ed6998c98a39a7/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d726f67657276696c615f6c61726176656c2d6373762d7472616e736c6174696f6e73266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=rogervila_laravel-csv-translations)

[![Latest Stable Version](https://camo.githubusercontent.com/db3f893daefbdfaf760d98c2eb9e6bcc853d84f915f67d119b346204e7f16efe/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d6373762d7472616e736c6174696f6e732f762f737461626c65)](https://packagist.org/packages/rogervila/laravel-csv-translations)[![Total Downloads](https://camo.githubusercontent.com/6087fe04696215a6e063939c81762ca77f18265ae3e137d0028bf92303c6793f/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d6373762d7472616e736c6174696f6e732f646f776e6c6f616473)](https://packagist.org/packages/rogervila/laravel-csv-translations)[![License](https://camo.githubusercontent.com/29cd61c8dfeeb346c52af944e7f98a34a2aedd08fbd25322a2ac9849de9aaf74/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d6373762d7472616e736c6174696f6e732f6c6963656e7365)](https://packagist.org/packages/rogervila/laravel-csv-translations)

Laravel CSV Translations
========================

[](#laravel-csv-translations)

Load Laravel localizations from a CSV File

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

[](#installation)

```
composer require rogervila/laravel-csv-translations
```

To use Laravel CSV Translations you will have to **replace the Laravel TranslationServiceProvider with the package one**.

```
// config/app.php
'providers' => [
    // ...
    // Illuminate\Translation\TranslationServiceProvider::class,
    LaravelCSVTranslations\TranslationServiceProvider::class,
    // ...
],
```

If your project uses `Illuminate\Support\ServiceProvider`, replace it via the `replace` method.

```
// config/app.php
'providers' => ServiceProvider::defaultProviders()
    ->replace([
        \Illuminate\Translation\TranslationServiceProvider::class => \LaravelCSVTranslations\TranslationServiceProvider::class,
    ])->merge([
        // ...
    ])->toArray(),
```

To make it work without modifying any configuration, **Create a `lang.csv` file placed in the `lang` folder**.

Translations will be loaded from the CSV file if it exists. Otherwise, Laravel's built-in translation system will handle them.

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

[](#configuration)

The package allows configuring some of its features.

**There is no config file published by the package**. You might create it to override the package defaults:

```
