Commit 71be496b65df3213cd4395688243289477074402

Authored by 权海
1 parent cb157457

feat(ui):watch theme国际化文本

... ... @@ -10,7 +10,6 @@ import 'package:doublefeel_flutter/pigeon/platform_api.g.dart';
import 'package:doublefeel_flutter/pigeon/wear_engine_api.g.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_cropper/image_cropper.dart';
import 'package:image_picker/image_picker.dart';
import 'package:path_provider/path_provider.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
... ...
import 'dart:async';
import 'package:doublefeel_flutter/app/modules/friends/data/friends_repository.dart';
import 'package:doublefeel_flutter/app/modules/watch_theme/models/watch_device_extension.dart';
import 'package:doublefeel_flutter/app/modules/watch_theme/services/watch_theme_sync_payload_builder.dart';
import 'package:doublefeel_flutter/core/network/api/friend_api.dart';
import 'package:doublefeel_flutter/core/network/api/theme_api.dart';
... ... @@ -223,15 +222,15 @@ class CustomWatchThemePreviewController extends GetxController {
var syncSuccess = false;
try {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
syncSuccess = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
return true;
} catch (_) {
// The active theme is already saved on the server.
... ...
... ... @@ -7,6 +7,7 @@ import 'package:doublefeel_flutter/core/network/api/vip_api.dart';
import 'package:doublefeel_flutter/core/result/app_result.dart';
import 'package:doublefeel_flutter/data/local/user_preferences_storage.dart';
import 'package:doublefeel_flutter/data/models/local/user_preferences.dart';
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:get/get.dart';
import '../models/watch_theme_models.dart';
... ... @@ -94,7 +95,7 @@ class WatchThemeController extends GetxController {
Future<void> _toPremiumPage() async {
await Get.toNamed(Routes.PURCHASE, arguments: {
IntentKeys.channelType: "表盘主题",
IntentKeys.channelType: l10n.watchThemePurchaseChannel,
});
await _refreshVip();
}
... ...
import 'dart:async';
import 'package:doublefeel_flutter/app/modules/friends/data/friends_repository.dart';
import 'package:doublefeel_flutter/app/modules/watch_theme/models/watch_device_extension.dart';
import 'package:doublefeel_flutter/app/modules/watch_theme/services/watch_theme_sync_payload_builder.dart';
import 'package:doublefeel_flutter/core/network/api/friend_api.dart';
import 'package:doublefeel_flutter/core/network/api/theme_api.dart';
... ... @@ -194,15 +193,15 @@ class WatchThemePreviewController extends GetxController {
var syncSuccess = false;
try {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
final result = await _themeApi.applyTheme(themeId);
if (result is! AppSuccess<void>) {
syncSuccess = await WearEngineHostApi().syncWatchTheme(downloadedTheme);
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
AppToast.show(l10n.watchThemeApplyFailed);
return false;
}
selectedThemeItem.value = themeItem;
isApplying.value = false;
return true;
} catch (_) {
// The active theme is already saved on the server.
... ...
import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
import 'package:doublefeel_flutter/pigeon/wear_engine_api.g.dart';
extension WatchDeviceExtension on WearDeviceInfo {
String? get connectedDeviceDesc {
if (isPaired != true) {
return '手表未配对';
return l10n.watchThemeWatchNotPaired;
}
if (isReachable != true) {
return '手表数据无法传递';
return l10n.watchThemeWatchDataUnavailable;
}
if (isWatchAppInstalled != true) {
return 'watch app未安装';
return l10n.watchThemeWatchAppNotInstalled;
}
return null;
}
... ...
... ... @@ -686,6 +686,9 @@
"watchThemeIncomplete": "Theme information is incomplete",
"watchThemeApplyFailed": "Failed to apply theme",
"watchThemeWatchSyncFailed": "Watch face sync failed",
"watchThemeWatchNotPaired": "Watch not paired",
"watchThemeWatchDataUnavailable": "Watch data is unavailable",
"watchThemeWatchAppNotInstalled": "Watch app is not installed",
"watchThemePurchaseChannel": "Watch Face Themes",
"feedbackMaxImagesLimit": "Up to {count} images or videos can be uploaded",
"@feedbackMaxImagesLimit": {
... ... @@ -782,4 +785,4 @@
}
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -1079,6 +1079,9 @@
"watchThemeIncomplete": "主题信息不完整",
"watchThemeApplyFailed": "应用主题失败",
"watchThemeWatchSyncFailed": "表盘同步失败",
"watchThemeWatchNotPaired": "手表未配对",
"watchThemeWatchDataUnavailable": "手表数据无法传递",
"watchThemeWatchAppNotInstalled": "Watch App 未安装",
"watchThemePurchaseChannel": "表盘主题",
"feedbackMaxImagesLimit": "最多上传{count}个图片或视频",
"@feedbackMaxImagesLimit": {
... ... @@ -1175,4 +1178,4 @@
}
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -3981,6 +3981,24 @@ abstract class AppLocalizations {
/// **'表盘同步失败'**
String get watchThemeWatchSyncFailed;
/// No description provided for @watchThemeWatchNotPaired.
///
/// In zh, this message translates to:
/// **'手表未配对'**
String get watchThemeWatchNotPaired;
/// No description provided for @watchThemeWatchDataUnavailable.
///
/// In zh, this message translates to:
/// **'手表数据无法传递'**
String get watchThemeWatchDataUnavailable;
/// No description provided for @watchThemeWatchAppNotInstalled.
///
/// In zh, this message translates to:
/// **'Watch App 未安装'**
String get watchThemeWatchAppNotInstalled;
/// No description provided for @watchThemePurchaseChannel.
///
/// In zh, this message translates to:
... ...
... ... @@ -2222,6 +2222,15 @@ class AppLocalizationsEn extends AppLocalizations {
String get watchThemeWatchSyncFailed => 'Watch face sync failed';
@override
String get watchThemeWatchNotPaired => 'Watch not paired';
@override
String get watchThemeWatchDataUnavailable => 'Watch data is unavailable';
@override
String get watchThemeWatchAppNotInstalled => 'Watch app is not installed';
@override
String get watchThemePurchaseChannel => 'Watch Face Themes';
@override
... ...
... ... @@ -2125,6 +2125,15 @@ class AppLocalizationsZh extends AppLocalizations {
String get watchThemeWatchSyncFailed => '表盘同步失败';
@override
String get watchThemeWatchNotPaired => '手表未配对';
@override
String get watchThemeWatchDataUnavailable => '手表数据无法传递';
@override
String get watchThemeWatchAppNotInstalled => 'Watch App 未安装';
@override
String get watchThemePurchaseChannel => '表盘主题';
@override
... ...