Back to Skills

compare-i18n-keys

majiayu000
Updated 2 days ago
58
9
58
View on GitHub
Developmentgeneral

About

This skill compares i18n translation keys between legacy Angular translate pipes and modern Transloco t() functions during migration projects. It extracts keys from source files using pattern matching and helps synchronize them to target files. Use it when migrating i18n systems or when developers need to compare/fix translation keys between codebases.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/compare-i18n-keys

Copy and paste this command in Claude Code to install this skill

Documentation

Compare translation keys between legacy Angular translate pipe and new Transloco t() function, then fix the new project.

Arguments

  • $ARGUMENTS - Format: --from <source_path> --to <target_path>
    • --from: Source HTML file in old project
    • --to: Target HTML file in new project

Process

Step 1: Extract Keys from Source (Legacy Angular)

Read the source file and extract translation keys using these patterns:

Pattern 1: Basic translate pipe

{{ 'key' | translate }}

Pattern 2: Translate pipe with parameters

{{ 'key' | translate: { param: value } }}

Pattern 3: Translate in attribute

placeholder="{{ 'key' | translate }}"
label="{{ 'key' | translate }}"
matTooltip="{{ 'key' | translate }}"

Step 2: Extract Keys from Target (Transloco)

Read the target file and extract translation keys using these patterns:

Pattern 1: Basic t() function

{{ t('key') }}
t('key')

Pattern 2: t() in attribute binding

[label]="t('key')"
[placeholder]="t('key')"
[matTooltip]="t('key')"

Step 3: Compare and Generate Report

Create a comparison report with:

CategoryDescription
OKKey matches exactly
DIFFERENTKey exists but different (may be intentional)
MISSINGSource key not found in target
EXTRATarget key not in source (informational)

Step 4: Output Report

# i18n Key Comparison Report

**Source:** {from_path}
**Target:** {to_path}

## Summary

| Category | Count |
|----------|-------|
| Matching Keys | X |
| Different Keys | Y |
| Missing Keys | Z |

**Match Rate: XX%**

## Missing Keys (Need Fix)

| Source Key | Context |
|------------|---------|
| `key.name` | Where it's used |

## Different Keys (Review)

| Source Key | Target Key |
|------------|------------|
| `old.key` | `new.key` |

Step 5: Apply Fixes

If user confirms, fix the target file by replacing incorrect keys with correct ones from source.

Usage

/compare-i18n-keys --from=/path/to/legacy/component.html --to=/path/to/new/component.html

GitHub Repository

majiayu000/claude-skill-registry
Path: skills/compare-i18n-keys

Related Skills

algorithmic-art

Meta

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

View skill

subagent-driven-development

Development

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

View skill

executing-plans

Design

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

View skill

cost-optimization

Other

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

View skill