|
| 1 | +--- |
| 2 | +name: prh-terminology |
| 3 | +description: "Manage the translation terminology dictionary prh.yml for consistent Angular-ja documentation. Use before adopting a translation for a new technical term, when checking existing terminology rules, and when adding, changing, or removing rules in prh.yml." |
| 4 | +--- |
| 5 | + |
| 6 | +# prh-terminology: Terminology dictionary management |
| 7 | + |
| 8 | +Maintain the Angular-ja project's translation terminology dictionary in `prh.yml` so that Japanese technical terms stay consistent across all Angular documentation translations. |
| 9 | + |
| 10 | +**Rule**: Never guess terminology. Check `prh.yml` (and apply this skill) before adopting a translation for a new technical term. Typical moments: |
| 11 | + |
| 12 | +- Before any translation work: check the existing rules for the terms in the file. |
| 13 | +- For a new technical term: decide a consistent Japanese form. |
| 14 | +- For katakana standardization: verify long vowel marks and spelling. |
| 15 | +- After translating: add rules so the chosen form is enforced project-wide. |
| 16 | + |
| 17 | +## prh.yml structure overview |
| 18 | + |
| 19 | +The `prh.yml` file uses the prh (Proofreading Helper) format to enforce consistent terminology: |
| 20 | + |
| 21 | +```yaml |
| 22 | +version: 1 |
| 23 | +imports: |
| 24 | + - path: ./node_modules/prh/prh-rules/files/markdown.yml |
| 25 | +rules: |
| 26 | + - expected: 正しい表記 # Preferred term |
| 27 | + pattern: # Terms to replace |
| 28 | + - 間違った表記1 |
| 29 | + - 間違った表記2 |
| 30 | + options: # Optional settings |
| 31 | + wordBoundary: true # Match whole words only |
| 32 | +``` |
| 33 | +
|
| 34 | +## Rule categories |
| 35 | +
|
| 36 | +### 1. 言い換え (Paraphrasing rules) |
| 37 | +
|
| 38 | +Standardizes Japanese technical expressions. |
| 39 | +
|
| 40 | +- "依存性の注入" (preferred) vs "依存関係の注入" (to replace) |
| 41 | +- "変更検知" (preferred) vs "変更検出" (to replace) |
| 42 | +
|
| 43 | +### 2. カタカナ語 (Katakana rules) |
| 44 | +
|
| 45 | +Enforces consistent katakana spelling and English preservation. |
| 46 | +
|
| 47 | +- **Long vowel consistency**: "サーバー" not "サーバ" |
| 48 | +- **English preservation**: "Promise" not "プロミス" |
| 49 | +- **Regex patterns**: `/pattern(?!suffix)/` to match specific cases |
| 50 | + |
| 51 | +## How to add or modify rules |
| 52 | + |
| 53 | +### Simple paraphrasing rule |
| 54 | + |
| 55 | +```yaml |
| 56 | +- expected: 推奨される表記 |
| 57 | + pattern: |
| 58 | + - 置き換える表記1 |
| 59 | + - 置き換える表記2 |
| 60 | +``` |
| 61 | + |
| 62 | +### Katakana consistency rule |
| 63 | + |
| 64 | +```yaml |
| 65 | +- expected: サーバー |
| 66 | + pattern: /サーバ(?!ー)/ # Matches "サーバ" not followed by "ー" |
| 67 | +``` |
| 68 | + |
| 69 | +### English preservation rule |
| 70 | + |
| 71 | +```yaml |
| 72 | +- expected: Promise |
| 73 | + pattern: プロミス |
| 74 | +``` |
| 75 | + |
| 76 | +### Complex regex rule |
| 77 | + |
| 78 | +```yaml |
| 79 | +- expected: ため |
| 80 | + pattern: /(行|作)?為(?!替)/ |
| 81 | + regexpMustEmpty: $1 # Captured group must be empty |
| 82 | +``` |
| 83 | + |
| 84 | +### Word boundary rule |
| 85 | + |
| 86 | +```yaml |
| 87 | +- expected: Service Worker |
| 88 | + pattern: |
| 89 | + - サービスワーカー |
| 90 | + options: |
| 91 | + wordBoundary: true # Match whole words only |
| 92 | +``` |
| 93 | + |
| 94 | +## Management procedures |
| 95 | + |
| 96 | +### Add a new rule |
| 97 | + |
| 98 | +1. **Identify category**: paraphrasing or katakana. |
| 99 | +2. **Determine the preferred form**: based on project standards. |
| 100 | +3. **List incorrect forms**: common variations to replace. |
| 101 | +4. **Add appropriate options**: `wordBoundary`, regex patterns. |
| 102 | + |
| 103 | +### Modify an existing rule |
| 104 | + |
| 105 | +1. **Locate the existing rule**: search by expected term. |
| 106 | +2. **Update patterns**: add or remove incorrect forms. |
| 107 | +3. **Adjust options**: modify regex or boundary settings. |
| 108 | +4. **Test impact**: consider existing translations. |
| 109 | + |
| 110 | +### Remove a rule |
| 111 | + |
| 112 | +1. **Verify necessity**: confirm the rule is no longer needed. |
| 113 | +2. **Check dependencies**: ensure no conflicts with existing translations. |
| 114 | +3. **Document the reason**: give a clear justification for the removal. |
| 115 | + |
| 116 | +## Angular-specific terminology guidelines |
| 117 | + |
| 118 | +### Technical terms (keep in English) |
| 119 | + |
| 120 | +- Component, Directive, Service, Pipe |
| 121 | +- Promise, Observable, Signal |
| 122 | +- Router, Guard, Resolver |
| 123 | + |
| 124 | +### Japanese translations (standardize) |
| 125 | + |
| 126 | +- "依存性の注入" for Dependency Injection |
| 127 | +- "変更検知" for Change Detection |
| 128 | +- "遅延読み込み" for Lazy Loading |
| 129 | + |
| 130 | +### Katakana consistency |
| 131 | + |
| 132 | +- Long vowel marks: アプリケーション, サーバー, ユーザー |
| 133 | +- Short forms: ブラウザ (not ブラウザー) |
| 134 | + |
| 135 | +## Validation process |
| 136 | + |
| 137 | +After modifying `prh.yml`: |
| 138 | + |
| 139 | +1. **Test with prh**: verify the syntax is valid. |
| 140 | +2. **Run textlint** (`pnpm lint`): check integration with linting. |
| 141 | +3. **Test on sample files**: verify the rules work correctly. |
| 142 | +4. **Document changes**: update the rule rationale. |
| 143 | + |
| 144 | +## Best practices |
| 145 | + |
| 146 | +1. **Consistency first**: align with existing project terminology. |
| 147 | +2. **Community input**: consider Angular-ja community preferences. |
| 148 | +3. **Technical accuracy**: maintain precision in technical terms. |
| 149 | +4. **Readability**: balance consistency with natural Japanese. |
| 150 | +5. **Incremental changes**: add rules gradually to avoid disruption. |
| 151 | + |
| 152 | +Always test rule changes against existing translations to ensure they improve consistency without introducing errors. |
0 commit comments