搜索

PythonReactSEOPDF
GitHub Skill

clean-translations

Remove unused translation keys from all translation files (en, he, sv, ja, es). This skill should be used when cleaning up translations, after removing features, or to reduce translation file size. Finds keys defined but never used via t() calls in the codebase.

ohadf2015☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Clean Translations

Remove unused translation keys from all language files in the project.

Execution Steps

When this skill is invoked, execute the following steps in order:

Step 1: Preview Changes (Dry Run)

Run the script in dry-run mode to see what would be removed:

node scripts/remove-unused-translations.js --dry-run

Review the output and report the number of unused keys found by namespace.

Step 2: Apply Changes

If the dry run looks correct, apply the changes:

node scripts/remove-unused-translations.js
Step 3: Verify Build

Run the build to ensure no required translations were removed:

npm run build

If the build fails due to missing translations, restore them from git and update the script's ALWAYS_KEEP list.

Step 4: Run Lint

Check for any linting issues:

npm run lint
Step 5: Validate with /complete-translation

After cleaning, invoke the /complete-translation skill to:

  • Validate that all languages have consistent keys
  • Fill any missing translations across language files

Important Notes

  • The script preserves keys in the seo.* namespace (used in metadata)
  • Keys accessed via optional chaining (e.g., translations[lang]?.joinView?.defaultPlayerNames) are in the ALWAYS_KEEP list
  • Dynamic key patterns (achievements, difficulty, etc.) are automatically preserved
  • A report of removed keys is saved to unused-translations-report.txt

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!