@motorjs/plugin-i18n
v3.3.3
Published
motor plugin i18n
Downloads
7
Readme
Motor plugin-html
Installation
using yarn
yarn add @motorjs/plugin-html
using npm
npm i -S @motorjs/plugin-html
Usage
const motor = require('@motorjs/engine')
const I18n = require('@motorjs/plugin-i18n')
const motorConfig = {
templatesDir : path.resolve('templates'),
outputDir : path.resolve('output'),
viewsDir : path.resolve('views'),
plugins: [
new I18n({
translations: {
en: require('./i18n/en.json'),
de: require('./i18n/de.json')
}
}),
// other plugins
]
}
motor(motorConfig)
this plugin will add __
and __l
to the context of the page
__
is an alias ofmalal
__l
is used to change the link path according to the current page language and country
// lang >> en
// country >> gb
__l('/de-de/shop') // >> /en-gb/shop