From 45a23e9025a22dfa631515ef830e61e62ce88031 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 22 Dec 2022 07:57:21 -0500 Subject: [PATCH 1/3] Language fix for #185 --- lib/main.dart | 7 ++++++- lib/pages/settings.dart | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8c4cd51..c66a53b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -43,12 +43,16 @@ final globalNavigatorKey = GlobalKey(); Future loadTranslations() async { // See easy_localization/issues/210 await EasyLocalizationController.initEasyLocation(); + var s = SettingsProvider(); + await s.initializeSettings(); + var forceLocale = s.forcedLocale; final controller = EasyLocalizationController( saveLocale: true, + forceLocale: forceLocale != null ? Locale(forceLocale) : null, fallbackLocale: fallbackLocale, supportedLocales: supportedLocales, assetLoader: const RootBundleAssetLoader(), - useOnlyLangCode: false, + useOnlyLangCode: true, useFallbackTranslations: true, path: localeDir, onLoadError: (FlutterError e) { @@ -160,6 +164,7 @@ void main() async { supportedLocales: supportedLocales, path: localeDir, fallbackLocale: fallbackLocale, + useOnlyLangCode: true, child: const Obtainium()), )); } diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index 2e107ba..ecf1d5b 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -145,8 +145,11 @@ class _SettingsPageState extends State { ], onChanged: (value) { settingsProvider.forcedLocale = value; - context.setLocale(Locale(settingsProvider.forcedLocale ?? - context.fallbackLocale!.languageCode)); + if (value != null) { + context.setLocale(Locale(value)); + } else { + context.resetLocale(); + } }); var intervalDropdown = DropdownButtonFormField( From 4e0c655538fd32af0ec44887c8beddf9429e328e Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 22 Dec 2022 08:01:26 -0500 Subject: [PATCH 2/3] F-Droid repo URL matching made more general (#188) --- README.md | 3 ++- lib/app_sources/fdroidrepo.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d21466..e218721 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Currently supported App sources: - [Signal](https://signal.org/) - [SourceForge](https://sourceforge.net/) - [APKMirror](https://apkmirror.com/) (Track-Only) -- Third Party F-Droid Repos (URLs ending with `/fdroid/repo`) +- Third Party F-Droid Repos + - Any URLs ending with `/fdroid/`, where `` can be anything - most often `repo` - [Steam](https://store.steampowered.com/mobile) ## Limitations diff --git a/lib/app_sources/fdroidrepo.dart b/lib/app_sources/fdroidrepo.dart index 0f63de5..0e9a7f7 100644 --- a/lib/app_sources/fdroidrepo.dart +++ b/lib/app_sources/fdroidrepo.dart @@ -22,7 +22,7 @@ class FDroidRepo extends AppSource { @override String standardizeURL(String url) { RegExp standardUrlRegExp = - RegExp('^https?://.+/fdroid/(repo(/|\\?)|repo\$)'); + RegExp('^https?://.+/fdroid/([^/]+(/|\\?)|[^/]+\$)'); RegExpMatch? match = standardUrlRegExp.firstMatch(url.toLowerCase()); if (match == null) { throw InvalidURLError(name); From 226cfa25e05c422a625cc1a7bbe7bf762516e526 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 22 Dec 2022 08:01:52 -0500 Subject: [PATCH 3/3] Increment version --- lib/main.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index c66a53b..6f90007 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart'; // ignore: implementation_imports import 'package:easy_localization/src/localization.dart'; -const String currentVersion = '0.9.3'; +const String currentVersion = '0.9.4'; const String currentReleaseTag = 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES diff --git a/pubspec.yaml b/pubspec.yaml index 6bd4ff3..043e466 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.9.3+91 # When changing this, update the tag in main() accordingly +version: 0.9.4+92 # When changing this, update the tag in main() accordingly environment: sdk: '>=2.18.2 <3.0.0'