From 84920bfa58b3fdd363ca73c12ca0de74df0ceb59 Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Thu, 7 Sep 2023 01:56:59 +0330 Subject: [PATCH] Remove string casing --- assets/translations/strings.i18n.json | 110 +++++++++--------- assets/translations/strings_fa.i18n.json | 4 +- lib/features/about/view/about_page.dart | 11 +- lib/features/common/new_version_dialog.dart | 9 +- lib/features/common/profile_tile.dart | 11 +- lib/features/common/stats/stats_overview.dart | 13 +-- lib/features/home/view/home_page.dart | 4 +- .../home/widgets/connection_button.dart | 3 +- .../widgets/empty_profiles_home_body.dart | 9 +- lib/features/logs/view/logs_page.dart | 18 +-- .../view/profile_detail_page.dart | 22 ++-- .../profiles/view/add_profile_modal.dart | 16 ++- .../profiles/view/profiles_modal.dart | 7 +- lib/features/proxies/view/proxies_page.dart | 13 +-- .../wrapper/view/desktop_wrapper.dart | 11 +- lib/features/wrapper/view/mobile_wrapper.dart | 11 +- pubspec.lock | 2 +- pubspec.yaml | 1 - 18 files changed, 126 insertions(+), 149 deletions(-) diff --git a/assets/translations/strings.i18n.json b/assets/translations/strings.i18n.json index 054962f1..0410657c 100644 --- a/assets/translations/strings.i18n.json +++ b/assets/translations/strings.i18n.json @@ -1,83 +1,82 @@ { "general": { "appTitle": "Hiddify Next", - "reset": "reset", + "reset": "Reset", "toggle": { - "enabled": "enabled", - "disabled": "disabled" + "enabled": "Enabled", + "disabled": "Disabled" }, - "sort": "sort", - "sortBy": "sort by" + "sort": "Sort", + "sortBy": "Sort by" }, "home": { - "pageTitle": "home", - "emptyProfilesMsg": "start by adding subscription profile", - "noActiveProfileMsg": "select a profile", + "pageTitle": "Home", + "emptyProfilesMsg": "Start by adding subscription profile", + "noActiveProfileMsg": "Select a profile", "connection": { - "tapToConnect": "tap to connect", - "connecting": "connecting", - "disconnecting": "disconnecting", - "connected": "connected" + "tapToConnect": "Tap to Connect", + "connecting": "Connecting", + "disconnecting": "Disconnecting", + "connected": "Connected" }, "stats": { - "traffic": "traffic", - "trafficTotal": "traffic total", - "uplink": "uplink", - "downlink": "downlink" + "traffic": "Traffic", + "trafficTotal": "Traffic total", + "uplink": "Uplink", + "downlink": "Downlink" } }, "profile": { - "overviewPageTitle": "profiles", - "detailsPageTitle": "profile", + "overviewPageTitle": "Profiles", + "detailsPageTitle": "Profile", "subscription": { - "traffic": "traffic", - "updatedTimeAgo": "updated ${timeago}", + "traffic": "Traffic", + "updatedTimeAgo": "Updated ${timeago}", "remainingDuration": "${duration} days remaining", - "expired": "expired", - "noTraffic": "no traffic", - "gigaByte": "GB" + "expired": "Expired", + "noTraffic": "No traffic" }, "sortBy": { "lastUpdate": "Recently updated", "name": "by Name" }, "add": { - "buttonText": "add new profile", - "shortBtnTxt": "add new", - "fromClipboard": "add from clipboard", + "buttonText": "Add New Profile", + "shortBtnTxt": "Add New", + "fromClipboard": "Add From Clipboard", "scanQr": "Scan QR code", - "manually": "add manually", - "addingProfileMsg": "adding profile", - "invalidUrlMsg": "unexpected url" + "manually": "Add Manually", + "addingProfileMsg": "Adding Profile", + "invalidUrlMsg": "Unexpected URL" }, "update": { - "buttonTxt": "update", + "buttonTxt": "Update", "tooltip": "update profile", - "failureMsg": "failed to update profile: ${reason}", - "successMsg": "successfully updated profile" + "failureMsg": "Failed to update profile: ${reason}", + "successMsg": "Successfully updated profile" }, "edit": { - "buttonTxt": "edit" + "buttonTxt": "Edit" }, "delete": { - "buttonTxt": "delete", - "confirmationMsg": "delete profile for ever? this can not be undone", - "successMsg": "successfully deleted profile" + "buttonTxt": "Delete", + "confirmationMsg": "Delete profile for ever? This can not be undone", + "successMsg": "Successfully deleted profile" }, "save": { - "buttonText": "save", - "successMsg": "successfully saved profile" + "buttonText": "Save", + "successMsg": "Successfully saved profile" }, "detailsForm": { - "nameHint": "name", - "urlHint": "url", - "emptyNameMsg": "name can't be empty", - "invalidUrlMsg": "invalid URL" + "nameHint": "Name", + "urlHint": "URL", + "emptyNameMsg": "Name can't be empty", + "invalidUrlMsg": "Invalid URL" } }, "proxies": { - "pageTitle": "proxies", - "emptyProxiesMsg": "no proxies", + "pageTitle": "Proxies", + "emptyProxiesMsg": "No Proxies", "delayTestTooltip": "delay test", "sortTooltip": "sort proxies", "sortOptions": { @@ -87,12 +86,12 @@ } }, "logs": { - "pageTitle": "logs", - "clearLogsButtonText": "clear", - "filterHint": "filter", - "allLevelsFilter": "all", - "shareCoreLogs": "share core logs", - "shareAppLogs": "share app logs" + "pageTitle": "Logs", + "clearLogsButtonText": "Clear", + "filterHint": "Filter", + "allLevelsFilter": "All", + "shareCoreLogs": "Share core logs", + "shareAppLogs": "Share app logs" }, "settings": { "pageTitle": "Settings", @@ -150,12 +149,11 @@ } }, "about": { - "pageTitle": "about", - "version": "version", - "whatsNew": "what's new", - "sourceCode": "source code", - "telegramChannel": "telegram channel", - "checkForUpdate": "check for update" + "pageTitle": "About", + "version": "Version", + "sourceCode": "Source Code", + "telegramChannel": "Telegram Channel", + "checkForUpdate": "Check for update" }, "appUpdate": { "dialogTitle": "Update Available", diff --git a/assets/translations/strings_fa.i18n.json b/assets/translations/strings_fa.i18n.json index 3ece366a..16a4bb80 100644 --- a/assets/translations/strings_fa.i18n.json +++ b/assets/translations/strings_fa.i18n.json @@ -34,8 +34,7 @@ "updatedTimeAgo": "بروزرسانی شده در ${timeago}", "remainingDuration": "${duration} روز باقی مانده", "expired": "منقضی شده", - "noTraffic": "پایان ترافیک", - "gigaByte": "گیگ" + "noTraffic": "پایان ترافیک" }, "sortBy": { "lastUpdate": "اخیرا بروز شده", @@ -152,7 +151,6 @@ "about": { "pageTitle": "درباره", "version": "ورژن", - "whatsNew": "تغییرات", "sourceCode": "سورس کد", "telegramChannel": "کانال تلگرام", "checkForUpdate": "بررسی آپدیت جدید" diff --git a/lib/features/about/view/about_page.dart b/lib/features/about/view/about_page.dart index bb4bd258..a9467d20 100644 --- a/lib/features/about/view/about_page.dart +++ b/lib/features/about/view/about_page.dart @@ -9,7 +9,6 @@ import 'package:hiddify/gen/assets.gen.dart'; import 'package:hiddify/services/service_providers.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class AboutPage extends HookConsumerWidget { const AboutPage({super.key}); @@ -52,7 +51,7 @@ class AboutPage extends HookConsumerWidget { body: CustomScrollView( slivers: [ SliverAppBar( - title: Text(t.about.pageTitle.titleCase), + title: Text(t.about.pageTitle), ), ...switch (appVersion) { AsyncData(:final value) => [ @@ -68,7 +67,7 @@ class AboutPage extends HookConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - t.general.appTitle.titleCase, + t.general.appTitle, style: Theme.of(context).textTheme.titleLarge, ), const Gap(4), @@ -85,7 +84,7 @@ class AboutPage extends HookConsumerWidget { delegate: SliverChildListDelegate( [ ListTile( - title: Text(t.about.sourceCode.sentenceCase), + title: Text(t.about.sourceCode), trailing: const Icon(Icons.open_in_new), onTap: () async { await UriUtils.tryLaunch( @@ -94,7 +93,7 @@ class AboutPage extends HookConsumerWidget { }, ), ListTile( - title: Text(t.about.telegramChannel.sentenceCase), + title: Text(t.about.telegramChannel), trailing: const Icon(Icons.open_in_new), onTap: () async { await UriUtils.tryLaunch( @@ -103,7 +102,7 @@ class AboutPage extends HookConsumerWidget { }, ), ListTile( - title: Text(t.about.checkForUpdate.sentenceCase), + title: Text(t.about.checkForUpdate), trailing: isCheckingForUpdate ? const SizedBox( width: 24, diff --git a/lib/features/common/new_version_dialog.dart b/lib/features/common/new_version_dialog.dart index 7bd59e06..f18133a2 100644 --- a/lib/features/common/new_version_dialog.dart +++ b/lib/features/common/new_version_dialog.dart @@ -6,7 +6,6 @@ import 'package:hiddify/domain/app/app.dart'; import 'package:hiddify/domain/constants.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; // TODO add release notes class NewVersionDialog extends HookConsumerWidget { @@ -34,7 +33,7 @@ class NewVersionDialog extends HookConsumerWidget { final theme = Theme.of(context); return AlertDialog( - title: Text(t.appUpdate.dialogTitle.titleCase), + title: Text(t.appUpdate.dialogTitle), content: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, @@ -78,11 +77,11 @@ class NewVersionDialog extends HookConsumerWidget { // TODO add prefs for ignoring version context.pop(); }, - child: Text(t.appUpdate.ignoreBtnTxt.titleCase), + child: Text(t.appUpdate.ignoreBtnTxt), ), TextButton( onPressed: context.pop, - child: Text(t.appUpdate.laterBtnTxt.titleCase), + child: Text(t.appUpdate.laterBtnTxt), ), TextButton( onPressed: () async { @@ -90,7 +89,7 @@ class NewVersionDialog extends HookConsumerWidget { Uri.parse(Constants.githubLatestReleaseUrl), ); }, - child: Text(t.appUpdate.updateNowBtnTxt.titleCase), + child: Text(t.appUpdate.updateNowBtnTxt), ), ], ); diff --git a/lib/features/common/profile_tile.dart b/lib/features/common/profile_tile.dart index c2974583..aebfd1d2 100644 --- a/lib/features/common/profile_tile.dart +++ b/lib/features/common/profile_tile.dart @@ -10,7 +10,6 @@ import 'package:hiddify/features/profiles/notifier/notifier.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:percent_indicator/percent_indicator.dart'; -import 'package:recase/recase.dart'; class ProfileTile extends HookConsumerWidget { const ProfileTile({ @@ -232,7 +231,7 @@ class ProfileActionsMenu extends HookConsumerWidget { menuChildren: [ MenuItemButton( leadingIcon: const Icon(Icons.update), - child: Text(t.profile.update.buttonTxt.titleCase), + child: Text(t.profile.update.buttonTxt), onPressed: () { if (updateProfileMutation.state.isInProgress) { return; @@ -246,22 +245,22 @@ class ProfileActionsMenu extends HookConsumerWidget { ), MenuItemButton( leadingIcon: const Icon(Icons.edit), - child: Text(t.profile.edit.buttonTxt.titleCase), + child: Text(t.profile.edit.buttonTxt), onPressed: () async { await ProfileDetailsRoute(profile.id).push(context); }, ), MenuItemButton( leadingIcon: const Icon(Icons.delete), - child: Text(t.profile.delete.buttonTxt.titleCase), + child: Text(t.profile.delete.buttonTxt), onPressed: () async { if (deleteProfileMutation.state.isInProgress) { return; } final deleteConfirmed = await showConfirmationDialog( context, - title: t.profile.delete.buttonTxt.titleCase, - message: t.profile.delete.confirmationMsg.sentenceCase, + title: t.profile.delete.buttonTxt, + message: t.profile.delete.confirmationMsg, ); if (deleteConfirmed) { deleteProfileMutation.setFuture( diff --git a/lib/features/common/stats/stats_overview.dart b/lib/features/common/stats/stats_overview.dart index 24a80339..79be1435 100644 --- a/lib/features/common/stats/stats_overview.dart +++ b/lib/features/common/stats/stats_overview.dart @@ -5,7 +5,6 @@ import 'package:hiddify/domain/singbox/singbox.dart'; import 'package:hiddify/features/common/stats/stats_notifier.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class StatsOverview extends HookConsumerWidget { const StatsOverview({super.key}); @@ -23,25 +22,25 @@ class StatsOverview extends HookConsumerWidget { mainAxisSize: MainAxisSize.min, children: [ _StatCard( - title: t.home.stats.traffic.titleCase, + title: t.home.stats.traffic, firstStat: ( - label: t.home.stats.uplink.titleCase, + label: t.home.stats.uplink, data: stats.uplink.speed(), ), secondStat: ( - label: t.home.stats.downlink.titleCase, + label: t.home.stats.downlink, data: stats.downlink.speed(), ), ), const Gap(8), _StatCard( - title: t.home.stats.trafficTotal.titleCase, + title: t.home.stats.trafficTotal, firstStat: ( - label: t.home.stats.uplink.titleCase, + label: t.home.stats.uplink, data: stats.uplinkTotal.size(), ), secondStat: ( - label: t.home.stats.downlink.titleCase, + label: t.home.stats.downlink, data: stats.downlinkTotal.size(), ), ), diff --git a/lib/features/home/view/home_page.dart b/lib/features/home/view/home_page.dart index 08086493..2f7516c6 100644 --- a/lib/features/home/view/home_page.dart +++ b/lib/features/home/view/home_page.dart @@ -9,7 +9,7 @@ import 'package:hiddify/features/common/common.dart'; import 'package:hiddify/features/home/widgets/widgets.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; + import 'package:sliver_tools/sliver_tools.dart'; class HomePage extends HookConsumerWidget { @@ -30,7 +30,7 @@ class HomePage extends HookConsumerWidget { NestedTabAppBar( title: Row( children: [ - Text(t.general.appTitle.titleCase), + Text(t.general.appTitle), const Gap(4), const AppVersionLabel(), ], diff --git a/lib/features/home/widgets/connection_button.dart b/lib/features/home/widgets/connection_button.dart index 127228e2..a0f4cb61 100644 --- a/lib/features/home/widgets/connection_button.dart +++ b/lib/features/home/widgets/connection_button.dart @@ -9,7 +9,6 @@ import 'package:hiddify/features/common/connectivity/connectivity_controller.dar import 'package:hiddify/gen/assets.gen.dart'; import 'package:hiddify/utils/alerts.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; // TODO: rewrite class ConnectionButton extends HookConsumerWidget { @@ -128,7 +127,7 @@ class _ConnectionButton extends StatelessWidget { ), const Gap(16), Text( - label.sentenceCase, + label, style: Theme.of(context).textTheme.bodyLarge, ), ], diff --git a/lib/features/home/widgets/empty_profiles_home_body.dart b/lib/features/home/widgets/empty_profiles_home_body.dart index 3ce7069b..a633dce9 100644 --- a/lib/features/home/widgets/empty_profiles_home_body.dart +++ b/lib/features/home/widgets/empty_profiles_home_body.dart @@ -3,7 +3,6 @@ import 'package:gap/gap.dart'; import 'package:hiddify/core/core_providers.dart'; import 'package:hiddify/core/router/router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class EmptyProfilesHomeBody extends HookConsumerWidget { const EmptyProfilesHomeBody({super.key}); @@ -17,12 +16,12 @@ class EmptyProfilesHomeBody extends HookConsumerWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text(t.home.emptyProfilesMsg.sentenceCase), + Text(t.home.emptyProfilesMsg), const Gap(16), OutlinedButton.icon( onPressed: () => const AddProfileRoute().push(context), icon: const Icon(Icons.add), - label: Text(t.profile.add.buttonText.titleCase), + label: Text(t.profile.add.buttonText), ), ], ), @@ -42,11 +41,11 @@ class EmptyActiveProfileHomeBody extends HookConsumerWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text(t.home.noActiveProfileMsg.sentenceCase), + Text(t.home.noActiveProfileMsg), const Gap(16), OutlinedButton( onPressed: () => const ProfilesRoute().push(context), - child: Text(t.profile.overviewPageTitle.titleCase), + child: Text(t.profile.overviewPageTitle), ), ], ), diff --git a/lib/features/logs/view/logs_page.dart b/lib/features/logs/view/logs_page.dart index 28b5fd3d..f2284300 100644 --- a/lib/features/logs/view/logs_page.dart +++ b/lib/features/logs/view/logs_page.dart @@ -11,7 +11,7 @@ import 'package:hiddify/features/logs/notifier/notifier.dart'; import 'package:hiddify/services/service_providers.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; + import 'package:tint/tint.dart'; class LogsPage extends HookConsumerWidget with PresLogger { @@ -29,7 +29,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { final List popupButtons = debug || PlatformUtils.isDesktop ? [ PopupMenuItem( - child: Text(t.logs.shareCoreLogs.sentenceCase), + child: Text(t.logs.shareCoreLogs), onTap: () async { await UriUtils.tryShareOrLaunchFile( Uri.parse(filesEditor.coreLogsPath), @@ -38,7 +38,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { }, ), PopupMenuItem( - child: Text(t.logs.shareAppLogs.sentenceCase), + child: Text(t.logs.shareAppLogs), onTap: () async { await UriUtils.tryShareOrLaunchFile( Uri.parse(filesEditor.appLogsPath), @@ -55,7 +55,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { appBar: AppBar( // TODO: fix height toolbarHeight: 90, - title: Text(t.logs.pageTitle.titleCase), + title: Text(t.logs.pageTitle), actions: [ if (popupButtons.isNotEmpty) PopupMenuButton( @@ -76,7 +76,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { onChanged: notifier.filterMessage, decoration: InputDecoration( isDense: true, - hintText: t.logs.filterHint.sentenceCase, + hintText: t.logs.filterHint, ), ), ), @@ -92,12 +92,12 @@ class LogsPage extends HookConsumerWidget with PresLogger { items: [ DropdownMenuItem( value: none(), - child: Text(t.logs.allLevelsFilter.sentenceCase), + child: Text(t.logs.allLevelsFilter), ), ...LogLevel.values.takeFirst(3).map( (e) => DropdownMenuItem( value: some(e), - child: Text(e.name.sentenceCase), + child: Text(e.name), ), ), ], @@ -136,7 +136,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.logs.pageTitle.titleCase), + title: Text(t.logs.pageTitle), ), SliverErrorBodyPlaceholder(t.printError(error)), ], @@ -148,7 +148,7 @@ class LogsPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.logs.pageTitle.titleCase), + title: Text(t.logs.pageTitle), ), const SliverLoadingBodyPlaceholder(), ], diff --git a/lib/features/profile_detail/view/profile_detail_page.dart b/lib/features/profile_detail/view/profile_detail_page.dart index 4741de74..0a08e256 100644 --- a/lib/features/profile_detail/view/profile_detail_page.dart +++ b/lib/features/profile_detail/view/profile_detail_page.dart @@ -7,7 +7,6 @@ import 'package:hiddify/features/common/confirmation_dialogs.dart'; import 'package:hiddify/features/profile_detail/notifier/notifier.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; // TODO: test and improve // TODO: prevent popping screen when busy @@ -41,8 +40,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { case MutationFailure(:final failure): CustomToast.error(t.printError(failure)).show(context); case MutationSuccess(): - CustomToast.success(t.profile.save.successMsg.sentenceCase) - .show(context); + CustomToast.success(t.profile.save.successMsg).show(context); WidgetsBinding.instance.addPostFrameCallback( (_) { if (context.mounted) context.pop(); @@ -61,8 +59,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { case MutationFailure(:final failure): CustomToast.error(t.printError(failure)).show(context); case MutationSuccess(): - CustomToast.success(t.profile.delete.successMsg.sentenceCase) - .show(context); + CustomToast.success(t.profile.delete.successMsg).show(context); WidgetsBinding.instance.addPostFrameCallback( (_) { if (context.mounted) context.pop(); @@ -82,7 +79,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { slivers: [ SliverAppBar( pinned: true, - title: Text(t.profile.detailsPageTitle.titleCase), + title: Text(t.profile.detailsPageTitle), ), const SliverGap(8), SliverPadding( @@ -102,7 +99,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { validator: (value) => (value?.isEmpty ?? true) ? t.profile.detailsForm.emptyNameMsg : null, - label: t.profile.detailsForm.nameHint.titleCase, + label: t.profile.detailsForm.nameHint, ), const Gap(16), CustomTextFormField( @@ -142,10 +139,8 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { final deleteConfirmed = await showConfirmationDialog( context, - title: - t.profile.delete.buttonTxt.titleCase, - message: t.profile.delete.confirmationMsg - .sentenceCase, + title: t.profile.delete.buttonTxt, + message: t.profile.delete.confirmationMsg, ); if (deleteConfirmed) { await notifier.delete(); @@ -157,7 +152,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { ), ), child: Text( - t.profile.delete.buttonTxt.titleCase, + t.profile.delete.buttonTxt, style: TextStyle( color: themeData .colorScheme.onErrorContainer, @@ -166,8 +161,7 @@ class ProfileDetailPage extends HookConsumerWidget with PresLogger { ), OutlinedButton( onPressed: notifier.save, - child: - Text(t.profile.save.buttonText.titleCase), + child: Text(t.profile.save.buttonText), ), ], ), diff --git a/lib/features/profiles/view/add_profile_modal.dart b/lib/features/profiles/view/add_profile_modal.dart index bb62701e..2cadd71d 100644 --- a/lib/features/profiles/view/add_profile_modal.dart +++ b/lib/features/profiles/view/add_profile_modal.dart @@ -10,7 +10,6 @@ import 'package:hiddify/features/common/qr_code_scanner_screen.dart'; import 'package:hiddify/features/profiles/notifier/notifier.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class AddProfileModal extends HookConsumerWidget { const AddProfileModal({ @@ -34,8 +33,7 @@ class AddProfileModal extends HookConsumerWidget { CustomAlertDialog.fromErr(t.presentError(err)).show(context); }, initialOnSuccess: () { - CustomToast.success(t.profile.save.successMsg.sentenceCase) - .show(context); + CustomToast.success(t.profile.save.successMsg).show(context); WidgetsBinding.instance.addPostFrameCallback( (_) { if (context.mounted) context.pop(); @@ -79,7 +77,7 @@ class AddProfileModal extends HookConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - t.profile.add.addingProfileMsg.sentenceCase, + t.profile.add.addingProfileMsg, style: theme.textTheme.bodySmall, ), const Gap(8), @@ -98,7 +96,7 @@ class AddProfileModal extends HookConsumerWidget { child: Row( children: [ _Button( - label: t.profile.add.fromClipboard.sentenceCase, + label: t.profile.add.fromClipboard, icon: Icons.content_paste, size: buttonWidth, onTap: () async { @@ -117,7 +115,7 @@ class AddProfileModal extends HookConsumerWidget { } else { if (context.mounted) { CustomToast.error( - t.profile.add.invalidUrlMsg.sentenceCase, + t.profile.add.invalidUrlMsg, ).show(context); } } @@ -148,7 +146,7 @@ class AddProfileModal extends HookConsumerWidget { } else { if (context.mounted) { CustomToast.error( - t.profile.add.invalidUrlMsg.sentenceCase, + t.profile.add.invalidUrlMsg, ).show(context); } } @@ -156,7 +154,7 @@ class AddProfileModal extends HookConsumerWidget { ) else _Button( - label: t.profile.add.manually.sentenceCase, + label: t.profile.add.manually, icon: Icons.add, size: buttonWidth, onTap: () async { @@ -198,7 +196,7 @@ class AddProfileModal extends HookConsumerWidget { ), const Gap(8), Text( - t.profile.add.manually.sentenceCase, + t.profile.add.manually, style: theme.textTheme.labelLarge?.copyWith( color: theme.colorScheme.primary, ), diff --git a/lib/features/profiles/view/profiles_modal.dart b/lib/features/profiles/view/profiles_modal.dart index 975bbc87..6c8d7cac 100644 --- a/lib/features/profiles/view/profiles_modal.dart +++ b/lib/features/profiles/view/profiles_modal.dart @@ -9,7 +9,6 @@ import 'package:hiddify/features/common/common.dart'; import 'package:hiddify/features/profiles/notifier/notifier.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class ProfilesModal extends HookConsumerWidget { const ProfilesModal({ @@ -57,7 +56,7 @@ class ProfilesModal extends HookConsumerWidget { const AddProfileRoute().push(context); }, icon: const Icon(Icons.add), - label: Text(t.profile.add.shortBtnTxt.titleCase), + label: Text(t.profile.add.shortBtnTxt), ), FilledButton.icon( onPressed: () { @@ -69,7 +68,7 @@ class ProfilesModal extends HookConsumerWidget { ); }, icon: const Icon(Icons.sort), - label: Text(t.general.sort.titleCase), + label: Text(t.general.sort), ), ], ), @@ -88,7 +87,7 @@ class ProfilesSortModal extends HookConsumerWidget { final t = ref.watch(translationsProvider); return AlertDialog( - title: Text(t.general.sortBy.titleCase), + title: Text(t.general.sortBy), content: Consumer( builder: (context, ref, child) { final sort = ref.watch(profilesSortNotifierProvider); diff --git a/lib/features/proxies/view/proxies_page.dart b/lib/features/proxies/view/proxies_page.dart index c8abc68c..1651652e 100644 --- a/lib/features/proxies/view/proxies_page.dart +++ b/lib/features/proxies/view/proxies_page.dart @@ -6,7 +6,6 @@ import 'package:hiddify/features/proxies/notifier/notifier.dart'; import 'package:hiddify/features/proxies/widgets/widgets.dart'; import 'package:hiddify/utils/utils.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class ProxiesPage extends HookConsumerWidget with PresLogger { const ProxiesPage({super.key}); @@ -31,13 +30,13 @@ class ProxiesPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.proxies.pageTitle.titleCase), + title: Text(t.proxies.pageTitle), ), SliverFillRemaining( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text(t.proxies.emptyProxiesMsg.titleCase), + Text(t.proxies.emptyProxiesMsg), ], ), ), @@ -52,7 +51,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.proxies.pageTitle.titleCase), + title: Text(t.proxies.pageTitle), actions: [ PopupMenuButton( initialValue: sortBy, @@ -131,7 +130,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger { ), floatingActionButton: FloatingActionButton( onPressed: () async => notifier.urlTest(group.tag), - tooltip: t.proxies.delayTestTooltip.titleCase, + tooltip: t.proxies.delayTestTooltip, child: const Icon(Icons.bolt), ), ); @@ -141,7 +140,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.proxies.pageTitle.titleCase), + title: Text(t.proxies.pageTitle), ), SliverErrorBodyPlaceholder( t.printError(error), @@ -156,7 +155,7 @@ class ProxiesPage extends HookConsumerWidget with PresLogger { body: CustomScrollView( slivers: [ NestedTabAppBar( - title: Text(t.proxies.pageTitle.titleCase), + title: Text(t.proxies.pageTitle), ), const SliverLoadingBodyPlaceholder(), ], diff --git a/lib/features/wrapper/view/desktop_wrapper.dart b/lib/features/wrapper/view/desktop_wrapper.dart index 9d9a5f3d..4556a76c 100644 --- a/lib/features/wrapper/view/desktop_wrapper.dart +++ b/lib/features/wrapper/view/desktop_wrapper.dart @@ -3,7 +3,6 @@ import 'package:hiddify/core/core_providers.dart'; import 'package:hiddify/core/router/router.dart'; import 'package:hiddify/features/common/stats/stats_overview.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class DesktopWrapper extends HookConsumerWidget { const DesktopWrapper(this.navigator, {super.key}); @@ -19,23 +18,23 @@ class DesktopWrapper extends HookConsumerWidget { final destinations = [ NavigationRailDestination( icon: const Icon(Icons.power_settings_new), - label: Text(t.home.pageTitle.titleCase), + label: Text(t.home.pageTitle), ), NavigationRailDestination( icon: const Icon(Icons.filter_list), - label: Text(t.proxies.pageTitle.titleCase), + label: Text(t.proxies.pageTitle), ), NavigationRailDestination( icon: const Icon(Icons.article), - label: Text(t.logs.pageTitle.titleCase), + label: Text(t.logs.pageTitle), ), NavigationRailDestination( icon: const Icon(Icons.settings), - label: Text(t.settings.pageTitle.titleCase), + label: Text(t.settings.pageTitle), ), NavigationRailDestination( icon: const Icon(Icons.info), - label: Text(t.about.pageTitle.titleCase), + label: Text(t.about.pageTitle), ), ]; diff --git a/lib/features/wrapper/view/mobile_wrapper.dart b/lib/features/wrapper/view/mobile_wrapper.dart index bbb208e1..e2d873ce 100644 --- a/lib/features/wrapper/view/mobile_wrapper.dart +++ b/lib/features/wrapper/view/mobile_wrapper.dart @@ -5,7 +5,6 @@ import 'package:hiddify/core/core_providers.dart'; import 'package:hiddify/core/router/router.dart'; import 'package:hiddify/features/common/common.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:recase/recase.dart'; class MobileWrapper extends HookConsumerWidget { const MobileWrapper(this.navigator, {super.key}); @@ -30,19 +29,19 @@ class MobileWrapper extends HookConsumerWidget { children: [ const Gap(16), DrawerTile( - label: t.settings.pageTitle.titleCase, + label: t.settings.pageTitle, icon: Icons.settings, selected: location == SettingsRoute.path, onSelect: () => const SettingsRoute().push(context), ), DrawerTile( - label: t.logs.pageTitle.titleCase, + label: t.logs.pageTitle, icon: Icons.article, selected: location == LogsRoute.path, onSelect: () => const LogsRoute().push(context), ), DrawerTile( - label: t.about.pageTitle.titleCase, + label: t.about.pageTitle, icon: Icons.info, selected: location == AboutRoute.path, onSelect: () => const AboutRoute().push(context), @@ -56,11 +55,11 @@ class MobileWrapper extends HookConsumerWidget { destinations: [ NavigationDestination( icon: const Icon(Icons.power_settings_new), - label: t.home.pageTitle.titleCase, + label: t.home.pageTitle, ), NavigationDestination( icon: const Icon(Icons.filter_list), - label: t.proxies.pageTitle.titleCase, + label: t.proxies.pageTitle, ), ], selectedIndex: currentIndex > 1 ? 0 : currentIndex, diff --git a/pubspec.lock b/pubspec.lock index 32154480..ffd3fc82 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -966,7 +966,7 @@ packages: source: hosted version: "2.2.2" recase: - dependency: "direct main" + dependency: transitive description: name: recase sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 diff --git a/pubspec.yaml b/pubspec.yaml index 4a982040..20ac1d2e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,6 @@ dependencies: intl: ^0.18.1 slang: ^3.23.0 slang_flutter: ^3.23.0 - recase: ^4.1.0 timeago: ^3.5.0 flutter_localized_locales: ^2.0.4