Repository navigation
localTypePrefix指定時に翻訳キーがtylocalになりキー解決に失敗していた不具合を修正 - #5987
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughウォークスルーTrainTypeBoxのローカル翻訳キー生成ロジックを更新し、localTypePrefixに基づいてlocalKeyを計算して言語別翻訳キーを構築します。HeaderEast設定の翻訳カバレッジを検証するJestテストスイートを新規追加します。 変更内容ローカル翻訳キー生成と検証
推定レビュー工数🎯 2 (Simple) | ⏱️ ~12 分 詩
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
localTypePrefixを導入した際に翻訳キーの命名規則とずれが生じ、TrainTypeBoxがtylocal/tylocalEn/tylocalZh/tylocalKoという存在しないキーを参照していた不具合を修正します。翻訳キーはtyLocal/tyLocalEn/tyLocalZh/tyLocalKoのようにLocal部分が大文字始まりで登録されているため、プレフィックスが付与されるときだけキー側もLocalに切り替えるようにしました。あわせて、同種のずれを早期検出するための回帰防止ユニットテストを追加しています。変更の種類
変更内容
src/components/TrainTypeBox.tsxでlocalTypePrefixが非空のときにLocal、空のときにlocalを参照するヘルパーlocalKeyを追加し、localTypeTextおよびtrainTypeNameR/trainTypeNameZh/trainTypeNameKoの翻訳キー組み立てを${localTypePrefix}${localKey}...に置き換え。tyLocal系(プレフィックスあり)とlocal系(プレフィックスなし)の両方が正しく解決されるようになります。src/components/HeaderEast/config.test.tsを新規追加し、tokyoMetroConfigとtyConfigのlocalTypePrefixから導出される 4 種の翻訳キー({prefix}{Local|local}/...En/...Zh/...Ko)がja.jsonとen.jsonの双方に揃っていることを検証。今後新たなテーマでlocalTypePrefixを増やした際にも翻訳キー漏れを CI で検出できます。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
リリースノート
Tests
Bug Fixes