fix(i18n): give every error registry kind its own message (07-01, 08-02)

22 of 38 kinds had no copy, so a failed query showed "This message is
unavailable." as its title. A unit test now requires every registry row's
message key in both locales, so a new kind without copy fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-09-25 23:58:52 +09:00
co-authored by Claude Opus 5.5
parent 4d17259037
commit bb70820db7
2 changed files with 63 additions and 0 deletions
+50
View File
@@ -146,6 +146,30 @@ const PLATFORM_KO_MESSAGES = {
"error.asset_mismatch": "화면 자산 구성이 현재 릴리스와 일치하지 않습니다.",
"error.render_failure": "화면을 표시하지 못했습니다.",
"error.unknown_failure": "예상하지 못한 문제가 발생했습니다.",
"error.request_aborted": "요청이 취소되었습니다.",
"error.content_type_mismatch": "서버 응답 형식을 해석할 수 없습니다.",
"error.malformed_json": "서버 응답을 읽을 수 없습니다.",
"error.response_body_limit": "서버 응답이 허용된 크기를 넘었습니다.",
"error.envelope_mismatch": "서버 응답 구조가 예상과 다릅니다.",
"error.schema_mismatch": "서버 응답 데이터가 현재 화면과 맞지 않습니다.",
"error.mapping_contract_violation":
"서버 응답을 화면 데이터로 바꾸지 못했습니다.",
"error.result_limit_exceeded": "결과가 너무 많아 표시할 수 없습니다.",
"error.scope_generation_changed": "세션이 바뀌어 이전 요청을 중단했습니다.",
"error.identity_intern_limit_exceeded":
"처리할 항목이 너무 많습니다. 잠시 후 다시 시도해 주세요.",
"error.duplicate_in_flight": "같은 요청을 이미 처리하고 있습니다.",
"error.pagination_contract_violation": "페이지 정보를 확인할 수 없습니다.",
"error.conflict": "다른 변경과 충돌했습니다.",
"error.validation_rejected": "서버가 입력값을 받아들이지 않았습니다.",
"error.unknown_client_failure": "요청을 처리할 수 없습니다.",
"error.boot_config_failure": "실행 설정을 불러오지 못했습니다.",
"error.release_manifest_failure": "릴리스 정보를 불러오지 못했습니다.",
"error.deploy_mismatch": "배포 구성이 현재 화면과 일치하지 않습니다.",
"error.storage_unavailable": "브라우저 저장소를 사용할 수 없습니다.",
"error.storage_quota_exceeded": "브라우저 저장 공간이 부족합니다.",
"error.telemetry_failure": "진단 정보를 보내지 못했습니다.",
"error.query_cache_failure": "저장된 조회 결과를 사용할 수 없습니다.",
...BOOT_MESSAGES["ko-KR"],
} as const;
@@ -300,6 +324,32 @@ const PLATFORM_EN_MESSAGES = {
"error.asset_mismatch": "The page assets do not match this release.",
"error.render_failure": "The page could not be displayed.",
"error.unknown_failure": "An unexpected problem occurred.",
"error.request_aborted": "The request was cancelled.",
"error.content_type_mismatch": "The server response format is not supported.",
"error.malformed_json": "The server response could not be read.",
"error.response_body_limit": "The server response exceeded the allowed size.",
"error.envelope_mismatch": "The server response structure is unexpected.",
"error.schema_mismatch": "The server response data does not match this page.",
"error.mapping_contract_violation":
"The server response could not be converted for this page.",
"error.result_limit_exceeded": "There are too many results to display.",
"error.scope_generation_changed":
"The session changed, so the earlier request was stopped.",
"error.identity_intern_limit_exceeded":
"There are too many items to process. Try again shortly.",
"error.duplicate_in_flight": "The same request is already in progress.",
"error.pagination_contract_violation":
"The page information could not be verified.",
"error.conflict": "The change conflicts with another update.",
"error.validation_rejected": "The server did not accept the entered values.",
"error.unknown_client_failure": "The request could not be processed.",
"error.boot_config_failure": "The runtime configuration could not be loaded.",
"error.release_manifest_failure": "The release information could not be loaded.",
"error.deploy_mismatch": "The deployment does not match this page.",
"error.storage_unavailable": "Browser storage is unavailable.",
"error.storage_quota_exceeded": "Browser storage is full.",
"error.telemetry_failure": "The diagnostic information could not be sent.",
"error.query_cache_failure": "The stored query results are unavailable.",
...BOOT_MESSAGES["en-US"],
} as const satisfies Record<keyof typeof PLATFORM_KO_MESSAGES, string>;
+13
View File
@@ -1,5 +1,7 @@
import { describe, expect, it } from "vitest";
import { ERROR_REGISTRY } from "../../src/contracts/errors.ts";
import {
catalogKeys,
FORMAT_FALLBACK,
@@ -34,6 +36,17 @@ describe("internationalization message contract", () => {
expect(MESSAGE_CATALOGS["ar-EG"]).toBe(EN_MESSAGES);
});
// 07-01/08-02. A kind without copy renders "This message is unavailable."
// as the failure title, so every registry row must resolve in both locales.
it("gives every error registry kind its own message in every locale", () => {
const missing = Object.values(ERROR_REGISTRY).flatMap((definition) =>
[KO_MESSAGES, EN_MESSAGES]
.filter((catalog) => !Object.hasOwn(catalog, definition.userMessageKey))
.map(() => definition.userMessageKey),
);
expect(missing).toEqual([]);
});
it("formats typed parameters and expands the pseudo locale", () => {
expect(
formatMessage("en-US", "route.documentTitle", {