@fe9527/i18n-helper
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

i18n-helper

install

npm i i18n-helper -D
npm i esno -D # 用于执行 esm 模块

功能

i18nDownload

下载国际化平台的翻译文件

usage

创建一个 js 文件,参考下边的代码

// 以 Myaccount 项目为例
import path from 'node:path'
import { i18nDownload } from '@fe9527/i18n-helper'

// 第一个参数为项目名称(在国际化平台中的名称),第二个参数为翻译文件存放路径
i18nDownload('Myaccount', path.join(__dirname, '../src/locales/lang/json'))

在 package.json 中添加一个 script,执行这个 js 文件

{
  "scripts": {
    "gen:i18n": "esno ./scripts/i18n.js"
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @fe9527/i18n-helper

Weekly Downloads

11

Version

1.1.0

License

MIT

Unpacked Size

7.51 kB

Total Files

6

Last publish

Collaborators

  • liuyan12621
  • vita.hsieh
  • hanhui