1.1.4 • Published 6 years ago

bes-translation v1.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Bes translation

Translation helper for bes


Getting Started

To use this package, run the command:

npm install bes-translation --save

Usage

trans(string, optional-object);

To use:

Copy the example in .env.example then create a .env file and update your configuration for translation.

Example:

resources/lang/en/content.js

The LOCALE_PATH is resources/lang The LOCALE is en

In your content.js

module.exports = {
    welcome: {
        text: Hello! :name
    }
};

Using trans

ES5

var trans = require('bes-translation').trans;

trans('filename.property', { key: 'value' });

ES6

import { trans } from 'bes-translation'

trans('filename.property', { key: 'value' })

Example:

trans('content.welcome.text', { name: 'Leuther King Mojica' });

Voila!

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago