From aa7a8c422ef850b43da7760c7ef9548fb0733d32 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 17 Feb 2024 15:02:14 -0800 Subject: [PATCH] Fixed merge conflicts --- assets/i18n/en_US.json | 0 assets/i18n/strings.i18n.json | 12 ++++++++- lib/services/manager_api.dart | 27 ++++++++----------- lib/ui/widgets/appInfoView/app_info_view.dart | 17 +++++------- .../appInfoView/app_info_viewmodel.dart | 8 +++--- .../widgets/homeView/patch_history_card.dart | 24 +++++++---------- .../settingsView/settings_patch_history.dart | 17 +++++------- 7 files changed, 50 insertions(+), 55 deletions(-) delete mode 100644 assets/i18n/en_US.json diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/assets/i18n/strings.i18n.json b/assets/i18n/strings.i18n.json index 667a8bf78d..78006cf1d7 100755 --- a/assets/i18n/strings.i18n.json +++ b/assets/i18n/strings.i18n.json @@ -27,10 +27,12 @@ "refreshSuccess": "Refreshed successfully", "widgetTitle": "Dashboard", "updatesSubtitle": "Updates", - "patchedSubtitle": "Patched apps", + "patchHistorySubtitle": "Last patch", + "patchedSubtitle": "Installed apps", "changeLaterSubtitle": "You can change this in the settings at a later time.", "noUpdates": "No updates available", "WIP": "Work in progress...", + "noHistory": "No app found", "noInstallations": "No patched apps installed", "installUpdate": "Continue to install the update?", "updateSheetTitle": "Update ReVanced Manager", @@ -201,6 +203,8 @@ "showUpdateDialogHint": "Show a dialog when a new update is available", "universalPatchesLabel": "Show universal patches", "universalPatchesHint": "Display all apps and universal patches (may slow down the app list)", + "patchHistoryLabel": "Save patched app", + "patchHistoryHint": "Save the last patch to install or export later", "versionCompatibilityCheckLabel": "Version compatibility check", "versionCompatibilityCheckHint": "Prevent selecting patches that are not compatible with the selected app version", "requireSuggestedAppVersionLabel": "Require suggested app version", @@ -252,18 +256,24 @@ "appInfoView": { "widgetTitle": "App info", "openButton": "Open", + "installButton": "Install", "uninstallButton": "Uninstall", "unmountButton": "Unmount", + "exportButton": "Export", + "deleteButton": "Delete", "rootDialogTitle": "Error", "unmountDialogText": "Are you sure you want to unmount this app?", "uninstallDialogText": "Are you sure you want to uninstall this app?", "rootDialogText": "App was installed with superuser permissions, but currently ReVanced Manager has no permissions.\nPlease grant superuser permissions first.", + "removeAppDialogTitle": "Delete app?", + "removeAppDialogText": "Are you sure you want to delete this app?", "packageNameLabel": "Package name", "installTypeLabel": "Installation type", "mountTypeLabel": "Mount", "regularTypeLabel": "Regular", "patchedDateLabel": "Patched date", "appliedPatchesLabel": "Applied patches", + "sizeLabel": "File size", "patchedDateHint": "${date} at ${time}", "appliedPatchesHint": "${quantity} applied patches", "updateNotImplemented": "This feature has not been implemented yet" diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index 41a897d34d..bade68ddf1 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -831,9 +831,7 @@ class ManagerAPI { context: context, barrierDismissible: false, builder: (context) => AlertDialog( - title: I18nText( - 'installerView.installType', - ), + title: Text(t.installerView.installType), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, icon: const Icon(Icons.file_download_outlined), contentPadding: const EdgeInsets.symmetric(vertical: 16), @@ -850,20 +848,17 @@ class ManagerAPI { horizontal: 20, vertical: 10, ), - child: I18nText( - 'installerView.installTypeDescription', - child: Text( - '', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Theme.of(context).colorScheme.secondary, - ), + child: Text( + t.installerView.installTypeDescription, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme.of(context).colorScheme.secondary, ), ), ), RadioListTile( - title: I18nText('installerView.installNonRootType'), + title: Text(t.installerView.installNonRootType), contentPadding: const EdgeInsets.symmetric(horizontal: 16), value: 0, @@ -873,7 +868,7 @@ class ManagerAPI { }, ), RadioListTile( - title: I18nText('installerView.installRootType'), + title: Text(t.installerView.installRootType), contentPadding: const EdgeInsets.symmetric(horizontal: 16), value: 1, @@ -889,13 +884,13 @@ class ManagerAPI { ), actions: [ OutlinedButton( - child: I18nText('cancelButton'), + child: Text(t.cancelButton), onPressed: () { Navigator.of(context).pop(); }, ), FilledButton( - child: I18nText('installerView.installButton'), + child: Text(t.installerView.installButton), onPressed: () { Navigator.of(context).pop(); }, diff --git a/lib/ui/widgets/appInfoView/app_info_view.dart b/lib/ui/widgets/appInfoView/app_info_view.dart index 2502927c73..b423fead56 100644 --- a/lib/ui/widgets/appInfoView/app_info_view.dart +++ b/lib/ui/widgets/appInfoView/app_info_view.dart @@ -187,16 +187,13 @@ class AppInfoView extends StatelessWidget { .primary, ), const SizedBox(height: 10), - I18nText( - 'appInfoView.deleteButton', - child: Text( - '', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .primary, - fontWeight: FontWeight.bold, - ), + Text( + t.appInfoView.deleteButton, + style: TextStyle( + color: Theme.of(context) + .colorScheme + .primary, + fontWeight: FontWeight.bold, ), ), ], diff --git a/lib/ui/widgets/appInfoView/app_info_viewmodel.dart b/lib/ui/widgets/appInfoView/app_info_viewmodel.dart index e04fc89cec..b5ec82cae6 100644 --- a/lib/ui/widgets/appInfoView/app_info_viewmodel.dart +++ b/lib/ui/widgets/appInfoView/app_info_viewmodel.dart @@ -148,16 +148,16 @@ class AppInfoViewModel extends BaseViewModel { return showDialog( context: context, builder: (context) => AlertDialog( - title: I18nText('appInfoView.removeAppDialogTitle'), + title: Text(t.appInfoView.removeAppDialogTitle), backgroundColor: Theme.of(context).colorScheme.secondaryContainer, - content: I18nText('appInfoView.removeAppDialogText'), + content: Text(t.appInfoView.removeAppDialogText), actions: [ OutlinedButton( - child: I18nText('cancelButton'), + child: Text(t.cancelButton), onPressed: () => Navigator.of(context).pop(), ), FilledButton( - child: I18nText('okButton'), + child: Text(t.okButton), onPressed: () => { _managerAPI.deleteLastPatchedApp(), Navigator.of(context)..pop()..pop(), diff --git a/lib/ui/widgets/homeView/patch_history_card.dart b/lib/ui/widgets/homeView/patch_history_card.dart index 0a34e7bf12..3f8e929dc4 100644 --- a/lib/ui/widgets/homeView/patch_history_card.dart +++ b/lib/ui/widgets/homeView/patch_history_card.dart @@ -1,7 +1,7 @@ import 'package:device_apps/device_apps.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/app/app.locator.dart'; +import 'package:revanced_manager/gen/strings.g.dart'; import 'package:revanced_manager/models/patched_application.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; @@ -26,19 +26,15 @@ class PatchHistoryCard extends StatelessWidget { color: Theme.of(context).colorScheme.secondary, ), const SizedBox(height: 16), - I18nText( - 'homeView.noHistory', - child: Text( - '', - textAlign: TextAlign.center, - style: Theme.of(context) - .textTheme - .titleMedium! - .copyWith( - color: - Theme.of(context).colorScheme.secondary, - ), - ), + Text( + t.homeView.noHistory, + style: Theme.of(context) + .textTheme + .titleMedium! + .copyWith( + color: + Theme.of(context).colorScheme.secondary, + ), ), ], ), diff --git a/lib/ui/widgets/settingsView/settings_patch_history.dart b/lib/ui/widgets/settingsView/settings_patch_history.dart index 30f9e1a58d..9da40f5e11 100644 --- a/lib/ui/widgets/settingsView/settings_patch_history.dart +++ b/lib/ui/widgets/settingsView/settings_patch_history.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; +import 'package:revanced_manager/gen/strings.g.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; class SPatchHistory extends StatefulWidget { @@ -18,17 +18,14 @@ class _SPatchHistoryState Widget build(BuildContext context) { return SwitchListTile( contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), - title: I18nText( - 'settingsView.patchHistoryLabel', - child: const Text( - '', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - ), + title: Text( + t.settingsView.patchHistoryLabel, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.w500, ), ), - subtitle: I18nText('settingsView.patchHistoryHint'), + subtitle: Text(t.settingsView.patchHistoryHint), value: _settingsViewModel.isPatchHistoryEnabled(), onChanged: (value) { setState(() {