Agent SkillsHiEventsDev/Hi.Events › translations

translations

GitHub

提供基于Lingui的前端多语言翻译工作流,涵盖字符串提取、添加翻译、编译及验证步骤,支持多种语言并附带故障排除指南。

.agents/skills/translations/SKILL.md HiEventsDev/Hi.Events

触发场景

需要为前端功能添加新翻译字符串 检查或更新现有翻译文件 编译翻译资源以进行生产部署

安装

npx skills add HiEventsDev/Hi.Events --skill translations -g -y
更多选项

非标准路径

npx skills add https://github.com/HiEventsDev/Hi.Events/tree/develop/.agents/skills/translations -g -y

不安装直接使用

npx skills use HiEventsDev/Hi.Events@translations

指定 Agent (Claude Code)

npx skills add HiEventsDev/Hi.Events --skill translations -a claude-code -g -y

安装 repo 全部 skill

npx skills add HiEventsDev/Hi.Events --all -g -y

预览 repo 内 skill

npx skills add HiEventsDev/Hi.Events --list

SKILL.md

Frontmatter
{
    "name": "translations",
    "description": "Frontend translation workflow using Lingui - extracting, adding, and compiling translations for all supported languages"
}

Frontend Translation Workflow (Lingui)

IMPORTANT: Always update translations as you develop features. When adding new translatable strings, immediately add translations for all supported languages.

Core Commands

cd frontend

# Extract translatable strings (use --clean for accurate counts)
yarn messages:extract --clean

# Compile translations for production
yarn messages:compile

# Check for untranslated strings
cd scripts && ./list_untranslated_strings.sh

Process

  1. Extract: yarn messages:extract --clean
  2. Check: Look at the output table for missing translation counts
  3. Add translations: Update the .po files for each language
  4. Verify: Run extract again to confirm 0 missing
  5. Compile: yarn messages:compile

Adding Translations

Add entries to each locale's .po file in frontend/src/locales/:

#: src/path/to/component.tsx:123
msgid "Your English String"
msgstr "Translated String"

Supported Languages

Code Language
en English (source - no translation needed)
de Deutsch
es Espanol
fr Francais
pt Portugues
pt-br Portugues do Brasil
it Italiano
nl Nederlands
zh-cn Simplified Chinese
zh-hk Traditional Chinese (HK)
vi Tieng Viet
ru Russian (currently untranslated)

Troubleshooting

  • Counts seem wrong: Use --clean flag to remove obsolete entries
  • Translation not appearing: Run yarn messages:compile after adding
  • Syntax errors: Check for proper escaping of quotes in .po files

版本历史

  • 8d020d5 当前 2026-08-16 08:57

同 Skill 集合

.claude/skills/translations/SKILL.md

元信息

文件数
0
版本
fc6481b
Hash
c9e6337b
收录时间
2026-08-16 08:57

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 11:24
浙ICP备14020137号-1 $访客地图$