bes-translation
v1.1.4
Published
Updates, breakdown of methods and checking. Implementation was also revised. please see readme file
Downloads
20
Readme
Bes translation
Translation helper for bes
Getting Started
To use this package, run the command:
npm install bes-translation --saveUsage
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' });