0.7.1 • Published 4 years ago

ziey-i18n-loader v0.7.1

Weekly downloads
3
License
GPL
Repository
github
Last release
4 years ago

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

paramdesc
langlanguage
pathpath to po file
cleanneed to clean useless msgid & result ? default = 1
openTagdefault = '{#'
closeTagdefault = '#}'

JSON encode

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

4 years ago

0.7.0

4 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.9

8 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.0

9 years ago