Need private packages and team management tools?Check out npm Teams »

locale-import-middleware

1.0.3-rc01 • Public • Published

kol-locale-middleware

将国际化文案按照不同的环境添加到handlebars模板中:

  • development:将对应的国际化文案直接添加到handlebars中
  • production:将对应的国际化文案以js的方式引入到handlebars中

Getting Started

To begin, you'll need to install kol-locale-middleware:

first, you need to add dependencies like this:

{
  "dependencies": {
    "@noxfed/kol-locale-middleware": "git+http://10.8.1.200:88/NoxFED/kol-locale-middleware.git"
  }
}
 

second, use npm install all packages

$ npm install

Then add the loader to your express config. For example:

server.js

const express = require("express");
 
const app = express();
app.use(
  require("@noxfed/express-manifest")({
    file: {}
    locale: "locale",
    mount: "LANG_SCRIPT",
  })
);
 

Options

所有属性均为必填项

Name Type Default Description
file Object null 国际化数据对象
locale String null 当前语言获取位置
mount String null 模板数据挂载位置

locale、mount均为express中res下的位置

Keywords

Install

npm i locale-import-middleware

DownloadsWeekly Downloads

0

Version

1.0.3-rc01

License

MIT

Unpacked Size

3.52 kB

Total Files

4

Last publish

Collaborators

  • avatar