From 19d87844ce66f9ad9b26743f6abd19254c8eb286 Mon Sep 17 00:00:00 2001 From: Slinetrac Date: Thu, 6 Nov 2025 20:31:03 +0800 Subject: [PATCH] fix(i18n): route unlock error notices through translation keys --- src/locales/ar/tests.json | 1 + src/locales/de/tests.json | 1 + src/locales/en/tests.json | 1 + src/locales/es/tests.json | 1 + src/locales/fa/tests.json | 1 + src/locales/id/tests.json | 1 + src/locales/jp/tests.json | 1 + src/locales/ko/tests.json | 1 + src/locales/ru/tests.json | 1 + src/locales/tr/tests.json | 1 + src/locales/tt/tests.json | 1 + src/locales/zh/tests.json | 1 + src/locales/zhtw/tests.json | 1 + src/pages/unlock.tsx | 8 ++++++-- 14 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/locales/ar/tests.json b/src/locales/ar/tests.json index 31ba536f..3f4d1707 100644 --- a/src/locales/ar/tests.json +++ b/src/locales/ar/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "فشل الكشف لـ {{name}}", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/de/tests.json b/src/locales/de/tests.json index 74a74a1f..49b92211 100644 --- a/src/locales/de/tests.json +++ b/src/locales/de/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "Erkennung für {{name}} fehlgeschlagen", "detectionTimeout": "Detection timeout or failed" }, "title": "Entsperrungstest" diff --git a/src/locales/en/tests.json b/src/locales/en/tests.json index 513b70f1..22c58559 100644 --- a/src/locales/en/tests.json +++ b/src/locales/en/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "Detection failed for {{name}}", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/es/tests.json b/src/locales/es/tests.json index f95fb613..43bc028b 100644 --- a/src/locales/es/tests.json +++ b/src/locales/es/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "Fallo en la detección para {{name}}", "detectionTimeout": "Detection timeout or failed" }, "title": "Prueba de desbloqueo" diff --git a/src/locales/fa/tests.json b/src/locales/fa/tests.json index a36d2b8a..9068ea33 100644 --- a/src/locales/fa/tests.json +++ b/src/locales/fa/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "تشخیص برای {{name}} ناموفق بود", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/id/tests.json b/src/locales/id/tests.json index 83538951..95cfa598 100644 --- a/src/locales/id/tests.json +++ b/src/locales/id/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "Deteksi gagal untuk {{name}}", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/jp/tests.json b/src/locales/jp/tests.json index fccc19c6..0640382d 100644 --- a/src/locales/jp/tests.json +++ b/src/locales/jp/tests.json @@ -44,6 +44,7 @@ }, "empty": "アンロックテスト項目はありません", "messages": { + "detectionFailedWithName": "{{name}} の検出に失敗しました", "detectionTimeout": "Detection timeout or failed" }, "title": "ロック解除テスト" diff --git a/src/locales/ko/tests.json b/src/locales/ko/tests.json index fd6bf9db..1b53013a 100644 --- a/src/locales/ko/tests.json +++ b/src/locales/ko/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "{{name}} 감지에 실패했습니다", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/ru/tests.json b/src/locales/ru/tests.json index b1035d45..16b2a5e0 100644 --- a/src/locales/ru/tests.json +++ b/src/locales/ru/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "Не удалось обнаружить {{name}}", "detectionTimeout": "Detection timeout or failed" }, "title": "Тест доступности веб-сайтов" diff --git a/src/locales/tr/tests.json b/src/locales/tr/tests.json index 7e673e40..41d0e303 100644 --- a/src/locales/tr/tests.json +++ b/src/locales/tr/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "{{name}} için tespit başarısız oldu", "detectionTimeout": "Detection timeout or failed" }, "title": "Kilit Açma Testi" diff --git a/src/locales/tt/tests.json b/src/locales/tt/tests.json index a96085f8..efc03a9a 100644 --- a/src/locales/tt/tests.json +++ b/src/locales/tt/tests.json @@ -44,6 +44,7 @@ }, "empty": "No unlock test items", "messages": { + "detectionFailedWithName": "{{name}} өчен ачыклау уңышсыз булды", "detectionTimeout": "Detection timeout or failed" }, "title": "Unlock Test" diff --git a/src/locales/zh/tests.json b/src/locales/zh/tests.json index 86967597..25044e66 100644 --- a/src/locales/zh/tests.json +++ b/src/locales/zh/tests.json @@ -44,6 +44,7 @@ }, "empty": "暂无解锁测试项目", "messages": { + "detectionFailedWithName": "{{name}} 检测失败", "detectionTimeout": "检测超时或失败" }, "title": "解锁测试" diff --git a/src/locales/zhtw/tests.json b/src/locales/zhtw/tests.json index b57d08fd..dbdc2694 100644 --- a/src/locales/zhtw/tests.json +++ b/src/locales/zhtw/tests.json @@ -44,6 +44,7 @@ }, "empty": "目前沒有解鎖測試項目", "messages": { + "detectionFailedWithName": "{{name}} 檢測失敗", "detectionTimeout": "檢測逾時或失敗" }, "title": "解鎖測試" diff --git a/src/pages/unlock.tsx b/src/pages/unlock.tsx index 3b160826..95c8bd2e 100644 --- a/src/pages/unlock.tsx +++ b/src/pages/unlock.tsx @@ -187,7 +187,7 @@ const UnlockPage = () => { setIsCheckingAll(false); } catch (err: any) { setIsCheckingAll(false); - showNotice.error("Detection timeout or failed", err); + showNotice.error("tests.unlock.page.messages.detectionTimeout", err); console.error("Failed to check media unlock:", err); } }); @@ -217,7 +217,11 @@ const UnlockPage = () => { setLoadingItems((prev) => prev.filter((item) => item !== name)); } catch (err: any) { setLoadingItems((prev) => prev.filter((item) => item !== name)); - showNotice.error("Detection failed for {{name}}", { name }, err); + showNotice.error( + "tests.unlock.page.messages.detectionFailedWithName", + { name }, + err, + ); console.error(`Failed to check ${name}:`, err); } });