💄 Give a link to open wiki when error occurred.
This commit is contained in:
		| @@ -18,6 +18,7 @@ | ||||
|   "screenAbuseReport": "Abuse Reports", | ||||
|   "screenSettings": "Settings", | ||||
|   "screenAccountSettings": "Account Settings", | ||||
|   "screenAccountWallet": "Wallet", | ||||
|   "screenNews": "News", | ||||
|   "screenAlbum": "Album", | ||||
|   "screenChat": "Chat", | ||||
| @@ -130,6 +131,8 @@ | ||||
|   "accountSettingsSubtitle": "Manage your account and make it yours.", | ||||
|   "accountProfileEdit": "Edit your profile", | ||||
|   "accountProfileEditSubtitle": "Make your Solarpass account more looks like you.", | ||||
|   "accountWallet": "Wallet", | ||||
|   "accountWalletSubtitle": "View your balance and transactions.", | ||||
|   "factorSettings": "Auth Factors", | ||||
|   "factorSettingsSubtitle": "Manage your authentication factors.", | ||||
|   "accountProfileEditApplied": "Profile modification applied.", | ||||
| @@ -584,5 +587,7 @@ | ||||
|   "newsToday": "Today's News", | ||||
|   "totpPostSetup": "One More Thing", | ||||
|   "totpPostSetupDescription": "Scan the QR Code below with Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden or any of kind of authenticator app which supports TOTP.", | ||||
|   "totpNeverShare": "Never share this QR Code" | ||||
|   "totpNeverShare": "Never share this QR Code", | ||||
|   "needHelp": "Need Help?", | ||||
|   "needHelpLaunch": "Check out our Goatpedia!" | ||||
| } | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|   "screenAbuseReport": "滥用检举", | ||||
|   "screenSettings": "设置", | ||||
|   "screenAccountSettings": "账号设置", | ||||
|   "screenAccountWallet": "钱包", | ||||
|   "screenNews": "新闻", | ||||
|   "screenAlbum": "相册", | ||||
|   "screenChat": "聊天", | ||||
| @@ -113,6 +114,8 @@ | ||||
|   "accountSettingsSubtitle": "管理你的帐号并让它更好的服务你。", | ||||
|   "accountProfileEdit": "编辑资料", | ||||
|   "accountProfileEditSubtitle": "使你的 Solarpass 账户更像你。", | ||||
|   "accountWallet": "钱包", | ||||
|   "accountWalletSubtitle": "查看你的余额和交易记录。", | ||||
|   "factorSettings": "验证因子", | ||||
|   "factorSettingsSubtitle": "管理你的登陆验证方式。", | ||||
|   "accountProfileEditApplied": "个人资料修改已被应用。", | ||||
| @@ -581,5 +584,7 @@ | ||||
|   "newsToday": "快讯", | ||||
|   "totpPostSetup": "还有一件事", | ||||
|   "totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的验证器扫描本 QR Code 来添加。", | ||||
|   "totpNeverShare": "永远不要分享这个 QR Code" | ||||
|   "totpNeverShare": "永远不要分享这个 QR Code", | ||||
|   "needHelp": "需要帮助?", | ||||
|   "needHelpLaunch": "查看我们的山羊维基!" | ||||
| } | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
|   "screenAccountProfileEdit": "編輯資料", | ||||
|   "screenAbuseReport": "濫用檢舉", | ||||
|   "screenSettings": "設置", | ||||
|   "screenAccountSettings": "賬號設置", | ||||
|   "screenNews": "新聞", | ||||
|   "screenAlbum": "相冊", | ||||
|   "screenChat": "聊天", | ||||
| @@ -88,8 +89,18 @@ | ||||
|   }, | ||||
|   "loginEnterPassword": "驗證代碼", | ||||
|   "loginSuccess": "登錄為 {}", | ||||
|   "authFactorDelete": "刪除驗證因子", | ||||
|   "authFactorDeleteDescription": "你確定要刪除 {} 驗證因子嗎?", | ||||
|   "authFactorPassword": "密碼", | ||||
|   "authFactorPasswordDescription": "註冊時選擇設置的密碼。", | ||||
|   "authFactorEmail": "電郵一次性驗證碼", | ||||
|   "authFactorEmailDescription": "由我們生成併發送到綁定的的電子郵箱的一次性驗證碼。", | ||||
|   "authFactorTOTP": "時序驗證碼", | ||||
|   "authFactorTOTPDescription": "使用 Google Authenticator 或 Authy 等驗證器生成的一次性驗證碼。", | ||||
|   "authFactorInAppNotify": "應用內通知驗證碼", | ||||
|   "authFactorInAppNotifyDescription": "通過站內通知推送的一次性驗證碼。", | ||||
|   "authFactorAdd": "添加新驗證因子", | ||||
|   "authFactorAddSubtitle": "給你的帳户登陸時提供另一個方案。", | ||||
|   "accountIntroTitle": "喜歡您來!", | ||||
|   "accountIntroSubtitle": "登陸以探索更廣大的世界。", | ||||
|   "accountLogout": "退出登錄", | ||||
| @@ -98,8 +109,12 @@ | ||||
|   "accountLogoutConfirm": "您需要重新輸入賬號密碼,甚至可能需要多步驗證來再次登陸。", | ||||
|   "accountPublishers": "你的發佈者", | ||||
|   "accountPublishersSubtitle": "管理你的公共形象。", | ||||
|   "accountSettings": "帳號設置", | ||||
|   "accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。", | ||||
|   "accountProfileEdit": "編輯資料", | ||||
|   "accountProfileEditSubtitle": "使你的 Solarpass 賬户更像你。", | ||||
|   "factorSettings": "驗證因子", | ||||
|   "factorSettingsSubtitle": "管理你的登陸驗證方式。", | ||||
|   "accountProfileEditApplied": "個人資料修改已被應用。", | ||||
|   "publishersNew": "新發布者", | ||||
|   "publisherNewSubtitle": "創建一個新的公共身份。", | ||||
| @@ -563,5 +578,8 @@ | ||||
|   "newsReadingFromReader": "你正在從 HyperNet.Reader 閲讀文章", | ||||
|   "newsReadingFromOriginal": "你正在閲讀原始文章", | ||||
|   "newsDisclaimer": "本文由 HyperNet.Reader 從互聯網上獲取,我們不擔保其內容的真實性,請自行判斷。本文章的所有內容版權歸原作者所有。", | ||||
|   "newsToday": "快訊" | ||||
|   "newsToday": "快訊", | ||||
|   "totpPostSetup": "還有一件事", | ||||
|   "totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。", | ||||
|   "totpNeverShare": "永遠不要分享這個 QR Code" | ||||
| } | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
|   "screenAccountProfileEdit": "編輯資料", | ||||
|   "screenAbuseReport": "濫用檢舉", | ||||
|   "screenSettings": "設置", | ||||
|   "screenAccountSettings": "賬號設置", | ||||
|   "screenNews": "新聞", | ||||
|   "screenAlbum": "相冊", | ||||
|   "screenChat": "聊天", | ||||
| @@ -88,8 +89,18 @@ | ||||
|   }, | ||||
|   "loginEnterPassword": "驗證代碼", | ||||
|   "loginSuccess": "登錄為 {}", | ||||
|   "authFactorDelete": "刪除驗證因子", | ||||
|   "authFactorDeleteDescription": "你確定要刪除 {} 驗證因子嗎?", | ||||
|   "authFactorPassword": "密碼", | ||||
|   "authFactorPasswordDescription": "註冊時選擇設置的密碼。", | ||||
|   "authFactorEmail": "電郵一次性驗證碼", | ||||
|   "authFactorEmailDescription": "由我們生成併發送到綁定的的電子郵箱的一次性驗證碼。", | ||||
|   "authFactorTOTP": "時序驗證碼", | ||||
|   "authFactorTOTPDescription": "使用 Google Authenticator 或 Authy 等驗證器生成的一次性驗證碼。", | ||||
|   "authFactorInAppNotify": "應用內通知驗證碼", | ||||
|   "authFactorInAppNotifyDescription": "通過站內通知推送的一次性驗證碼。", | ||||
|   "authFactorAdd": "添加新驗證因子", | ||||
|   "authFactorAddSubtitle": "給你的帳戶登陸時提供另一個方案。", | ||||
|   "accountIntroTitle": "喜歡您來!", | ||||
|   "accountIntroSubtitle": "登陸以探索更廣大的世界。", | ||||
|   "accountLogout": "退出登錄", | ||||
| @@ -98,8 +109,12 @@ | ||||
|   "accountLogoutConfirm": "您需要重新輸入賬號密碼,甚至可能需要多步驗證來再次登陸。", | ||||
|   "accountPublishers": "你的發佈者", | ||||
|   "accountPublishersSubtitle": "管理你的公共形象。", | ||||
|   "accountSettings": "帳號設置", | ||||
|   "accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。", | ||||
|   "accountProfileEdit": "編輯資料", | ||||
|   "accountProfileEditSubtitle": "使你的 Solarpass 賬戶更像你。", | ||||
|   "factorSettings": "驗證因子", | ||||
|   "factorSettingsSubtitle": "管理你的登陸驗證方式。", | ||||
|   "accountProfileEditApplied": "個人資料修改已被應用。", | ||||
|   "publishersNew": "新發布者", | ||||
|   "publisherNewSubtitle": "創建一個新的公共身份。", | ||||
| @@ -563,5 +578,8 @@ | ||||
|   "newsReadingFromReader": "你正在從 HyperNet.Reader 閱讀文章", | ||||
|   "newsReadingFromOriginal": "你正在閱讀原始文章", | ||||
|   "newsDisclaimer": "本文由 HyperNet.Reader 從互聯網上獲取,我們不擔保其內容的真實性,請自行判斷。本文章的所有內容版權歸原作者所有。", | ||||
|   "newsToday": "快訊" | ||||
|   "newsToday": "快訊", | ||||
|   "totpPostSetup": "還有一件事", | ||||
|   "totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。", | ||||
|   "totpNeverShare": "永遠不要分享這個 QR Code" | ||||
| } | ||||
|   | ||||
| @@ -2,7 +2,9 @@ import 'dart:math' as math; | ||||
|  | ||||
| import 'package:dio/dio.dart'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/gestures.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:url_launcher/url_launcher_string.dart'; | ||||
|  | ||||
| extension AppPromptExtension on BuildContext { | ||||
|   void showSnackbar(String content, {SnackBarAction? action}) { | ||||
| @@ -111,7 +113,34 @@ extension AppPromptExtension on BuildContext { | ||||
|       context: this, | ||||
|       builder: (ctx) => AlertDialog( | ||||
|         title: Text('dialogError').tr(), | ||||
|         content: content, | ||||
|         content: Column( | ||||
|           crossAxisAlignment: CrossAxisAlignment.start, | ||||
|           mainAxisSize: MainAxisSize.min, | ||||
|           spacing: 20, | ||||
|           children: [ | ||||
|             content, | ||||
|             Text.rich( | ||||
|               TextSpan( | ||||
|                 text: 'needHelp'.tr(), | ||||
|                 children: [ | ||||
|                   TextSpan(text: ' '), | ||||
|                   TextSpan( | ||||
|                     text: 'needHelpLaunch'.tr(), | ||||
|                     style: TextStyle( | ||||
|                       color: Theme.of(ctx).colorScheme.primary, | ||||
|                       decoration: TextDecoration.underline, | ||||
|                       decorationColor: Theme.of(ctx).colorScheme.primary, | ||||
|                     ), | ||||
|                     recognizer: TapGestureRecognizer() | ||||
|                       ..onTap = () { | ||||
|                         launchUrlString('https://kb.solsynth.dev/solar-network'); | ||||
|                       }, | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|             ), | ||||
|           ], | ||||
|         ), | ||||
|         actions: [ | ||||
|           TextButton( | ||||
|             onPressed: () => Navigator.pop(ctx), | ||||
| @@ -128,17 +157,7 @@ extension ByteFormatter on int { | ||||
|     if (this == 0) return '0 Bytes'; | ||||
|     const k = 1024; | ||||
|     final dm = decimals < 0 ? 0 : decimals; | ||||
|     final sizes = [ | ||||
|       'Bytes', | ||||
|       'KiB', | ||||
|       'MiB', | ||||
|       'GiB', | ||||
|       'TiB', | ||||
|       'PiB', | ||||
|       'EiB', | ||||
|       'ZiB', | ||||
|       'YiB' | ||||
|     ]; | ||||
|     final sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; | ||||
|     final i = (math.log(this) / math.log(k)).floor().toInt(); | ||||
|     return '${(this / math.pow(k, i)).toStringAsFixed(dm)} ${sizes[i]}'; | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user