diff --git a/assets/translations/strings_en.i18n.json b/assets/translations/strings_en.i18n.json index 3f4e2d8a..09077e53 100644 --- a/assets/translations/strings_en.i18n.json +++ b/assets/translations/strings_en.i18n.json @@ -16,7 +16,8 @@ "agree": "Agree", "decline": "Decline", "unknown": "Unknown", - "hidden": "Hidden" + "hidden": "Hidden", + "timeout": "timeout" }, "intro": { "termsAndPolicyCaution(rich)": "by continuing you agree with ${tap(@:about.termsAndConditions)}", @@ -132,6 +133,7 @@ "activeProxySemanticLabel": "Active proxy", "delaySemantics": { "result": "delay: ${delay}ms", + "timeout": "delay test timeout", "testing": "delay: testing..." }, "ipInfoSemantics": { diff --git a/lib/core/localization/locale_extensions.dart b/lib/core/localization/locale_extensions.dart index f581c3b1..96de1686 100644 --- a/lib/core/localization/locale_extensions.dart +++ b/lib/core/localization/locale_extensions.dart @@ -11,6 +11,7 @@ extension AppLocaleX on AppLocale { "ru" => "Русский", "zh" || "zh_CN" => "中文", "tr" => "Türkçe", + "es" => "Spanish", _ => "Unknown", }; } diff --git a/lib/features/proxy/active/active_proxy_delay_indicator.dart b/lib/features/proxy/active/active_proxy_delay_indicator.dart index 43828eeb..ff8cde35 100644 --- a/lib/features/proxy/active/active_proxy_delay_indicator.dart +++ b/lib/features/proxy/active/active_proxy_delay_indicator.dart @@ -23,6 +23,7 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget { switch (activeProxy) { case AsyncData(value: final proxy): final delay = proxy.urlTestDelay; + final timeout = delay > 65000; return Center( child: InkWell( onTap: () async { @@ -41,16 +42,27 @@ class ActiveProxyDelayIndicator extends HookConsumerWidget { const Gap(8), if (delay > 0) Text.rich( - semanticsLabel: - t.proxies.delaySemantics.result(delay: delay), + semanticsLabel: timeout + ? t.proxies.delaySemantics.timeout + : t.proxies.delaySemantics.result(delay: delay), TextSpan( children: [ - TextSpan( - text: delay > 65000 ? "×" : delay.toString(), - style: theme.textTheme.titleMedium - ?.copyWith(fontWeight: FontWeight.bold), - ), - const TextSpan(text: " ms"), + if (timeout) + TextSpan( + text: t.general.timeout, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + color: theme.colorScheme.error, + ), + ) + else ...[ + TextSpan( + text: delay.toString(), + style: theme.textTheme.titleMedium + ?.copyWith(fontWeight: FontWeight.bold), + ), + const TextSpan(text: " ms"), + ], ], ), )