Skip to content

Commit

Permalink
✨ feat: 支持省略扩展名的导入和index的导入
Browse files Browse the repository at this point in the history
  • Loading branch information
hmydgz committed Aug 26, 2023
1 parent 8c38c6d commit af134df
Show file tree
Hide file tree
Showing 12 changed files with 196 additions and 117 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/test.action.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

English | [简体中文](./README.zh_CN.md)

[![npm](https://img.shields.io/npm/v/i18n-check-keys.svg)](https://github.com/heimeiyaodagongzai/i18n-check-keys) [![build status](https://github.com/heimeiyaodagongzai/i18n-check-keys/actions/workflows/build.action.yml/badge.svg?branch=main)](https://github.com/heimeiyaodagongzai/i18n-check-keys/actions)
[![npm](https://img.shields.io/npm/v/i18n-check-keys.svg)](https://github.com/hmydgz/i18n-check-keys)
[![npm](https://img.shields.io/npm/dt/i18n-check-keys.svg)](https://github.com/hmydgz/i18n-check-keys)
[![build status](https://github.com/hmydgz/i18n-check-keys/actions/workflows/build.action.yml/badge.svg?branch=main)](https://github.com/hmydgz/i18n-check-keys/actions)


A tool to check for missing internationalization keys in a project
Expand Down
4 changes: 3 additions & 1 deletion README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

[English](./README.md) | 简体中文

[![npm](https://img.shields.io/npm/v/i18n-check-keys.svg)](https://github.com/heimeiyaodagongzai/i18n-check-keys) [![build status](https://github.com/heimeiyaodagongzai/i18n-check-keys/actions/workflows/build.action.yml/badge.svg?branch=main)](https://github.com/heimeiyaodagongzai/i18n-check-keys/actions)
[![npm](https://img.shields.io/npm/v/i18n-check-keys.svg)](https://github.com/hmydgz/i18n-check-keys)
[![npm](https://img.shields.io/npm/dt/i18n-check-keys.svg)](https://github.com/hmydgz/i18n-check-keys)
[![build status](https://github.com/hmydgz/i18n-check-keys/actions/workflows/build.action.yml/badge.svg?branch=main)](https://github.com/hmydgz/i18n-check-keys/actions)

用于检查项目中的国际化 key 是否存在遗漏的工具

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "i18n-check-keys",
"version": "0.1.10",
"version": "0.1.11",
"description": "A tool to check for missing internationalization keys in a project",
"files": [
"dist"
Expand All @@ -21,7 +21,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/heimeiyaodagongzai/i18n-check-keys"
"url": "https://github.com/hmydgz/i18n-check-keys"
},
"keywords": [
"i18n",
Expand All @@ -31,6 +31,7 @@
"author": "",
"scripts": {
"test": "node test/index.esm.mjs",
"bt": "tsc --declaration && rollup -c && node test/index.esm.mjs",
"testCjs": "node test/index.cjs",
"build": "tsc --declaration && rollup -c"
},
Expand Down
23 changes: 23 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* ISO 6391 + 国家地区 语言代码集合,去掉横杠和下划线方便匹配
*/
export const LanCodeSet = new Set([
'af', 'sq', 'am', 'ar', 'hy', 'az', 'eu', 'be', 'bn', 'bs', 'bg', 'ca', 'ceb', 'zh', 'hr', 'cs',
'da', 'nl', 'en', 'eo', 'et', 'fi', 'fr', 'gl', 'ka', 'de', 'el', 'gu', 'ht', 'ha', 'haw', 'iw',
'hi', 'hmn', 'hu', 'is', 'ig', 'id', 'ga', 'it', 'ja', 'jw', 'kn', 'kk', 'km', 'rw', 'ko', 'ku',
'ky', 'lo', 'la', 'lv', 'lt', 'lb', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mn', 'my', 'ne',
'no', 'ny', 'ps', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sm', 'gd', 'sr', 'st', 'sn', 'sd', 'si',
'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tl', 'tg', 'ta', 'tt', 'te', 'th', 'tr', 'tk', 'uk',
'ur', 'ug', 'uz', 'vi', 'cy', 'xh', 'yi', 'yo', 'zu',

'enus', 'engb', 'eses', 'esmx', 'frfr', 'frca', 'dede', 'deat', 'itit', 'itch', 'zhcn', 'zhtw',
'jajp', 'kokr', 'ruru', 'arsa', 'ptpt', 'ptbr', 'nlnl', 'nlbe', 'svse', 'dadk', 'nono', 'fifi',
'plpl', 'trtr', 'elgr', 'huhu', 'cscz', 'sksk', 'roro', 'bgbg', 'ukua', 'hrhr', 'slsi', 'etee',
'lvlv', 'ltlt', 'srrs', 'mkmk', 'sqal', 'bsba', 'hyam', 'kage', 'azaz', 'kkkz', 'uzuz', 'mnmn',
'vivn', 'thth', 'msmy', 'tlph', 'jajp', 'kokr', 'bnbd', 'nenp', 'hiin', 'tain', 'urpk', 'fair',
'trtr', 'heil', 'arsa', 'esar', 'ptbr', 'escl', 'esco', 'espe', 'esve', 'esdo', 'espa', 'esec',
'esbo', 'espy', 'eshn', 'essv', 'esni', 'escr', 'esgt', 'espr', 'esus', 'zhhk', 'zhmo', 'zhsg', 'zhmy',

'zhhans',
'zhhant',
])
Loading

0 comments on commit af134df

Please sign in to comment.