NaiveTab Add i18n Locale
SkillWeb & browsingi18n internationalization development guide for the NaiveTab browser extension. Use when users need to add/modify translation texts or add multilingual keys. Covers rules for keeping Chinese and English in sync, variable substitution patterns, and more, to prevent omissions or formatting errors.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the NaiveTab Add i18n Locale skill
What this skill tells your AI
The instructions your AI receives, as published by gxfg/newtab-naivetab in .claude/skills/add-i18n-locale/SKILL.md and read by ahel’s review.
新增或修改 i18n 翻译文本需遵守以下规则。
文件位置
- 中文:
src/locales/zh-CN.json - 英文:
src/locales/en-US.json
两个文件必须同步更新,不能只改一个。
Key 命名规范
采用扁平嵌套结构,按功能分组:
{
"common": {
"save": "保存",
"cancel": "取消"
},
"setting": {
"group": {
"myPane": "我的面板"
}
}
}
引用方式:window.$t('common.save') 或模板中 $t('setting.group.myPane')。
变量替换
使用 __key__ 占位符 + .replace() 方式,禁止使用 vue-i18n 默认的 {key} 语法:
<!-- 正确 -->
{{ $t('key.xxx').replace('__n__', value) }}
<!-- 错误 -->
{{ $t('key.xxx', { n: value }) }}
// 正确
window.$t('key.xxx').replace('__count__', String(count))
覆盖范围
所有面向用户的文本都必须 i18n,包括但不限于:
- Dialog 的
title/content/positiveText/negativeText showToast/$notification文案placeholder、按钮文案- Setting 面板的
labelKey
注意事项
- 写代码时先想 i18n key,再写实现
- 不要因为"只是 dialog 文案"就跳过 i18n
- 完整规则见 no-hardcode.md
Signals
- GitHub stars
- 129
- Forks
- 11
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
add-i18n-locale- Source
- github.com/gxfg/newtab-naivetab