laravel-localization

0.0.3 • Public • Published

laravel-localization

Adaptation of the Laravel JS localization module implemented by andywer to be used as a module.

The advantage of using this module is that you can combine it with this babel plugin. The plugin will detect usages of this module in the JavaScript and build a JSON file containing the localization keys, which can be used later to generate the data to be sent to the browser.

Installation

npm install laravel-localization

Usage

import Lang from 'laravel-localization';

Lang.addMessages({
    'en': {
        'message key': 'translated message'
    }
});

Lang.setLocale('en');

console.log(Lang.get('message key')); // translated message

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i laravel-localization

    Weekly Downloads

    4

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • thiagorb