Commit de22e9be82076beab8b140d95ada3c5771090da8

Authored by 常守达
1 parent 777787e2

fix(feedback):国际化

... ... @@ -3,6 +3,7 @@ import 'package:doublefeel_flutter/app/utils/dialog_utils.dart';
import 'package:doublefeel_flutter/core/network/api/user_api.dart';
import 'package:doublefeel_flutter/core/result/app_result.dart';
import 'package:doublefeel_flutter/core/util/app_toast.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:doublefeel_flutter/pigeon/platform_api.g.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
... ... @@ -35,7 +36,7 @@ class SubmitFeedbackController extends GetxController {
Future<void> pickImages() async {
final remainingCount = maxImageCount - selectedImages.length;
if (remainingCount <= 0) {
AppToast.show('最多上传5个图片或视频');
AppToast.show(l10n.feedbackMaxImagesLimit(maxImageCount));
return;
}
... ... @@ -46,7 +47,7 @@ class SubmitFeedbackController extends GetxController {
imageQuality: 85,
);
} catch (_) {
AppToast.show('无法选择图片,请稍后重试');
AppToast.show(l10n.feedbackSelectImageError);
return;
}
... ... @@ -65,12 +66,12 @@ class SubmitFeedbackController extends GetxController {
Future<void> submit() async {
if (feedbackTextController.text.trim().isEmpty) {
AppToast.show('请输入问题和反馈');
AppToast.show(l10n.feedbackEmptyContentHint);
return;
}
final email = contactTextController.text.trim();
if (email.isNotEmpty && !_emailRegExp.hasMatch(email)) {
AppToast.show('邮箱格式错误,请重新输入');
AppToast.show(l10n.feedbackInvalidEmail);
return;
}
Get.dialog(
... ... @@ -105,9 +106,9 @@ class SubmitFeedbackController extends GetxController {
case AppSuccess():
await DialogUtils.showCommonDialog(DialogMetaData(
iconAsset: null,
title: '反馈提交成功',
message: '谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。',
confirmText: '好的',
title: l10n.feedbackSubmitSuccessTitle,
message: l10n.feedbackSubmitSuccessMessage,
confirmText: l10n.feedbackSubmitSuccessConfirm,
));
Get.back();
case AppFailure(:final error):
... ...
... ... @@ -640,5 +640,20 @@
"watchThemeIncomplete": "Theme information is incomplete",
"watchThemeApplyFailed": "Failed to apply theme",
"watchThemeWatchSyncFailed": "Watch face sync failed",
"watchThemePurchaseChannel": "Watch Face Themes"
"watchThemePurchaseChannel": "Watch Face Themes",
"feedbackMaxImagesLimit": "Up to {count} images or videos can be uploaded",
"@feedbackMaxImagesLimit": {
"description": "Feedback upload images/videos limit hint",
"placeholders": {
"count": {
"type": "int"
}
}
},
"feedbackSelectImageError": "Unable to select images, please try again later",
"feedbackEmptyContentHint": "Please enter questions and feedback",
"feedbackInvalidEmail": "Invalid email format, please enter again",
"feedbackSubmitSuccessTitle": "Feedback submitted successfully",
"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.",
"feedbackSubmitSuccessConfirm": "OK"
}
... ...
... ... @@ -928,5 +928,20 @@
"watchThemeIncomplete": "主题信息不完整",
"watchThemeApplyFailed": "应用主题失败",
"watchThemeWatchSyncFailed": "表盘同步失败",
"watchThemePurchaseChannel": "表盘主题"
"watchThemePurchaseChannel": "表盘主题",
"feedbackMaxImagesLimit": "最多上传{count}个图片或视频",
"@feedbackMaxImagesLimit": {
"description": "反馈上传图片或视频的最大限制提示",
"placeholders": {
"count": {
"type": "int"
}
}
},
"feedbackSelectImageError": "无法选择图片,请稍后重试",
"feedbackEmptyContentHint": "请输入问题和反馈",
"feedbackInvalidEmail": "邮箱格式错误,请重新输入",
"feedbackSubmitSuccessTitle": "反馈提交成功",
"feedbackSubmitSuccessMessage": "谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。",
"feedbackSubmitSuccessConfirm": "好的"
}
... ...
... ... @@ -3758,6 +3758,48 @@ abstract class AppLocalizations {
/// In zh, this message translates to:
/// **'表盘主题'**
String get watchThemePurchaseChannel;
/// 反馈上传图片或视频的最大限制提示
///
/// In zh, this message translates to:
/// **'最多上传{count}个图片或视频'**
String feedbackMaxImagesLimit(int count);
/// No description provided for @feedbackSelectImageError.
///
/// In zh, this message translates to:
/// **'无法选择图片,请稍后重试'**
String get feedbackSelectImageError;
/// No description provided for @feedbackEmptyContentHint.
///
/// In zh, this message translates to:
/// **'请输入问题和反馈'**
String get feedbackEmptyContentHint;
/// No description provided for @feedbackInvalidEmail.
///
/// In zh, this message translates to:
/// **'邮箱格式错误,请重新输入'**
String get feedbackInvalidEmail;
/// No description provided for @feedbackSubmitSuccessTitle.
///
/// In zh, this message translates to:
/// **'反馈提交成功'**
String get feedbackSubmitSuccessTitle;
/// No description provided for @feedbackSubmitSuccessMessage.
///
/// In zh, this message translates to:
/// **'谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。'**
String get feedbackSubmitSuccessMessage;
/// No description provided for @feedbackSubmitSuccessConfirm.
///
/// In zh, this message translates to:
/// **'好的'**
String get feedbackSubmitSuccessConfirm;
}
class _AppLocalizationsDelegate
... ...
... ... @@ -2088,4 +2088,29 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get watchThemePurchaseChannel => 'Watch Face Themes';
@override
String feedbackMaxImagesLimit(int count) {
return 'Up to $count images or videos can be uploaded';
}
@override
String get feedbackSelectImageError =>
'Unable to select images, please try again later';
@override
String get feedbackEmptyContentHint => 'Please enter questions and feedback';
@override
String get feedbackInvalidEmail => 'Invalid email format, please enter again';
@override
String get feedbackSubmitSuccessTitle => 'Feedback submitted successfully';
@override
String get 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.';
@override
String get feedbackSubmitSuccessConfirm => 'OK';
}
... ...
... ... @@ -1979,4 +1979,28 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get watchThemePurchaseChannel => '表盘主题';
@override
String feedbackMaxImagesLimit(int count) {
return '最多上传$count个图片或视频';
}
@override
String get feedbackSelectImageError => '无法选择图片,请稍后重试';
@override
String get feedbackEmptyContentHint => '请输入问题和反馈';
@override
String get feedbackInvalidEmail => '邮箱格式错误,请重新输入';
@override
String get feedbackSubmitSuccessTitle => '反馈提交成功';
@override
String get feedbackSubmitSuccessMessage =>
'谢谢您的反馈。如需进一步沟通,我们会尽快通过您留下的邮箱地址与您联系,请留意查收邮件。';
@override
String get feedbackSubmitSuccessConfirm => '好的';
}
... ...