fix(i18n): route unlock error notices through translation keys

This commit is contained in:
Slinetrac
2025-11-06 20:31:03 +08:00
Unverified
parent 628639324c
commit 19d87844ce
14 changed files with 19 additions and 2 deletions

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "فشل الكشف لـ {{name}}",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "Erkennung für {{name}} fehlgeschlagen",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Entsperrungstest"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "Detection failed for {{name}}",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -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"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "تشخیص برای {{name}} ناموفق بود",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "Deteksi gagal untuk {{name}}",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -44,6 +44,7 @@
},
"empty": "アンロックテスト項目はありません",
"messages": {
"detectionFailedWithName": "{{name}} の検出に失敗しました",
"detectionTimeout": "Detection timeout or failed"
},
"title": "ロック解除テスト"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "{{name}} 감지에 실패했습니다",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "Не удалось обнаружить {{name}}",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Тест доступности веб-сайтов"

View File

@@ -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"

View File

@@ -44,6 +44,7 @@
},
"empty": "No unlock test items",
"messages": {
"detectionFailedWithName": "{{name}} өчен ачыклау уңышсыз булды",
"detectionTimeout": "Detection timeout or failed"
},
"title": "Unlock Test"

View File

@@ -44,6 +44,7 @@
},
"empty": "暂无解锁测试项目",
"messages": {
"detectionFailedWithName": "{{name}} 检测失败",
"detectionTimeout": "检测超时或失败"
},
"title": "解锁测试"

View File

@@ -44,6 +44,7 @@
},
"empty": "目前沒有解鎖測試項目",
"messages": {
"detectionFailedWithName": "{{name}} 檢測失敗",
"detectionTimeout": "檢測逾時或失敗"
},
"title": "解鎖測試"

View File

@@ -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);
}
});