fis3-parser-po

1.2.2 • Public • Published

fis3-parser-po

将po文件转为json,使用pofile进行转换

使用配置

fis.set('project.fileType.text', 'po');
 
// 处理语言文件*.po
fis.match('src/**.po', {
  rExt: 'json', // 如果module为true,则应该是js
  parser: fis.plugin('po', {}, {
    // confs
  })
});
 
// 默认配置,可以通过配置来调整生成的json的大小和格式
defConf = {
  // 配置po的全局属性
  global: {
    comments: false,
    headers: false
  },
  // 配置item
  item: {
    comments: true,
    msgstr: true,
    msgctxt: true,
    msgid_plural: false,
    references: false,
    comments: false,
    extractedComments: false,
    flags: false
  },
  // 格式
  format: {
    space: '  '
  },
  ext: {
    // 是否打包成模块
    module: true
  }
};

关于详细的配置属性请参考:pofile

Readme

Keywords

Package Sidebar

Install

npm i fis3-parser-po

Weekly Downloads

1

Version

1.2.2

License

MIT

Last publish

Collaborators

  • season.chen