Add alert for onion nodes

Serhii committed Jan 5, 2023 at 12:53 UTC e53602afa362f4f3bae4d0220f94c2c9f71e3623
17 files changed +36 -16
lib/src/screens/settings/connection_sync_page.dart
+1 -1
@@ -73,7 +73,7 @@ class ConnectionSyncPage extends BasePage {
73 builder: (BuildContext context) {
74 return AlertWithTwoActions(
75 alertTitle: S.of(context).change_current_node_title,
76 - alertContent: S.of(context).change_current_node(node.uriRaw),
76 + alertContent: nodeListViewModel.getAlertContent(node.uriRaw),
77 leftButtonText: S.of(context).cancel,
78 rightButtonText: S.of(context).change,
79 actionLeftButton: () => Navigator.of(context).pop(),
lib/view_model/node_list/node_list_view_model.dart
+5
@@ -1,3 +1,4 @@
1 +import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:hive/hive.dart';
3 import 'package:mobx/mobx.dart';
4 import 'package:cw_core/wallet_base.dart';
@@ -30,6 +31,10 @@ abstract class NodeListViewModelBase with Store {
31 return node;
32 }
33
34 + String getAlertContent(String uri) =>
35 + S.current.change_current_node(uri) +
36 + '${uri.endsWith('.onion') || uri.contains('.onion:') ? '\n' + S.current.orbot_running_alert : ''}';
37 +
38 final ObservableList<Node> nodes;
39 final SettingsStore settingsStore;
40 final WalletBase wallet;
res/values/strings_de.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Deaktiviert",
678 "enabled": "Ermöglicht",
679 "tor_only": "Nur Tor",
680 - "unmatched_currencies": "Die Währung Ihres aktuellen Wallets stimmt nicht mit der des gescannten QR überein"
680 + "unmatched_currencies": "Die Währung Ihres aktuellen Wallets stimmt nicht mit der des gescannten QR überein",
681 + "orbot_running_alert": "Please make sure Orbot is running prior to connecting to this node."
682 }
res/values/strings_en.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Disabled",
678 "enabled": "Enabled",
679 "tor_only": "Tor only",
680 - "unmatched_currencies": "Your current wallet's currency does not match that of the scanned QR"
680 + "unmatched_currencies": "Your current wallet's currency does not match that of the scanned QR",
681 + "orbot_running_alert": "Please make sure Orbot is running prior to connecting to this node."
682 }
res/values/strings_es.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Desactivado",
678 "enabled": "Activado",
679 "tor_only": "solo Tor",
680 - "unmatched_currencies": "La moneda de su billetera actual no coincide con la del QR escaneado"
680 + "unmatched_currencies": "La moneda de su billetera actual no coincide con la del QR escaneado",
681 + "orbot_running_alert": "Asegúrese de que Orbot se esté ejecutando antes de conectarse a este nodo."
682 }
res/values/strings_fr.arb
+2 -1
@@ -675,5 +675,6 @@
675 "disabled": "Handicapé",
676 "enabled": "Activé",
677 "tor_only": "Tor uniquement",
678 - "unmatched_currencies": "La devise de votre portefeuille actuel ne correspond pas à celle du QR scanné"
678 + "unmatched_currencies": "La devise de votre portefeuille actuel ne correspond pas à celle du QR scanné",
679 + "orbot_running_alert": "Veuillez vous assurer qu'Orbot est en cours d'exécution avant de vous connecter à ce nœud."
680 }
res/values/strings_hi.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "अक्षम",
678 "enabled": "सक्रिय",
679 "tor_only": "Tor केवल",
680 - "unmatched_currencies": "आपके वर्तमान वॉलेट की मुद्रा स्कैन किए गए क्यूआर से मेल नहीं खाती"
680 + "unmatched_currencies": "आपके वर्तमान वॉलेट की मुद्रा स्कैन किए गए क्यूआर से मेल नहीं खाती",
681 + "orbot_running_alert": "कृपया सुनिश्चित करें कि इस नोड से कनेक्ट करने से पहले Orbot चल रहा है।"
682 }
res/values/strings_hr.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Onemogućeno",
678 "enabled": "Omogućeno",
679 "tor_only": "Samo Tor",
680 - "unmatched_currencies": "Valuta vašeg trenutnog novčanika ne odgovara onoj na skeniranom QR-u"
680 + "unmatched_currencies": "Valuta vašeg trenutnog novčanika ne odgovara onoj na skeniranom QR-u",
681 + "orbot_running_alert": "Provjerite radi li Orbot prije spajanja na ovaj čvor."
682 }
res/values/strings_it.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Disabilitato",
678 "enabled": "Abilitato",
679 "tor_only": "Solo Tor",
680 - "unmatched_currencies": "La valuta del tuo portafoglio attuale non corrisponde a quella del QR scansionato"
680 + "unmatched_currencies": "La valuta del tuo portafoglio attuale non corrisponde a quella del QR scansionato",
681 + "orbot_running_alert": "Assicurati che Orbot sia in esecuzione prima di connetterti a questo nodo."
682 }
res/values/strings_ja.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "無効",
678 "enabled": "有効",
679 "tor_only": "Torのみ",
680 - "unmatched_currencies": "現在のウォレットの通貨がスキャンされたQRの通貨と一致しません"
680 + "unmatched_currencies": "現在のウォレットの通貨がスキャンされたQRの通貨と一致しません",
681 + "orbot_running_alert": "このノードに接続する前に、Orbot が実行されていることを確認してください"
682 }
res/values/strings_ko.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "장애가 있는",
678 "enabled": "사용",
679 "tor_only": "Tor 뿐",
680 - "unmatched_currencies": "현재 지갑의 통화가 스캔한 QR의 통화와 일치하지 않습니다."
680 + "unmatched_currencies": "현재 지갑의 통화가 스캔한 QR의 통화와 일치하지 않습니다.",
681 + "orbot_running_alert": "이 노드에 연결하기 전에 Orbot이 실행 중인지 확인하십시오."
682 }
res/values/strings_nl.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Gehandicapt",
678 "enabled": "Ingeschakeld",
679 "tor_only": "Alleen Tor",
680 - "unmatched_currencies": "De valuta van uw huidige portemonnee komt niet overeen met die van de gescande QR"
680 + "unmatched_currencies": "De valuta van uw huidige portemonnee komt niet overeen met die van de gescande QR",
681 + "orbot_running_alert": "Zorg ervoor dat Orbot actief is voordat u verbinding maakt met dit knooppunt."
682 }
res/values/strings_pl.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Wyłączone",
678 "enabled": "Włączony",
679 "tor_only": "Tylko Tor",
680 - "unmatched_currencies": "Waluta Twojego obecnego portfela nie odpowiada walucie zeskanowanego kodu QR"
680 + "unmatched_currencies": "Waluta Twojego obecnego portfela nie odpowiada walucie zeskanowanego kodu QR",
681 + "orbot_running_alert": "Upewnij się, że Orbot działa przed połączeniem z tym węzłem."
682 }
res/values/strings_pt.arb
+2 -1
@@ -676,5 +676,6 @@
676 "disabled": "Desabilitado",
677 "enabled": "Habilitado",
678 "tor_only": "Tor apenas",
679 - "unmatched_currencies": "A moeda da sua carteira atual não corresponde à do QR digitalizado"
679 + "unmatched_currencies": "A moeda da sua carteira atual não corresponde à do QR digitalizado",
680 + "orbot_running_alert": "Certifique-se de que o Orbot esteja em execução antes de se conectar a este nó."
681 }
res/values/strings_ru.arb
+2 -1
@@ -677,5 +677,6 @@
677 "disabled": "Отключено",
678 "enabled": "Включено",
679 "tor_only": "Только Tor",
680 - "unmatched_currencies": "Валюта вашего текущего кошелька не соответствует валюте отсканированного QR-кода."
680 + "unmatched_currencies": "Валюта вашего текущего кошелька не соответствует валюте отсканированного QR-кода.",
681 + "orbot_running_alert": "Перед подключением к этому узлу убедитесь, что Orbot запущен."
682 }
res/values/strings_uk.arb
+2 -1
@@ -676,5 +676,6 @@
676 "disabled": "Вимкнено",
677 "enabled": "Увімкнено",
678 "tor_only": "Тільки Tor",
679 - "unmatched_currencies": "Валюта вашого гаманця не збігається з валютою сканованого QR-коду"
679 + "unmatched_currencies": "Валюта вашого гаманця не збігається з валютою сканованого QR-коду",
680 + "orbot_running_alert": "Перед підключенням до цього вузла переконайтеся, що Orbot запущено."
681 }
res/values/strings_zh.arb
+2 -1
@@ -675,5 +675,6 @@
675 "disabled": "禁用",
676 "enabled": "启用",
677 "tor_only": "仅限 Tor",
678 - "unmatched_currencies": "您当前钱包的货币与扫描的 QR 的货币不匹配"
678 + "unmatched_currencies": "您当前钱包的货币与扫描的 QR 的货币不匹配",
679 + "orbot_running_alert": "请确保 Orbot 在连接到此节点之前正在运行。"
680 }