|
| 1 | +import { bgRed, green, red, yellow } from 'kolorist'; |
| 2 | + |
| 3 | +export type Lang = 'zh-cn' | 'en-us'; |
| 4 | + |
| 5 | +export const locales = { |
| 6 | + 'zh-cn': { |
| 7 | + gitCommitMessages: { |
| 8 | + types: '请选择提交类型', |
| 9 | + scopes: '请选择提交范围', |
| 10 | + description: `请输入描述信息(${yellow('!')}开头表示破坏性改动` |
| 11 | + }, |
| 12 | + gitCommitTypes: [ |
| 13 | + ['feat', '新功能'], |
| 14 | + ['fix', '修复Bug'], |
| 15 | + ['docs', '只更新文档'], |
| 16 | + ['style', '修改代码风格,不影响代码含义的变更'], |
| 17 | + ['refactor', '代码重构,既不修复 bug 也不添加功能的代码变更'], |
| 18 | + ['perf', '可提高性能的代码更改'], |
| 19 | + ['optimize', '优化代码质量的代码更改'], |
| 20 | + ['test', '添加缺失的测试或更正现有测'], |
| 21 | + ['build', '影响构建系统或外部依赖项的更改'], |
| 22 | + ['ci', '对 CI 配置文件和脚本的更改'], |
| 23 | + ['chore', '没有修改src或测试文件的其他变更'], |
| 24 | + ['revert', '还原先前的提交'] |
| 25 | + ] as [string, string][], |
| 26 | + gitCommitScopes: [ |
| 27 | + ['projects', '项目'], |
| 28 | + ['packages', '包'], |
| 29 | + ['components', '组件'], |
| 30 | + ['hooks', '钩子函数'], |
| 31 | + ['utils', '工具函数'], |
| 32 | + ['types', 'TS类型声明'], |
| 33 | + ['styles', '代码风格'], |
| 34 | + ['deps', '项目依赖'], |
| 35 | + ['release', '发布项目新版本'], |
| 36 | + ['other', '其他的变更'] |
| 37 | + ] as [string, string][], |
| 38 | + gitCommitVerify: `${bgRed(' 错误 ')} ${red('git 提交信息必须符合 Conventional Commits 标准!')}\n\n${green( |
| 39 | + '推荐使用命令 `pnpm commit` 生成符合 Conventional Commits 标准的提交信息。\n获取有关 Conventional Commits 的更多信息,请访问此链接: https://conventionalcommits.org' |
| 40 | + )}` |
| 41 | + }, |
| 42 | + 'en-us': { |
| 43 | + gitCommitMessages: { |
| 44 | + types: 'Please select a type', |
| 45 | + scopes: 'Please select a scope', |
| 46 | + description: `Please enter a description (add prefix ${yellow('!')} to indicate breaking change)` |
| 47 | + }, |
| 48 | + gitCommitTypes: [ |
| 49 | + ['feat', 'A new feature'], |
| 50 | + ['fix', 'A bug fix'], |
| 51 | + ['docs', 'Documentation only changes'], |
| 52 | + ['style', 'Changes that do not affect the meaning of the code'], |
| 53 | + ['refactor', 'A code change that neither fixes a bug nor adds a feature'], |
| 54 | + ['perf', 'A code change that improves performance'], |
| 55 | + ['optimize', 'A code change that optimizes code quality'], |
| 56 | + ['test', 'Adding missing tests or correcting existing tests'], |
| 57 | + ['build', 'Changes that affect the build system or external dependencies'], |
| 58 | + ['ci', 'Changes to our CI configuration files and scripts'], |
| 59 | + ['chore', "Other changes that don't modify src or test files"], |
| 60 | + ['revert', 'Reverts a previous commit'] |
| 61 | + ] as [string, string][], |
| 62 | + gitCommitScopes: [ |
| 63 | + ['projects', 'project'], |
| 64 | + ['packages', 'packages'], |
| 65 | + ['components', 'components'], |
| 66 | + ['hooks', 'hook functions'], |
| 67 | + ['utils', 'utils functions'], |
| 68 | + ['types', 'TS declaration'], |
| 69 | + ['styles', 'style'], |
| 70 | + ['deps', 'project dependencies'], |
| 71 | + ['release', 'release project'], |
| 72 | + ['other', 'other changes'] |
| 73 | + ] as [string, string][], |
| 74 | + gitCommitVerify: `${bgRed(' ERROR ')} ${red('git commit message must match the Conventional Commits standard!')}\n\n${green( |
| 75 | + 'Recommended to use the command `pnpm commit` to generate Conventional Commits compliant commit information.\nGet more info about Conventional Commits, follow this link: https://conventionalcommits.org' |
| 76 | + )}` |
| 77 | + } |
| 78 | +} satisfies Record<Lang, Record<string, unknown>>; |
0 commit comments