Skip to content
Back to skills

Compare I18n Keys

ASecurity

Compare translation keys between legacy Angular translate pipe and new Transloco t() function. Use when migrating i18n keys from old codebase to new codebase, or when the user asks to compare/fix translation keys.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
developmentgobashangular

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill compare-i18n-keys --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compare I18n Keys?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compare I18n Keys
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-compare-i18n-keys/badge)](https://www.skillsdirectory.com/skills/majiayu000-compare-i18n-keys)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: compare-i18n-keys
description: Compare translation keys between legacy Angular translate pipe and new Transloco t() function. Use when migrating i18n keys from old codebase to new codebase, or when the user asks to compare/fix translation keys.
---

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:

| Category | Description |
|----------|-------------|
| **OK** | Key matches exactly |
| **DIFFERENT** | Key exists but different (may be intentional) |
| **MISSING** | Source key not found in target |
| **EXTRA** | Target key not in source (informational) |

### Step 4: Output Report

```markdown
# 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

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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.