From f4ff92dbf996638bfc48880216ff9b48051f6e15 Mon Sep 17 00:00:00 2001 From: Ayush7614 Date: Sun, 2 Aug 2026 01:04:08 +0530 Subject: [PATCH] Localize verification sheet controls and verification notifications. Sheet buttons and success/mutual verification pushes were still hardcoded English while the rest of the verification UI already used catalog keys. --- bitchat/Localizable.xcstrings | 1309 +++++++++++++++++ .../ChatVerificationCoordinator.swift | 38 +- bitchat/Views/VerificationViews.swift | 8 +- ...tVerificationCoordinatorContextTests.swift | 6 +- 4 files changed, 1351 insertions(+), 10 deletions(-) diff --git a/bitchat/Localizable.xcstrings b/bitchat/Localizable.xcstrings index f869ab85..be9c6f3f 100644 --- a/bitchat/Localizable.xcstrings +++ b/bitchat/Localizable.xcstrings @@ -76985,6 +76985,1315 @@ } }, + "verification.sheet.show_my_qr" : { + "comment" : "Button that switches the verification sheet back to showing the user's own QR code", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "meinen qr zeigen" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "mostrar mi qr" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "afficher mon qr" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "मेरा QR दिखाएं" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "mostra il mio qr" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "自分のQRを表示" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "내 QR 보기" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "toon mijn qr" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "pokaż mój qr" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "mostrar meu qr" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "показать мой qr" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "visa min qr" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "qr kodumu göster" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "show my qr" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "显示我的二维码" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "顯示我的 QR" + } + } + } + }, + + "verification.sheet.scan_other_qr" : { + "comment" : "Button that opens the verification QR scanner for another peer", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "qr von jemand anderem scannen" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "escanear el qr de otra persona" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "scanner le qr de quelqu'un d'autre" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "किसी और का QR स्कैन करें" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "scansiona il qr di qualcun altro" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "相手のQRをスキャン" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "상대방 QR 스캔" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan iemands anders qr" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "zeskanuj cudzy qr" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "escanear o qr de outra pessoa" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "сканировать чужой qr" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "skanna någon annans qr" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "başkasının qr kodunu tara" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "scan someone else's qr" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "扫描对方的二维码" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "掃描對方的 QR" + } + } + } + }, + + "verification.sheet.remove_verification" : { + "comment" : "Destructive button that removes verification for the selected peer", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "verifizierung entfernen" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "quitar verificación" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "retirer la vérification" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "सत्यापन हटाएं" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "rimuovi verifica" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "検証を解除" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "검증 제거" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "verificatie verwijderen" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "usuń weryfikację" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "remover verificação" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "снять проверку" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "ta bort verifiering" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "doğrulamayı kaldır" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "remove verification" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "移除验证" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "移除驗證" + } + } + } + }, + + "verification.notification.mutual.title" : { + "comment" : "Notification title when both peers have verified each other", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Gegenseitige Verifizierung" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificación mutua" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Vérification mutuelle" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "पारस्परिक सत्यापन" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verifica reciproca" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "相互検証" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "상호 검증" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wederzijdse verificatie" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Wzajemna weryfikacja" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificação mútua" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Взаимная проверка" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ömsesidig verifiering" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Karşılıklı doğrulama" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mutual verification" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "互相验证" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "互相驗證" + } + } + } + }, + + "verification.notification.success.title" : { + "comment" : "Notification title after the user successfully verifies a peer", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verifiziert" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificado" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Vérifié" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "सत्यापित" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificato" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "検証済み" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "검증됨" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Geverifieerd" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Zweryfikowano" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificado" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Проверено" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verifierad" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Doğrulandı" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verified" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "已验证" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "已驗證" + } + } + } + }, + + "verification.notification.success.body" : { + "comment" : "Notification body after verifying a peer; %@ is the peer nickname", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Du hast %@ verifiziert" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verificaste a %@" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tu as vérifié %@" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "आपने %@ को सत्यापित किया" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Hai verificato %@" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@を検証しました" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@님을 검증했습니다" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Je hebt %@ geverifieerd" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Zweryfikowałeś %@" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Você verificou %@" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Вы проверили %@" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Du verifierade %@" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ kişisini doğruladın" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "You verified %@" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "你已验证 %@" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "你已驗證 %@" + } + } + } + }, + + "verification.notification.mutual.body" : { + "comment" : "Notification body when mutual verification completes; %@ is the peer nickname", + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "bn" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "Du und %@ habt euch gegenseitig verifiziert" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tú y %@ se verificaron mutuamente" + } + }, + "fa" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "fil" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Toi et %@ vous êtes vérifiés mutuellement" + } + }, + "he" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "hi" : { + "stringUnit" : { + "state" : "translated", + "value" : "आप और %@ ने एक दूसरे को सत्यापित किया" + } + }, + "id" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "Tu e %@ vi siete verificati a vicenda" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "あなたと%@は相互に検証しました" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "회원님과 %@님이 서로 검증했습니다" + } + }, + "ms" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "ne" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Jij en %@ hebben elkaar geverifieerd" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ty i %@ zweryfikowaliście się nawzajem" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Você e %@ se verificaram mutuamente" + } + }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "Вы и %@ проверили друг друга" + } + }, + "sv" : { + "stringUnit" : { + "state" : "translated", + "value" : "Du och %@ verifierade varandra" + } + }, + "ta" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "th" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Sen ve %@ birbirinizi doğruladınız" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "ur" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "vi" : { + "stringUnit" : { + "state" : "translated", + "value" : "You and %@ verified each other" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "你和 %@ 已互相验证" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "你和 %@ 已互相驗證" + } + } + } + }, + "verification.scan.paste_prompt" : { "extractionState" : "manual", "localizations" : { diff --git a/bitchat/ViewModels/ChatVerificationCoordinator.swift b/bitchat/ViewModels/ChatVerificationCoordinator.swift index f6499988..14050b7c 100644 --- a/bitchat/ViewModels/ChatVerificationCoordinator.swift +++ b/bitchat/ViewModels/ChatVerificationCoordinator.swift @@ -332,7 +332,11 @@ final class ChatVerificationCoordinator { maybeSendMutualVerificationNotification( fingerprint: fingerprint, peerID: peerID, - title: "Mutual verification", + title: String( + localized: "verification.notification.mutual.title", + defaultValue: "Mutual verification", + comment: "Notification title when both peers have verified each other" + ), bodyName: context.unifiedPeer(for: peerID)?.nickname ?? context.resolveNickname(for: peerID), notificationPrefix: "verify-mutual" @@ -374,8 +378,20 @@ final class ChatVerificationCoordinator { let peerName = context.unifiedPeer(for: peerID)?.nickname ?? context.resolveNickname(for: peerID) context.postLocalNotification( - title: "Verified", - body: "You verified \(peerName)", + title: String( + localized: "verification.notification.success.title", + defaultValue: "Verified", + comment: "Notification title after the user successfully verifies a peer" + ), + body: String( + format: String( + localized: "verification.notification.success.body", + defaultValue: "You verified %@", + comment: "Notification body after verifying a peer; %@ is the peer nickname" + ), + locale: .current, + peerName + ), identifier: "verify-success-\(peerID)-\(UUID().uuidString)" ) @@ -384,7 +400,11 @@ final class ChatVerificationCoordinator { maybeSendMutualVerificationNotification( fingerprint: fingerprint, peerID: peerID, - title: "Mutual verification", + title: String( + localized: "verification.notification.mutual.title", + defaultValue: "Mutual verification", + comment: "Notification title when both peers have verified each other" + ), bodyName: peerName, notificationPrefix: "verify-mutual" ) @@ -411,7 +431,15 @@ private extension ChatVerificationCoordinator { lastMutualToastAt[fingerprint] = now context.postLocalNotification( title: title, - body: "You and \(bodyName) verified each other", + body: String( + format: String( + localized: "verification.notification.mutual.body", + defaultValue: "You and %@ verified each other", + comment: "Notification body when mutual verification completes; %@ is the peer nickname" + ), + locale: .current, + bodyName + ), identifier: "\(notificationPrefix)-\(peerID)-\(UUID().uuidString)" ) } diff --git a/bitchat/Views/VerificationViews.swift b/bitchat/Views/VerificationViews.swift index a3f9d82b..9140418d 100644 --- a/bitchat/Views/VerificationViews.swift +++ b/bitchat/Views/VerificationViews.swift @@ -8,7 +8,7 @@ import UIKit import AppKit #endif -/// Placeholder view to display the user's verification QR payload as text. +/// Displays the user's verification QR payload as an image and selectable text. struct MyQRView: View { let qrString: String @Environment(\.colorScheme) var colorScheme @@ -462,13 +462,13 @@ struct VerificationSheetView: View { VStack(spacing: 10) { if showingScanner { Button(action: { showingScanner = false }) { - Label("show my qr", systemImage: "qrcode") + Label("verification.sheet.show_my_qr", systemImage: "qrcode") .bitchatFont(size: 13) } .buttonStyle(.bordered) } else { Button(action: { showingScanner = true }) { - Label("scan someone else's qr", systemImage: "camera.viewfinder") + Label("verification.sheet.scan_other_qr", systemImage: "camera.viewfinder") .bitchatFont(size: 13, weight: .medium) } .buttonStyle(.bordered) @@ -479,7 +479,7 @@ struct VerificationSheetView: View { if let peerID = verificationModel.selectedPeerID, verificationModel.isVerified(peerID: peerID) { Button(action: { verificationModel.unverifyFingerprint(for: peerID) }) { - Label("remove verification", systemImage: "minus.circle") + Label("verification.sheet.remove_verification", systemImage: "minus.circle") .bitchatFont(size: 12) } .buttonStyle(.bordered) diff --git a/bitchatTests/ChatVerificationCoordinatorContextTests.swift b/bitchatTests/ChatVerificationCoordinatorContextTests.swift index 83cc7296..009f5b89 100644 --- a/bitchatTests/ChatVerificationCoordinatorContextTests.swift +++ b/bitchatTests/ChatVerificationCoordinatorContextTests.swift @@ -316,7 +316,11 @@ struct ChatVerificationCoordinatorContextTests { // Already-verified peer challenging us: mutual-verification toast. #expect(context.postedLocalNotifications.count == 1) - #expect(context.postedLocalNotifications.first?.title == "Mutual verification") + #expect(context.postedLocalNotifications.first?.title == String( + localized: "verification.notification.mutual.title", + defaultValue: "Mutual verification", + comment: "Notification title when both peers have verified each other" + )) #expect(context.postedLocalNotifications.first?.body.hasSuffix("verified each other") == true) #expect(context.postedLocalNotifications.first?.identifier.hasPrefix("verify-mutual-") == true)