fix(i18n): 値が英語のまま残る未翻訳ブロックを非enページで描画しない - #23
Open
appdevelopsk wants to merge 1 commit into
Open
Conversation
英語露出には2機構ある。機構1(ロケール側にキーが無く en から埋まる)は PR #22 で塞いだが、機構2(キーは在るが値が en と同一 = 未翻訳)は __enFallback がキー単位のため原理的に検出できず残っていた。 実測(2026-09-10): offerNotes 1,558 / methodology 67 の記事×ロケールで en と同一の値が入っており、ビルド出力で index 対象 118ページに 英語が可視で出ていた。 対応: - loadArticleContent が __enFallback に「値が en と同一」も載せる。 dict は `offerNotes.<offerId>`、配列は `recommendedFor.<offerId>` の形で 要素単位。offerNotes/recommendedFor は要素ごとに独立した一文なので、 未翻訳の要素だけ落として翻訳済みは残す(記事ごと捨てない)。 - recommendedFor は label だけ英語で reason は訳済み、という部分翻訳が 4記事×7ロケールで実在したため、フィールド単位で判定する。 - check-built-output.mjs に出力側ゲートを追加。en ソースの40字以上の 文字列を非enの index 対象ページの可視テキストと突き合わせる。 キー名を列挙する方式は「次のキー」に効かないため、出力で見る。 検証(ローカル全ビルド 13,994ページ): - ゲート 118件 → 0件。canonical/index health は無変更で通過。 - de/best-bikini-2026 は英語のまま2件が消え、訳済み3件は残存。 - de/best-turkish-coffee-maker は "Kupfer" 等の独語本文を保持。 - en ページは無変更。 Claude-Session: https://claude.ai/code/session_01D41rnpZ7nmdkNHNJgWn2wp
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.
背景
英語露出には2機構ある([memory: 英語露出は「キー欠落」と「値が英語」の2機構])。
__enFallbackがキー単位のため原理的に検出できず、残っていた実測
ソース側で en と同一の値が入っているのは offerNotes 1,558 / methodology 67(記事×ロケール)。
ビルド出力ゲートで index 対象 118ページに英語が可視で出ていた。
対応
loadArticleContentが__enFallbackに「値が en と同一」も載せる。キー単位でなく要素単位(dict は
offerNotes.<offerId>、配列はrecommendedFor.<offerId>)。offerNotes / recommendedFor は要素ごとに独立した一文なので、未翻訳の要素だけ落として翻訳済みは残す。
recommendedForは{offerId,label,reason}の配列で、label だけ英語・reason は訳済みという部分翻訳が4記事×7ロケールで実在したため、フィールド単位で判定する。
(文字列/dict の2形状だけ見ると 118→28 までしか減らない)
check-built-output.mjsに出力側ゲートを追加。en ソースの40字以上の文字列を、非en の index 対象ページの可視テキストと突き合わせる。
キー名を列挙する方式は「次のキー」に効かないため、出力で見る。
検証(ローカル全ビルド 13,994ページ)
check-built-canonical/check-index-healthは無変更で通過(FATAL 0 / WARN 0)de/best-bikini-2026: 英語のまま2件が消え、訳済み3件は残存de/best-turkish-coffee-maker-2026: "Kupfer" 等の独語本文を保持enページは無変更https://claude.ai/code/session_01D41rnpZ7nmdkNHNJgWn2wp