Showing
6 changed files
with
131 additions
and
9 deletions
| @@ -3,6 +3,7 @@ import 'package:doublefeel_flutter/app/utils/dialog_utils.dart'; | @@ -3,6 +3,7 @@ import 'package:doublefeel_flutter/app/utils/dialog_utils.dart'; | ||
| 3 | import 'package:doublefeel_flutter/core/network/api/user_api.dart'; | 3 | import 'package:doublefeel_flutter/core/network/api/user_api.dart'; |
| 4 | import 'package:doublefeel_flutter/core/result/app_result.dart'; | 4 | import 'package:doublefeel_flutter/core/result/app_result.dart'; |
| 5 | import 'package:doublefeel_flutter/core/util/app_toast.dart'; | 5 | import 'package:doublefeel_flutter/core/util/app_toast.dart'; |
| 6 | +import 'package:doublefeel_flutter/l10n/l10n_extensions.dart'; | ||
| 6 | import 'package:doublefeel_flutter/pigeon/platform_api.g.dart'; | 7 | import 'package:doublefeel_flutter/pigeon/platform_api.g.dart'; |
| 7 | import 'package:flutter/material.dart'; | 8 | import 'package:flutter/material.dart'; |
| 8 | import 'package:get/get.dart'; | 9 | import 'package:get/get.dart'; |
| @@ -35,7 +36,7 @@ class SubmitFeedbackController extends GetxController { | @@ -35,7 +36,7 @@ class SubmitFeedbackController extends GetxController { | ||
| 35 | Future<void> pickImages() async { | 36 | Future<void> pickImages() async { |
| 36 | final remainingCount = maxImageCount - selectedImages.length; | 37 | final remainingCount = maxImageCount - selectedImages.length; |
| 37 | if (remainingCount <= 0) { | 38 | if (remainingCount <= 0) { |
| 38 | - AppToast.show('最多上传5个图片或视频'); | 39 | + AppToast.show(l10n.feedbackMaxImagesLimit(maxImageCount)); |
| 39 | return; | 40 | return; |
| 40 | } | 41 | } |
| 41 | 42 | ||
| @@ -46,7 +47,7 @@ class SubmitFeedbackController extends GetxController { | @@ -46,7 +47,7 @@ class SubmitFeedbackController extends GetxController { | ||
| 46 | imageQuality: 85, | 47 | imageQuality: 85, |
| 47 | ); | 48 | ); |
| 48 | } catch (_) { | 49 | } catch (_) { |
| 49 | - AppToast.show('无法选择图片,请稍后重试'); | 50 | + AppToast.show(l10n.feedbackSelectImageError); |
| 50 | return; | 51 | return; |
| 51 | } | 52 | } |
| 52 | 53 | ||
| @@ -65,12 +66,12 @@ class SubmitFeedbackController extends GetxController { | @@ -65,12 +66,12 @@ class SubmitFeedbackController extends GetxController { | ||
| 65 | 66 | ||
| 66 | Future<void> submit() async { | 67 | Future<void> submit() async { |
| 67 | if (feedbackTextController.text.trim().isEmpty) { | 68 | if (feedbackTextController.text.trim().isEmpty) { |
| 68 | - AppToast.show('请输入问题和反馈'); | 69 | + AppToast.show(l10n.feedbackEmptyContentHint); |
| 69 | return; | 70 | return; |
| 70 | } | 71 | } |
| 71 | final email = contactTextController.text.trim(); | 72 | final email = contactTextController.text.trim(); |
| 72 | if (email.isNotEmpty && !_emailRegExp.hasMatch(email)) { | 73 | if (email.isNotEmpty && !_emailRegExp.hasMatch(email)) { |
| 73 | - AppToast.show('邮箱格式错误,请重新输入'); | 74 | + AppToast.show(l10n.feedbackInvalidEmail); |
| 74 | return; | 75 | return; |
| 75 | } | 76 | } |
| 76 | Get.dialog( | 77 | Get.dialog( |
| @@ -105,9 +106,9 @@ class SubmitFeedbackController extends GetxController { | @@ -105,9 +106,9 @@ class SubmitFeedbackController extends GetxController { | ||
| 105 | case AppSuccess(): | 106 | case AppSuccess(): |
| 106 | await DialogUtils.showCommonDialog(DialogMetaData( | 107 | await DialogUtils.showCommonDialog(DialogMetaData( |
| 107 | iconAsset: null, | 108 | iconAsset: null, |
| 108 | - title: '反馈提交成功', | ||
| 109 | - message: '谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。', | ||
| 110 | - confirmText: '好的', | 109 | + title: l10n.feedbackSubmitSuccessTitle, |
| 110 | + message: l10n.feedbackSubmitSuccessMessage, | ||
| 111 | + confirmText: l10n.feedbackSubmitSuccessConfirm, | ||
| 111 | )); | 112 | )); |
| 112 | Get.back(); | 113 | Get.back(); |
| 113 | case AppFailure(:final error): | 114 | case AppFailure(:final error): |
| @@ -640,5 +640,20 @@ | @@ -640,5 +640,20 @@ | ||
| 640 | "watchThemeIncomplete": "Theme information is incomplete", | 640 | "watchThemeIncomplete": "Theme information is incomplete", |
| 641 | "watchThemeApplyFailed": "Failed to apply theme", | 641 | "watchThemeApplyFailed": "Failed to apply theme", |
| 642 | "watchThemeWatchSyncFailed": "Watch face sync failed", | 642 | "watchThemeWatchSyncFailed": "Watch face sync failed", |
| 643 | - "watchThemePurchaseChannel": "Watch Face Themes" | 643 | + "watchThemePurchaseChannel": "Watch Face Themes", |
| 644 | + "feedbackMaxImagesLimit": "Up to {count} images or videos can be uploaded", | ||
| 645 | + "@feedbackMaxImagesLimit": { | ||
| 646 | + "description": "Feedback upload images/videos limit hint", | ||
| 647 | + "placeholders": { | ||
| 648 | + "count": { | ||
| 649 | + "type": "int" | ||
| 650 | + } | ||
| 651 | + } | ||
| 652 | + }, | ||
| 653 | + "feedbackSelectImageError": "Unable to select images, please try again later", | ||
| 654 | + "feedbackEmptyContentHint": "Please enter questions and feedback", | ||
| 655 | + "feedbackInvalidEmail": "Invalid email format, please enter again", | ||
| 656 | + "feedbackSubmitSuccessTitle": "Feedback submitted successfully", | ||
| 657 | + "feedbackSubmitSuccessMessage": "Thank you for your feedback. If further communication is needed, we will contact you via the email address you left as soon as possible. Please keep an eye on your inbox.", | ||
| 658 | + "feedbackSubmitSuccessConfirm": "OK" | ||
| 644 | } | 659 | } |
| @@ -928,5 +928,20 @@ | @@ -928,5 +928,20 @@ | ||
| 928 | "watchThemeIncomplete": "主题信息不完整", | 928 | "watchThemeIncomplete": "主题信息不完整", |
| 929 | "watchThemeApplyFailed": "应用主题失败", | 929 | "watchThemeApplyFailed": "应用主题失败", |
| 930 | "watchThemeWatchSyncFailed": "表盘同步失败", | 930 | "watchThemeWatchSyncFailed": "表盘同步失败", |
| 931 | - "watchThemePurchaseChannel": "表盘主题" | 931 | + "watchThemePurchaseChannel": "表盘主题", |
| 932 | + "feedbackMaxImagesLimit": "最多上传{count}个图片或视频", | ||
| 933 | + "@feedbackMaxImagesLimit": { | ||
| 934 | + "description": "反馈上传图片或视频的最大限制提示", | ||
| 935 | + "placeholders": { | ||
| 936 | + "count": { | ||
| 937 | + "type": "int" | ||
| 938 | + } | ||
| 939 | + } | ||
| 940 | + }, | ||
| 941 | + "feedbackSelectImageError": "无法选择图片,请稍后重试", | ||
| 942 | + "feedbackEmptyContentHint": "请输入问题和反馈", | ||
| 943 | + "feedbackInvalidEmail": "邮箱格式错误,请重新输入", | ||
| 944 | + "feedbackSubmitSuccessTitle": "反馈提交成功", | ||
| 945 | + "feedbackSubmitSuccessMessage": "谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。", | ||
| 946 | + "feedbackSubmitSuccessConfirm": "好的" | ||
| 932 | } | 947 | } |
| @@ -3758,6 +3758,48 @@ abstract class AppLocalizations { | @@ -3758,6 +3758,48 @@ abstract class AppLocalizations { | ||
| 3758 | /// In zh, this message translates to: | 3758 | /// In zh, this message translates to: |
| 3759 | /// **'表盘主题'** | 3759 | /// **'表盘主题'** |
| 3760 | String get watchThemePurchaseChannel; | 3760 | String get watchThemePurchaseChannel; |
| 3761 | + | ||
| 3762 | + /// 反馈上传图片或视频的最大限制提示 | ||
| 3763 | + /// | ||
| 3764 | + /// In zh, this message translates to: | ||
| 3765 | + /// **'最多上传{count}个图片或视频'** | ||
| 3766 | + String feedbackMaxImagesLimit(int count); | ||
| 3767 | + | ||
| 3768 | + /// No description provided for @feedbackSelectImageError. | ||
| 3769 | + /// | ||
| 3770 | + /// In zh, this message translates to: | ||
| 3771 | + /// **'无法选择图片,请稍后重试'** | ||
| 3772 | + String get feedbackSelectImageError; | ||
| 3773 | + | ||
| 3774 | + /// No description provided for @feedbackEmptyContentHint. | ||
| 3775 | + /// | ||
| 3776 | + /// In zh, this message translates to: | ||
| 3777 | + /// **'请输入问题和反馈'** | ||
| 3778 | + String get feedbackEmptyContentHint; | ||
| 3779 | + | ||
| 3780 | + /// No description provided for @feedbackInvalidEmail. | ||
| 3781 | + /// | ||
| 3782 | + /// In zh, this message translates to: | ||
| 3783 | + /// **'邮箱格式错误,请重新输入'** | ||
| 3784 | + String get feedbackInvalidEmail; | ||
| 3785 | + | ||
| 3786 | + /// No description provided for @feedbackSubmitSuccessTitle. | ||
| 3787 | + /// | ||
| 3788 | + /// In zh, this message translates to: | ||
| 3789 | + /// **'反馈提交成功'** | ||
| 3790 | + String get feedbackSubmitSuccessTitle; | ||
| 3791 | + | ||
| 3792 | + /// No description provided for @feedbackSubmitSuccessMessage. | ||
| 3793 | + /// | ||
| 3794 | + /// In zh, this message translates to: | ||
| 3795 | + /// **'谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。'** | ||
| 3796 | + String get feedbackSubmitSuccessMessage; | ||
| 3797 | + | ||
| 3798 | + /// No description provided for @feedbackSubmitSuccessConfirm. | ||
| 3799 | + /// | ||
| 3800 | + /// In zh, this message translates to: | ||
| 3801 | + /// **'好的'** | ||
| 3802 | + String get feedbackSubmitSuccessConfirm; | ||
| 3761 | } | 3803 | } |
| 3762 | 3804 | ||
| 3763 | class _AppLocalizationsDelegate | 3805 | class _AppLocalizationsDelegate |
| @@ -2088,4 +2088,29 @@ class AppLocalizationsEn extends AppLocalizations { | @@ -2088,4 +2088,29 @@ class AppLocalizationsEn extends AppLocalizations { | ||
| 2088 | 2088 | ||
| 2089 | @override | 2089 | @override |
| 2090 | String get watchThemePurchaseChannel => 'Watch Face Themes'; | 2090 | String get watchThemePurchaseChannel => 'Watch Face Themes'; |
| 2091 | + | ||
| 2092 | + @override | ||
| 2093 | + String feedbackMaxImagesLimit(int count) { | ||
| 2094 | + return 'Up to $count images or videos can be uploaded'; | ||
| 2095 | + } | ||
| 2096 | + | ||
| 2097 | + @override | ||
| 2098 | + String get feedbackSelectImageError => | ||
| 2099 | + 'Unable to select images, please try again later'; | ||
| 2100 | + | ||
| 2101 | + @override | ||
| 2102 | + String get feedbackEmptyContentHint => 'Please enter questions and feedback'; | ||
| 2103 | + | ||
| 2104 | + @override | ||
| 2105 | + String get feedbackInvalidEmail => 'Invalid email format, please enter again'; | ||
| 2106 | + | ||
| 2107 | + @override | ||
| 2108 | + String get feedbackSubmitSuccessTitle => 'Feedback submitted successfully'; | ||
| 2109 | + | ||
| 2110 | + @override | ||
| 2111 | + String get feedbackSubmitSuccessMessage => | ||
| 2112 | + 'Thank you for your feedback. If further communication is needed, we will contact you via the email address you left as soon as possible. Please keep an eye on your inbox.'; | ||
| 2113 | + | ||
| 2114 | + @override | ||
| 2115 | + String get feedbackSubmitSuccessConfirm => 'OK'; | ||
| 2091 | } | 2116 | } |
| @@ -1979,4 +1979,28 @@ class AppLocalizationsZh extends AppLocalizations { | @@ -1979,4 +1979,28 @@ class AppLocalizationsZh extends AppLocalizations { | ||
| 1979 | 1979 | ||
| 1980 | @override | 1980 | @override |
| 1981 | String get watchThemePurchaseChannel => '表盘主题'; | 1981 | String get watchThemePurchaseChannel => '表盘主题'; |
| 1982 | + | ||
| 1983 | + @override | ||
| 1984 | + String feedbackMaxImagesLimit(int count) { | ||
| 1985 | + return '最多上传$count个图片或视频'; | ||
| 1986 | + } | ||
| 1987 | + | ||
| 1988 | + @override | ||
| 1989 | + String get feedbackSelectImageError => '无法选择图片,请稍后重试'; | ||
| 1990 | + | ||
| 1991 | + @override | ||
| 1992 | + String get feedbackEmptyContentHint => '请输入问题和反馈'; | ||
| 1993 | + | ||
| 1994 | + @override | ||
| 1995 | + String get feedbackInvalidEmail => '邮箱格式错误,请重新输入'; | ||
| 1996 | + | ||
| 1997 | + @override | ||
| 1998 | + String get feedbackSubmitSuccessTitle => '反馈提交成功'; | ||
| 1999 | + | ||
| 2000 | + @override | ||
| 2001 | + String get feedbackSubmitSuccessMessage => | ||
| 2002 | + '谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。'; | ||
| 2003 | + | ||
| 2004 | + @override | ||
| 2005 | + String get feedbackSubmitSuccessConfirm => '好的'; | ||
| 1982 | } | 2006 | } |
-
Please register or login to post a comment