0.1.12 • Published 9 months ago

i18n-check-keys v0.1.12

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

i18n-check-keys

English | 简体中文

npm npm build status

A tool to check for missing internationalization keys in a project

webpack plugin: i18n-check-keys-webpack-plugin vite plugin: vite-plugin-i18n-check-keys

npm.io

Automatically checks for supported path forms

│ locales
│  ├─en
│  │  └ index.js
│  └─zh_CN
│     └ index.js
│ locales
│  ├─en.js
│  └─zh_CN.js
├─dir1
│  └─locale
|    ├─en.js
|    └─zh_CN.js
├─dir2
│  └─locale
|    ├─en.js
|    └─zh_CN.js

Install

npm i i18n-check-keys -D
# or
yarn add i18n-check-keys -D
# or
pnpm add i18n-check-keys -D

Usage

const { checkI18nKeys } = require('i18n-check-keys');

checkI18nKeys({
  localePath: /locale/,
  benchmarkLang: 'en',
}).run()

Methods

checkI18nKeys(options)

Options

PropertyDescriptionTypeDefault
localePathlanguage pack pathRegExp/locale/
benchmarkLangbase languagestring'en'
languagesThe language to check, an empty array is all files in the checked directorystring[][]
fileTypefile typestring | string[] | RegExp'js'
needStopRunWhether to stop the process when missing is detectedbooleanfalse

Returns

PropertyDescriptionType
runRun check, the parameter is the starting path, the default is the running path(_path = process.cwd()) => void
0.1.12

9 months ago

0.1.10

9 months ago

0.1.11

9 months ago

0.1.9

11 months ago

0.1.9-alpha.1

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.7-alpha.3

11 months ago

0.1.7-alpha.2

11 months ago

0.1.7-alpha.1

11 months ago

0.1.6

11 months ago

0.1.6-alpha.2

11 months ago

0.1.6-alpha.1

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

12 months ago

0.1.0

12 months ago