Laravel Translations Loader

Laravel Translations Loader

Laravel Translations Loader is a webpack loader to import your Laravel translation files (PHP or JSON) by Luís Dalmolin and Kirschbaum Development Group.

You install this package as an NPM dependency with NPM or Yarn:

npm install @kirschbaum-development/laravel-translations-loader --save-dev

# Or...

yarn add @kirschbaum-development/laravel-translations-loader --dev

Kirschbaum also has a demo project you can reference to see how it works. Here’s an example of how it works from the demo project’s ExampleComponent component:

    <div class="container">
        <p><strong>Translation for "auth.php" (PHP file):</strong><br>
        {{ $t('auth.failed') }}</p>

        <p><strong>Translation for "Hello World" (JSON file):</strong><br>
        {{ $t('Hello World') }}</p>

And here’s an example of how you might use this package with vue-i18n:

import languageBundle from '@kirschbaum-development/laravel-translations-loader!@kirschbaum-development/laravel-translations-loader';
import VueI18n from 'vue-i18n';

const i18n = new VueI18n({
    locale: window.Locale,
    messages: languageBundle,

To learn more about this project, installation, and usage instructions, check out the project’s GitHub repo: laravel-translations-loader. The readme also has useful packages you can use with the Laravel Translations Loader project if you’re using React, Vue, and i18next in your projects with this package.

Filed in: News / Translations


Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Software Engineer Lead (PHP)
CivicPlus, LLC
Full-time Senior Web Developer
Detroit, MI
Wayne State University
Senior Software Engineer
Sydney, Australia
Full Stack Engineer
Remote or Medford, Oregon
Empire Medical
Laravel Developer (fulltime - Dutch only)
Qbixx | Webservices
Full Stack or Back-End Developer
Alexandria, VA; Tallahassee, FL; Orlando, FL
Marketing for Change
Senior Quality Assurance Engineer
Bisnow Media