@motorjs/plugin-i18n

3.3.3 • Public • Published

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 of malal
  • __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

Readme

Keywords

none

Package Sidebar

Install

npm i @motorjs/plugin-i18n

Weekly Downloads

1

Version

3.3.3

License

none

Unpacked Size

2.33 kB

Total Files

4

Last publish

Collaborators

  • mouafa
  • pierpaoloferraro
  • smartmohamed