ziey-i18n-loader

0.7.1 • Public • Published

ziey-i18n-loader

NPM version

NPM

webpack i18n loader

Install

npm install ziey-i18n-loader

Usage

const ZieyI18nLoaderPlugin = require('ziey-i18n-loader/plugin');
module.exports = {
    plugins: [
        new ZieyI18nLoaderPlugin() # 加上这个插件
    ],
    module: {
        rules: [
            { # 配置要翻译的文本和参数
                test   : /\.(js|html)$/i,
                loader : "ziey-i18n?lang=<lang>&path=<path_to_po>&clean=0&openTag=<<&closeTag=}}",
            }
        ]
    }
}

params

param desc
lang language
path path to po file
clean need to clean useless msgid & result ? default = 1
openTag default = '{#'
closeTag default = '#}'

JSON encode

    '{# "hello" #}' ==> "hello"
    '{# JSON# "hello" #}' ==> \"hello\"
    '{# json# "hello" #}' ==> \"hello\"

Readme

Keywords

Package Sidebar

Install

npm i ziey-i18n-loader

Weekly Downloads

10

Version

0.7.1

License

GPL

Unpacked Size

11.1 kB

Total Files

8

Last publish

Collaborators

  • zemzheng