From 69c562958f272776315185a40260c06dca42b10d Mon Sep 17 00:00:00 2001 From: isshort Date: Fri, 7 Jul 2023 11:52:56 +0600 Subject: [PATCH] Pashto language localization --- CHANGELOG.md | 322 +++++++++++++++++----------------- README.md | 181 +++++++++++-------- lib/src/upgrade_messages.dart | 21 +++ test/upgrader_test.dart | 1 + 4 files changed, 288 insertions(+), 237 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b907b01..ae7d30dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next +- Added new language translation for Japanese ('ps'). + - Added Russian release notes translation. (thanks to @filipp2911) ## 7.1.0 @@ -72,7 +74,7 @@ ## 5.1.0 - Updated the initialization of upgrader to use a future that will allow the initialize method to be called multiple times. This -does not require any changes by app code. + does not require any changes by app code. - Fixed issue #239 where some Android release notes that contained
HTML tags were not converted into \n characters. - Added Portuguese release notes translation. (thanks to @RodolfoSilva) - Added new example using upgrader inside a stateless widget. @@ -82,7 +84,7 @@ does not require any changes by app code. ## 5.1.0-alpha.1 - Updated the initialization of upgrader to use a future that will allow the initialize method to be called multiple times. This -does not require any changes by app code. + does not require any changes by app code. - Added new example using upgrader inside a stateless widget. - Added additional try/catch logic to report App Store API errors. - Fixed unit tests that were broken due to the initialization changes. @@ -106,7 +108,7 @@ does not require any changes by app code. ## 4.11.0 - Updated package dependencies: - - mockito to ">=5.0.0 <5.4.0" + - mockito to ">=5.0.0 <5.4.0" - Added new language translations for Danish ('da'). (thanks to @Ruukas97) - Updated README to include a screenshot of a minAppVersion example. @@ -114,23 +116,23 @@ does not require any changes by app code. - Updated minimum Flutter version to 2.5.0 and Dart to 2.14.0. - Updated package dependencies: - - device_info_plus to ">=3.2.0 <7.0.0" - - html to ">=0.15.0 <=0.15.1" - - http to ">=0.13.0 <=0.13.5" - - package_info_plus to ">=1.3.0 <3.0.0" - - shared_preferences to ">=2.0.3 <2.1.0" - - url_launcher to ">=6.1.0 <= 6.1.5" + - device_info_plus to ">=3.2.0 <7.0.0" + - html to ">=0.15.0 <=0.15.1" + - http to ">=0.13.0 <=0.13.5" + - package_info_plus to ">=1.3.0 <3.0.0" + - shared_preferences to ">=2.0.3 <2.1.0" + - url_launcher to ">=6.1.0 <= 6.1.5" ## 4.9.0 - Expanded dependency version ranges without breaking compatibility. More dependency -updates coming in the next update. + updates coming in the next update. - Updated package dependencies: - - device_info_plus to ">=3.2.0 <6.0.0" - - http to ">=0.13.0 <=0.13.3" - - os_detect to ">=2.0.0 <2.1.0" - - package_info_plus to ">=1.3.0 <=1.4.2" - - shared_preferences to ">=2.0.3 <=2.0.7" + - device_info_plus to ">=3.2.0 <6.0.0" + - http to ">=0.13.0 <=0.13.3" + - os_detect to ">=2.0.0 <2.1.0" + - package_info_plus to ">=1.3.0 <=1.4.2" + - shared_preferences to ">=2.0.3 <=2.0.7" - Updated example to use Dart >=2.12.0. ## 4.8.1 @@ -144,14 +146,14 @@ updates coming in the next update. ## 4.7.0 - Changed the Android Play Store description minimum app version tag from `[:mav: 1.2.3]`, which is not allowed by Google, -to `[Minimum supported app version: 1.2.3]`, which should be allowed. Thanks to @joymyr for the suggestion. + to `[Minimum supported app version: 1.2.3]`, which should be allowed. Thanks to @joymyr for the suggestion. - Improved the Android Play Store command line app by adding country as an optional parameter. - Updated README with platforms supported. ## 4.7.0-alpha.1 - Changed the Android Play Store description minimum app version tag from `[:mav: 1.2.3]`, which is not allowed by Google, -to `[Minimum supported app version: 1.2.3]`, which should be allowed. Thanks to @joymyr for the suggestion. + to `[Minimum supported app version: 1.2.3]`, which should be allowed. Thanks to @joymyr for the suggestion. ## 4.6.1 @@ -189,7 +191,7 @@ to `[Minimum supported app version: 1.2.3]`, which should be allowed. Thanks to - Updated the version package to support version ranges from >=2.0.0 <3.1.0. - Improved exception handling around version parsing. - Fixed methods ITunesResults.minAppVersion and PlayStoreResults.minAppVersion to -handle tagName parameter properly. + handle tagName parameter properly. ## 4.3.0 @@ -208,7 +210,7 @@ handle tagName parameter properly. ## 4.2.1 - After the latest update to the Play Store, the Android app version was not being -found on the Play Store. This has been resolved. + found on the Play Store. This has been resolved. - Changed the "upgrader: instantiated." message to be behind debugLogging. ## 4.2.1-alpha.2 @@ -218,7 +220,7 @@ found on the Play Store. This has been resolved. ## 4.2.1-alpha.1 - After the latest update to the Play Store, the Android app version was not being -found on the Play Store. This has been resolved. + found on the Play Store. This has been resolved. - This is a pre-release to allow for testing with a large amount of developers. ## 4.2.0 @@ -227,32 +229,32 @@ found on the Play Store. This has been resolved. ## 4.1.2 -* Fixed Flutter 3 warnings related to `WidgetsBinding.instance`. -* Fixed a typo in the Persian body message. -* Updated xml dependency to ">=5.0.2 <7.0.0". +- Fixed Flutter 3 warnings related to `WidgetsBinding.instance`. +- Fixed a typo in the Persian body message. +- Updated xml dependency to ">=5.0.2 <7.0.0". ## 4.1.1 -* Fixed error from pub.dev because it used Flutter 2.10.5: "The property 'window' can't be unconditionally accessed because the receiver can be 'null'." +- Fixed error from pub.dev because it used Flutter 2.10.5: "The property 'window' can't be unconditionally accessed because the receiver can be 'null'." ## 4.1.0 -* Minor updates after upgrading Flutter to 3.0.0 and Dart to 2.17.0. +- Minor updates after upgrading Flutter to 3.0.0 and Dart to 2.17.0. ## 4.0.0 -* [BREAKING] No more singleton. This is a huge update to remove the use of a singleton for Upgrader. -It is now a normal class that is passed to either UpgradeAlert or UpgradeCard. -This makes it easy to subclass Upgrader and change its behavior. The parameters -to UpgradeAlert and UpgradeCard have been removed, and can be set on Upgrader. -See the various examples for more information. +- [BREAKING] No more singleton. This is a huge update to remove the use of a singleton for Upgrader. + It is now a normal class that is passed to either UpgradeAlert or UpgradeCard. + This makes it easy to subclass Upgrader and change its behavior. The parameters + to UpgradeAlert and UpgradeCard have been removed, and can be set on Upgrader. + See the various examples for more information. -* Changed the callback signature for the willDisplayUpgrade callback to add -minAppVersion, installedVersion, and appStoreVersion parameters. +- Changed the callback signature for the willDisplayUpgrade callback to add + minAppVersion, installedVersion, and appStoreVersion parameters. -* Updated url_launcher to version 6.1.0. +- Updated url_launcher to version 6.1.0. -* There are no new features, no feature updates, and no bug fixes in this release. +- There are no new features, no feature updates, and no bug fixes in this release. ## 4.0.0-alpha.4 @@ -287,327 +289,327 @@ There are no new features, no feature updates, and no bug fixes in this release. ## 3.15.0 -* Added new language translations for Mongolian ('mn'). -* Added new message phrase for 'Release Notes'. All language translations need -to be updated to include a translation. The English and Spanish translations are -included. -* Updated url_launcher to version 6.1.0, and fixed two deprecations from that upgrade. +- Added new language translations for Mongolian ('mn'). +- Added new message phrase for 'Release Notes'. All language translations need + to be updated to include a translation. The English and Spanish translations are + included. +- Updated url_launcher to version 6.1.0, and fixed two deprecations from that upgrade. ## 3.14.0 -* BREAKING (Minor): Changed the parameter name `debugAlwaysUpgrade` to `debugDisplayAlways` -in `UpgradeAlert` and `UpgradeCard` to be consistent with the rest of the code -and with the README. -* Added new language translation for Dutch ('nl'). -* Added new language translation for Khmer ('km'). -* Added new language translation for Haitian Creole ('ht'). -* Added new language translation for Japanese ('ja'). -* Added new callback: `willDisplayUpgrade`: called when `upgrader` determines that -an upgrade may or may not be displayed, defaults to ```null```. The `value` -parameter will be true when it should be displayed, and false when it should not -be displayed. One good use for this callback is logging metrics for your app. +- BREAKING (Minor): Changed the parameter name `debugAlwaysUpgrade` to `debugDisplayAlways` + in `UpgradeAlert` and `UpgradeCard` to be consistent with the rest of the code + and with the README. +- Added new language translation for Dutch ('nl'). +- Added new language translation for Khmer ('km'). +- Added new language translation for Haitian Creole ('ht'). +- Added new language translation for Japanese ('ja'). +- Added new callback: `willDisplayUpgrade`: called when `upgrader` determines that + an upgrade may or may not be displayed, defaults to `null`. The `value` + parameter will be true when it should be displayed, and false when it should not + be displayed. One good use for this callback is logging metrics for your app. ## 3.13.0 -* Added new language translation for Swedish ('sv'). +- Added new language translation for Swedish ('sv'). ## 3.12.1 -* Removed the use of dart:io from the package to allow for compatibility on web. -Added use of package os_detect instead. Testing still uses dart:io. +- Removed the use of dart:io from the package to allow for compatibility on web. + Added use of package os_detect instead. Testing still uses dart:io. ## 3.12.0 -* Updated to device_info_plus. -* Changed from using pedantic to flutter_lints. Now using the rules from -flutter_lints/flutter.yaml. -* Now using const instead of final on many variables. -* Resolved linting issues. Used typed over untyped uninitialized variables. +- Updated to device_info_plus. +- Changed from using pedantic to flutter_lints. Now using the rules from + flutter_lints/flutter.yaml. +- Now using const instead of final on many variables. +- Resolved linting issues. Used typed over untyped uninitialized variables. ## 3.11.1 -* Fixed exception while running in the browser. Added example support for web. +- Fixed exception while running in the browser. Added example support for web. ## 3.11.0 -* Added new language translations for Greek ('el'). +- Added new language translations for Greek ('el'). ## 3.10.0 -* Added new language translations for Lithuanian ('lt'). +- Added new language translations for Lithuanian ('lt'). ## 3.9.0 -* Added support for minimum app version in the app store description field. See -README for more details. +- Added support for minimum app version in the app store description field. See + README for more details. ## 3.8.0 -* Added new language translations for Norwegian ('nb'). +- Added new language translations for Norwegian ('nb'). ## 3.7.0 -* Migrated from the deprecated package_info plugin to package_info_plus. +- Migrated from the deprecated package_info plugin to package_info_plus. ## 3.6.0 -* Fixed exception for Android release notes when there was no WHAT'S NEW section -on Google Play. Now, the main app description will be used for release notes. +- Fixed exception for Android release notes when there was no WHAT'S NEW section + on Google Play. Now, the main app description will be used for release notes. ## 3.5.1 -* Fixed issue with large text on a small device. Now, the content will scroll. +- Fixed issue with large text on a small device. Now, the content will scroll. ## 3.5.0 -* Added support for Android using the Google Play Store. Now, by default on -Android, the version of the app on the Google Play Store will be used, and there -is no need to setup the Appcast. You can continue using the Appcast on Android, -but it is no longer needed when the app is in the Google Play Store. -* Added a cache buster to the iTunes API URL to break the HTTP caching. +- Added support for Android using the Google Play Store. Now, by default on + Android, the version of the app on the Google Play Store will be used, and there + is no need to setup the Appcast. You can continue using the Appcast on Android, + but it is no longer needed when the app is in the Google Play Store. +- Added a cache buster to the iTunes API URL to break the HTTP caching. ## 3.4.1 -* Fixed issue with Appcast where the upgrade message was not displayed. +- Fixed issue with Appcast where the upgrade message was not displayed. ## 3.4.0 -* Added new language translations for Tamil ('ta'), Kazakh ('kk'), Bengali ('bn'), Ukrainian ('uk'). +- Added new language translations for Tamil ('ta'), Kazakh ('kk'), Bengali ('bn'), Ukrainian ('uk'). ## 3.3.1 -* Fixed the parsing of the Appcast body to handle UTF-8 correctly. +- Fixed the parsing of the Appcast body to handle UTF-8 correctly. ## 3.3.0 -* When using the ```UpgradeAlert``` widget, the Android back button will not -dismiss the alert dialog by default anymore. To allow the back button to dismiss -the dialog, use ```shouldPopScope``` and return true. +- When using the `UpgradeAlert` widget, the Android back button will not + dismiss the alert dialog by default anymore. To allow the back button to dismiss + the dialog, use `shouldPopScope` and return true. ## 3.2.1 -* Resolved issue where release notes for the iOS App Store always displayed Minor updates and improvements. +- Resolved issue where release notes for the iOS App Store always displayed Minor updates and improvements. ## 3.2.0 -* Resolved issue where the country code used by the iTunes Search API should have been upper case. +- Resolved issue where the country code used by the iTunes Search API should have been upper case. ## 3.1.0 -* Added release notes. On iOS the release notes are automatically displayed. For Appcast the description will be used for release notes. -* Added new language translations for Filipino ('fil') and Persian ('fa'). +- Added release notes. On iOS the release notes are automatically displayed. For Appcast the description will be used for release notes. +- Added new language translations for Filipino ('fil') and Persian ('fa'). ## 3.0.0 -* Moved to Flutter 2.0.0 stable. +- Moved to Flutter 2.0.0 stable. ## 3.0.0-nullsafety.2 -* Resolved issues with unit tests so all are passing now. Minor package upgrades. +- Resolved issues with unit tests so all are passing now. Minor package upgrades. ## 3.0.0-nullsafety.1 -* BREAKING CHANGE - Migrated to null safety. -* Upgraded these packages to null safety: device_info, http, package_info, shared_preferences, url_launcher, xml, mockito, pedantic, version. -* Removed reference to unused package flutter_device_locale. -* Skipped many of the unit tests because they could not be quickly resolved of failures. Will send a pre-release version out quickly before testing is completed so that others can use this, and then continue working on the failed tests before release. +- BREAKING CHANGE - Migrated to null safety. +- Upgraded these packages to null safety: device_info, http, package_info, shared_preferences, url_launcher, xml, mockito, pedantic, version. +- Removed reference to unused package flutter_device_locale. +- Skipped many of the unit tests because they could not be quickly resolved of failures. Will send a pre-release version out quickly before testing is completed so that others can use this, and then continue working on the failed tests before release. ## 2.8.2 -* Fixed issue with language code that was not supported. It now defaults to 'en' English. -* Added Codemagic CI configuration file. +- Fixed issue with language code that was not supported. It now defaults to 'en' English. +- Added Codemagic CI configuration file. ## 2.8.1 -* Improved error checking on UpgraderMessages language code. -* Added extra debug logging. +- Improved error checking on UpgraderMessages language code. +- Added extra debug logging. ## 2.8.0 -* Changed the parameter daysUntilAlertAgain to durationUntilAlertAgain which is -a breaking change. Thanks to [José](https://github.com/nwparker) for his contribution. -* Updated the Android example to AndroidX. -* Added extra debug logging for language code. -* Moved classes AlertStyleWidget, UpgradeBase, and UpgradeCard into their own Dart files. -* Added Cupertino style alert test. +- Changed the parameter daysUntilAlertAgain to durationUntilAlertAgain which is + a breaking change. Thanks to [José](https://github.com/nwparker) for his contribution. +- Updated the Android example to AndroidX. +- Added extra debug logging for language code. +- Moved classes AlertStyleWidget, UpgradeBase, and UpgradeCard into their own Dart files. +- Added Cupertino style alert test. ## 2.7.3 -* Added a property to the Upgrader class to allow mocking out Appcast for testing. Thanks -to [Jonah Walker](https://github.com/supposedlysam-bb) for the update. +- Added a property to the Upgrader class to allow mocking out Appcast for testing. Thanks + to [Jonah Walker](https://github.com/supposedlysam-bb) for the update. ## 2.7.2 -* Added a wider version range for package device_info, up to <1.1.0. +- Added a wider version range for package device_info, up to <1.1.0. ## 2.7.1 -* Added extra debug logging. +- Added extra debug logging. ## 2.7.0 -* Added support for a Cupertino style dialog for UpgradeAlert. +- Added support for a Cupertino style dialog for UpgradeAlert. ## 2.6.2 -* Added new language translations for Vietnamese ('vi'), Russian ('ru), Hungarian ('hu'), Turkish ('tr), Indonesian ('id). +- Added new language translations for Vietnamese ('vi'), Russian ('ru), Hungarian ('hu'), Turkish ('tr), Indonesian ('id). ## 2.6.1 -* Fixed Portuguese and Korean body messages that were reversed. Thanks to Clare Kang for the fix. +- Fixed Portuguese and Korean body messages that were reversed. Thanks to Clare Kang for the fix. ## 2.6.0 -* Added new language translations for German ('de') and Italian ('it'). +- Added new language translations for German ('de') and Italian ('it'). ## 2.5.2 -* Fixed potential crash when the app name is null. +- Fixed potential crash when the app name is null. ## 2.5.1 -* Fixed a bug on Android where the alert was displayed without using an Appcast. +- Fixed a bug on Android where the alert was displayed without using an Appcast. ## 2.5.0 -* Added new language translations for Polish ('pl') and Korean ('ko'). +- Added new language translations for Polish ('pl') and Korean ('ko'). ## 2.4.1 -* Fixed issue with default country code +- Fixed issue with default country code ## 2.4.0 -* Added new language translations for French ('fr') and Portuguese ('pt'). -* Updated the Appcast class to support a newer version of the Xml package. +- Added new language translations for French ('fr') and Portuguese ('pt'). +- Updated the Appcast class to support a newer version of the Xml package. ## 2.3.0 -* Enhanced to prevent the dialog and card from being closed when in a blocked state, either with a critical update, or when the minimum app version is enforced. +- Enhanced to prevent the dialog and card from being closed when in a blocked state, either with a critical update, or when the minimum app version is enforced. ## 2.2.1 -* Added support for mocking the Appcast. +- Added support for mocking the Appcast. ## 2.2.0 -* Added support for Arabic language localization. +- Added support for Arabic language localization. ## 2.1.0 -* Added support for an optional minimum app version. If the installed version is below the minimum app version, -the ignore and later buttons will be hidden. This is similar to the critical update attribute for Appcast. -* The iOS App Store query will now default to the country code of the system locale, -instead of `US`. This will help suggest upgrades to users from countries other than -the US. The country code can be overriden with the optional `countryCode` parameter. +- Added support for an optional minimum app version. If the installed version is below the minimum app version, + the ignore and later buttons will be hidden. This is similar to the critical update attribute for Appcast. +- The iOS App Store query will now default to the country code of the system locale, + instead of `US`. This will help suggest upgrades to users from countries other than + the US. The country code can be overriden with the optional `countryCode` parameter. ## 2.0.0 -* Major enhancements! -* This update provides language localization in English and Spanish using the new class UpgraderMessage, with the ability to add additional languages, and customize strings. Support for Spanish is included and will work without code changes. -* A few parameters were removed, and if used, will be a breaking change. Most use of this update will not require code changes. -* Five parameters removed: buttonTitleIgnore, buttonTitleLater, buttonTitleUpdate, prompt, title. -* All parameters that were removed are now contained in the messages parameter. -* The body of the message can now be customized and uses mustache style template variables. -* Bumped version to 2.0.0 +- Major enhancements! +- This update provides language localization in English and Spanish using the new class UpgraderMessage, with the ability to add additional languages, and customize strings. Support for Spanish is included and will work without code changes. +- A few parameters were removed, and if used, will be a breaking change. Most use of this update will not require code changes. +- Five parameters removed: buttonTitleIgnore, buttonTitleLater, buttonTitleUpdate, prompt, title. +- All parameters that were removed are now contained in the messages parameter. +- The body of the message can now be customized and uses mustache style template variables. +- Bumped version to 2.0.0 ## 0.11.2 -* Removed the restriction for Flutter SDK <1.18.0 +- Removed the restriction for Flutter SDK <1.18.0 ## 0.11.1 -* Changed use of TargetPlatform and eliminated some warnings. +- Changed use of TargetPlatform and eliminated some warnings. ## 0.11.0 -* Updated Flutter SDK to <1.18.0 in support of Flutter 1.17.0. +- Updated Flutter SDK to <1.18.0 in support of Flutter 1.17.0. ## 0.10.4 -* Updated dependency xml to ">=3.5.0 <5.0.0" to improve score on pub.dev in the -Maintenance issues and suggestions section. +- Updated dependency xml to ">=3.5.0 <5.0.0" to improve score on pub.dev in the + Maintenance issues and suggestions section. ## 0.10.3 -* Updated depenency flutter_device_locale to 0.4.0, and xml to 3.5.0, to improve score on pub.dev in the -Maintenance issues and suggestions section. +- Updated depenency flutter_device_locale to 0.4.0, and xml to 3.5.0, to improve score on pub.dev in the + Maintenance issues and suggestions section. ## 0.10.2 -* Prepare for 1.0.0 version of sensors and package_info. ([dart_lsc](https://github.com/amirh/dart_lsc)) +- Prepare for 1.0.0 version of sensors and package_info. ([dart_lsc](https://github.com/amirh/dart_lsc)) ## 0.10.1 -* Downgraded Flutter to stable channel on Travis CI and CircleCI builds to align with pub.dev health scoring. -* Removed the use of TargetPlatform.macOS since it is only available on Flutter 1.13.0 and above. +- Downgraded Flutter to stable channel on Travis CI and CircleCI builds to align with pub.dev health scoring. +- Removed the use of TargetPlatform.macOS since it is only available on Flutter 1.13.0 and above. ## 0.10.0 -* Added options to hide ignore and later buttons. (Thanks to Karthik Ponnam) -* Added option to close alert dialog on tap outside of alert dialog. (Thanks to Karthik Ponnam) -* +- Added options to hide ignore and later buttons. (Thanks to Karthik Ponnam) +- Added option to close alert dialog on tap outside of alert dialog. (Thanks to Karthik Ponnam) +- ## 0.9.0 -* Added minimum support for Flutter at version 1.30.0 and above to support TargetPlatform.macOS. +- Added minimum support for Flutter at version 1.30.0 and above to support TargetPlatform.macOS. ## 0.8.1 -* Removed TargetPlatform.macOS since pub.dev does not support it yet. +- Removed TargetPlatform.macOS since pub.dev does not support it yet. ## 0.8.0 -* Added support to ITunesSearchAPI for the country query string parameter. Improved example, and added a few new iTunes tests. Minor updates based on Health suggestions from pub.dev, utilizing pedantic. +- Added support to ITunesSearchAPI for the country query string parameter. Improved example, and added a few new iTunes tests. Minor updates based on Health suggestions from pub.dev, utilizing pedantic. ## 0.7.0 -* Improved error messaging, allowed Appcast OS name (sparkle:os) to be case insensitive, example -defaults to debug logging on, and added command line app to evaluate the iTunes search. +- Improved error messaging, allowed Appcast OS name (sparkle:os) to be case insensitive, example + defaults to debug logging on, and added command line app to evaluate the iTunes search. ## 0.6.0 -* Fixed issue to not use the OS version string (deviceInfo.androidInfo.version.baseOS) when it is not a valid Semantic Version as defined here http://semver.org/. +- Fixed issue to not use the OS version string (deviceInfo.androidInfo.version.baseOS) when it is not a valid Semantic Version as defined here http://semver.org/. ## 0.5.1+1 -* updated the examples with an Appcast for Android. +- updated the examples with an Appcast for Android. ## 0.5.1 -* downgraded the xml package version to 3.4.0 to be compatible with Dart 2.2, and updated the Dart version to 2.2.0 +- downgraded the xml package version to 3.4.0 to be compatible with Dart 2.2, and updated the Dart version to 2.2.0 ## 0.5.0 -* **Breaking change**. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library. +- **Breaking change**. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library. ## 0.4.3 -* improved README documentation and example code +- improved README documentation and example code ## 0.4.2 -* fixed README file that appears on the Dart Packages website +- fixed README file that appears on the Dart Packages website ## 0.4.1 -* fixed README file that appears on the Dart Packages website +- fixed README file that appears on the Dart Packages website ## 0.4.0 -* added Appcast to support Android upgrades +- added Appcast to support Android upgrades ## 0.3.0 -* added UpgradeCard class +- added UpgradeCard class ## 0.2.0 -* added many customizations to the widget including callbacks for onIgnore, onLater, and onUpdate -* updated the README screenshot -* updated tests, improved README -* broke out widget into new file +- added many customizations to the widget including callbacks for onIgnore, onLater, and onUpdate +- updated the README screenshot +- updated tests, improved README +- broke out widget into new file ## 0.1.0 -* Initial Open Source release. +- Initial Open Source release. diff --git a/README.md b/README.md index bb6db156..7956d4cc 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ [![pub package](https://img.shields.io/pub/v/upgrader.svg)](https://pub.dartlang.org/packages/upgrader) [![GitHub Stars](https://img.shields.io/github/stars/larryaasen/upgrader.svg)](https://github.com/larryaasen/upgrader/stargazers) - Buy me a coffee +Buy me a coffee [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/upgraderpackage.svg?style=social&label=Follow%20%40upgraderpackage)](https://twitter.com/upgraderpackage) A Flutter package for prompting users to upgrade when there is a newer version of the app in the store. -## Overview +## Overview When a newer app version is available in the app store, a simple alert prompt or card is displayed. @@ -25,21 +25,23 @@ will become more likely that users on other app stores need to be nagged about u ### Platform Support | Platform | Automatically Supported? | Appcast Supported? | -| --- | --- | --- | -| ANDROID | ✅ Yes | ✅ Yes | -| IOS | ✅ Yes | ✅ Yes | -| LINUX | ❌ No | ✅ Yes | -| MACOS | ❌ No | ✅ Yes | -| WEB | ❌ No | ✅ Yes | -| WINDOWS | ❌ No | ✅ Yes | +| -------- | ------------------------ | ------------------ | +| ANDROID | ✅ Yes | ✅ Yes | +| IOS | ✅ Yes | ✅ Yes | +| LINUX | ❌ No | ✅ Yes | +| MACOS | ❌ No | ✅ Yes | +| WEB | ❌ No | ✅ Yes | +| WINDOWS | ❌ No | ✅ Yes | ## Widgets + The widgets come in two flavors: alert or card. The [UpgradeAlert](#alert-example) widget is used to display the popup alert prompt, and the [UpgradeCard](#card-example) widget is used to display the inline material design card. ## Alert Example Just wrap your body widget in the `UpgradeAlert` widget, and it will handle the rest. + ```dart class MyApp extends StatelessWidget { const MyApp({Key key}) : super(key: key); @@ -62,10 +64,10 @@ class MyApp extends StatelessWidget { ![image](screenshots/example1.png) - ## Cupertino Alert Example You can also display a Cupertino style dialog by using the `dialogStyle` parameter. + ```dart body: UpgradeAlert( upgrader: Upgrader(dialogStyle: UpgradeDialogStyle.cupertino), @@ -81,6 +83,7 @@ You can also display a Cupertino style dialog by using the `dialogStyle` paramet Just return an `UpgradeCard` widget in your build method and a material design card will be displayed when an update is detected. The widget will have width and height of 0.0 when no update is detected. + ```dart return Container( margin: EdgeInsets.fromLTRB(12.0, 0.0, 12.0, 0.0), @@ -92,9 +95,11 @@ return Container( ![image](screenshots/example2.png) ## Localization + The text displayed in the `upgrader` package is localized in [many languages](#language-localization), and supports customization. ## Release Notes + The release notes are displayed by default when a new version is available. On Android the release notes are taken from the the WHAT'S NEW section on Google Play when available, otherwise the main app description is used. @@ -105,42 +110,45 @@ For [appcast](#appcast)), the release notes are taken from the description field The Upgrader class can be customized by setting parameters in the constructor. -* appcast: Provide an Appcast that can be replaced for mock testing, defaults to ```null``` -* appcastConfig: the appcast configuration, defaults to ```null``` -* canDismissDialog: can alert dialog be dismissed on tap outside of the alert dialog, which defaults to ```false``` (not used by UpgradeCard) -* countryCode: the country code that will override the system locale, which defaults to ```null``` -* cupertinoButtonTextStyle: the text style for the cupertino dialog buttons, which defaults to ```null``` -* languageCode: the language code that will override the system locale, which defaults to ```null``` -* client: an HTTP Client that can be replaced for mock testing, defaults to ```null``` -* debugDisplayAlways: always force the upgrade to be available, defaults to ```false``` -* debugDisplayOnce: display the upgrade at least once, defaults to ```false``` -* debugLogging: display logging statements, which defaults to ```false``` -* dialogStyle: the upgrade dialog style, either ```material``` or ```cupertino```, defaults to ```material```, used only by UpgradeAlert, works on Android and iOS. -* durationUntilAlertAgain: duration until alerting user again, which defaults to ```3 days``` -* messages: optional localized messages used for display in `upgrader` -* minAppVersion: the minimum app version supported by this app. Earlier versions of this app will be forced to update to the current version. It should be a valid version string like this: ```2.0.13```. Defaults to ```null```. -* onIgnore: called when the ignore button is tapped, defaults to ```null``` -* onLater: called when the later button is tapped, defaults to ```null``` -* onUpdate: called when the update button is tapped, defaults to ```null``` -* platform: The [TargetPlatform] that identifies the platform on which the package is currently executing. Defaults to [defaultTargetPlatform]. Note that [TargetPlatform] does not include web, but includes mobile and desktop. This parameter is normally used to change the target platform during testing. -* shouldPopScope: called when the back button is tapped, defaults to ```null``` -* showIgnore: hide or show Ignore button, which defaults to ```true``` -* showLater: hide or show Later button, which defaults to ```true``` -* showReleaseNotes: hide or show release notes, which defaults to ```true``` -* upgraderOS: Provides information on which OS this code is running on, defaults to ```null``` -* willDisplayUpgrade: called when ```upgrader``` determines that an upgrade may -or may not be displayed, defaults to ```null``` +- appcast: Provide an Appcast that can be replaced for mock testing, defaults to `null` +- appcastConfig: the appcast configuration, defaults to `null` +- canDismissDialog: can alert dialog be dismissed on tap outside of the alert dialog, which defaults to `false` (not used by UpgradeCard) +- countryCode: the country code that will override the system locale, which defaults to `null` +- cupertinoButtonTextStyle: the text style for the cupertino dialog buttons, which defaults to `null` +- languageCode: the language code that will override the system locale, which defaults to `null` +- client: an HTTP Client that can be replaced for mock testing, defaults to `null` +- debugDisplayAlways: always force the upgrade to be available, defaults to `false` +- debugDisplayOnce: display the upgrade at least once, defaults to `false` +- debugLogging: display logging statements, which defaults to `false` +- dialogStyle: the upgrade dialog style, either `material` or `cupertino`, defaults to `material`, used only by UpgradeAlert, works on Android and iOS. +- durationUntilAlertAgain: duration until alerting user again, which defaults to `3 days` +- messages: optional localized messages used for display in `upgrader` +- minAppVersion: the minimum app version supported by this app. Earlier versions of this app will be forced to update to the current version. It should be a valid version string like this: `2.0.13`. Defaults to `null`. +- onIgnore: called when the ignore button is tapped, defaults to `null` +- onLater: called when the later button is tapped, defaults to `null` +- onUpdate: called when the update button is tapped, defaults to `null` +- platform: The [TargetPlatform] that identifies the platform on which the package is currently executing. Defaults to [defaultTargetPlatform]. Note that [TargetPlatform] does not include web, but includes mobile and desktop. This parameter is normally used to change the target platform during testing. +- shouldPopScope: called when the back button is tapped, defaults to `null` +- showIgnore: hide or show Ignore button, which defaults to `true` +- showLater: hide or show Later button, which defaults to `true` +- showReleaseNotes: hide or show release notes, which defaults to `true` +- upgraderOS: Provides information on which OS this code is running on, defaults to `null` +- willDisplayUpgrade: called when `upgrader` determines that an upgrade may + or may not be displayed, defaults to `null` ## Minimum App Version + The `upgrader` package can enforce a minimum app version simply by adding a version number to the description field in the app stores. For the Android Play Store, use this format: + ``` [Minimum supported app version: 1.2.3] ``` For the iOS App Store, use this format: + ``` [:mav: 1.2.3] ``` @@ -151,7 +159,6 @@ and Later buttons will automatically be hidden. ![image](screenshots/example-minappversion.png) - After the app containing this text has been submitted for review, approved, and released on the app store, the version number will be visible to the `upgrader` package. When the minimum app version is updated in the future, all previously @@ -160,17 +167,19 @@ installed apps with this package will recognize and honor that value. This overrides any value supplied in the `minAppVersion` parameter. ### Android + Add this text to the bottom of the full description field in the Google Play Console under the main store listing. ### iOS + Add this text to the bottom of the description field in App Store Connect in the description field. ## Go Router When using GoRouter (package go_router) with upgrader, you may need to provide -a navigatorKey to the ```UpgradeAlert``` widget so that the correct route +a navigatorKey to the `UpgradeAlert` widget so that the correct route context is used. Below is part of the code you will need for this. Also, checkout the [example/lib/main-gorouter.dart](example/lib/main-gorouter.dart) example for a more complete example. @@ -192,9 +201,10 @@ checkout the [example/lib/main-gorouter.dart](example/lib/main-gorouter.dart) ex ## Android Back Button -When using the ```UpgradeAlert``` widget, the Android back button will not +When using the `UpgradeAlert` widget, the Android back button will not dismiss the alert dialog by default. To allow the back button to dismiss the -dialog, use ```shouldPopScope``` and return true like this: +dialog, use `shouldPopScope` and return true like this: + ``` UpgradeAlert(Upgrader(shouldPopScope: () => true)); ``` @@ -213,9 +223,10 @@ On Android, the `upgrader` package uses the system locale to determine the count Android description and release notes language, defaults to `en`. ## Limitations + These widgets work on both Android and iOS. When running on Android the Google Play Store will provide the latest app version. - When running on iOS the App Store will provide the +When running on iOS the App Store will provide the latest app version. In all cases, the widget will display the prompt at the appropriate times. @@ -248,7 +259,9 @@ is available on the app store. The Appcast class can be used stand alone or as part of `upgrader`. ### Appcast Example + This is an Appcast example for Android. + ```dart @override Widget build(BuildContext context) { @@ -273,6 +286,7 @@ Widget build(BuildContext context) { ``` ### Appcast Sample File + ```xml @@ -289,6 +303,7 @@ Widget build(BuildContext context) { ``` ### Appcast Class + ```dart final appcast = Appcast(); final items = await appcast.parseAppcastItemsFromUri('https://raw.githubusercontent.com/larryaasen/upgrader/master/test/testappcast.xml'); @@ -320,40 +335,42 @@ The strings displayed in `upgrader` are already localized in 34 languages. New l supported in the future with minor updates. Languages supported: -* English ('en') -* Arabic ('ar') -* Bengali ('bn') -* Chinese ('zh') -* Danish ('da') -* Dutch ('nl') -* Filipino ('fil') -* French ('fr') -* German ('de') -* Greek ('el') -* Haitian Creole ('ht') -* Hebrew ('he') -* Hindi ('hi') -* Hungarian ('hu') -* Indonesian ('id') -* Italian ('it') -* Japanese ('ja') -* Kazakh ('kk') -* Khmer ('km') -* Korean ('ko') -* Lithuanian ('lt') -* Mongolian ('mn') -* Norwegian ('nb') -* Persian ('fa') -* Polish ('pl') -* Portuguese ('pt') -* Russian ('ru') -* Spanish ('es') -* Swedish ('sv') -* Tamil ('ta') -* Telugu ('te') -* Turkish ('tr') -* Ukrainian ('uk') -* Vietnamese ('vi') + +- English ('en') +- Arabic ('ar') +- Bengali ('bn') +- Chinese ('zh') +- Danish ('da') +- Dutch ('nl') +- Filipino ('fil') +- French ('fr') +- German ('de') +- Greek ('el') +- Haitian Creole ('ht') +- Hebrew ('he') +- Hindi ('hi') +- Hungarian ('hu') +- Indonesian ('id') +- Italian ('it') +- Japanese ('ja') +- Kazakh ('kk') +- Khmer ('km') +- Korean ('ko') +- Lithuanian ('lt') +- Mongolian ('mn') +- Norwegian ('nb') +- Persian ('fa') +- Pashto ('ps') +- Polish ('pl') +- Portuguese ('pt') +- Russian ('ru') +- Spanish ('es') +- Swedish ('sv') +- Tamil ('ta') +- Telugu ('te') +- Turkish ('tr') +- Ukrainian ('uk') +- Vietnamese ('vi') The `upgrader` package can be supplied with additional languages in your code by extending the `UpgraderMessages` class to provide custom values. @@ -407,7 +424,6 @@ UpgradeAlert(Upgrader(messages: UpgraderMessages(code: 'es'))); The `upgrader` package uses the [version](https://pub.dev/packages/version) package that is in compliance with the Semantic Versioning spec at http://semver.org/. - ## iTunes Search API There is a class in this Flutter package used by the `upgrader` widgets to download app details @@ -416,6 +432,7 @@ from the The class ITunesSearchAPI can be used standalone to query iTunes for app details. ### ITunesSearchAPI Example + ```dart final iTunes = ITunesSearchAPI(); final resultsFuture = iTunes.lookupByBundleId('com.google.Maps'); @@ -425,18 +442,21 @@ resultsFuture.then((results) { ``` ### Results -[![image](screenshots/results.png)](screenshots/results.png) +[![image](screenshots/results.png)](screenshots/results.png) ### Command Line App - Android There is a command line app used to display the results from Google Play Store. The code is located in bin/playstore_lookup.dart, and can be run from the command line like this: + ``` $ cd bin $ dart playstore_lookup.dart id=com.google.android.apps.mapslite ``` + Results: + ``` playstore_lookup releaseNotes: • Support plus.codes URLs• Bug fixes playstore_lookup version: 152.0.0 @@ -444,12 +464,16 @@ playstore_lookup version: 152.0.0 ``` ### Command Line App - iOS + There is a command line app used to display the results from iTunes Search. The code is located in bin/itunes_lookup.dart, and can be run from the command line like this: + ``` $ dart itunes_lookup.dart bundleid=com.google.Maps ``` + Results: + ``` upgrader: download: https://itunes.apple.com/lookup?bundleId=com.google.Maps upgrader: response statusCode: 200 @@ -469,6 +493,7 @@ To better assist in analyzing issues, please include all of the `upgrader` log, which can be enabled by setting `debugLogging` to `true`. It should look something like this: + ``` flutter: upgrader: languageCode: en flutter: upgrader: build UpgradeAlert @@ -493,7 +518,9 @@ flutter: upgrader: showDialog title: Update App? flutter: upgrader: showDialog message: A new version of Upgrader is available! Version 5.81 is now available-you have 1.0.0. flutter: upgrader: showDialog releaseNotes: Thanks for using Google Maps! This release brings bug fixes that improve our product to help you discover new places and navigate to them. ``` + Also, please include the upgrader version number from the pubspec.lock file, which should look something like this: + ``` upgrader: dependency: "direct main" @@ -504,8 +531,8 @@ Also, please include the upgrader version number from the pubspec.lock file, whi version: "3.6.0" ``` - ## Contributing + All [comments](https://github.com/larryaasen/upgrader/issues) and [pull requests](https://github.com/larryaasen/upgrader/pulls) are welcome. ## Donations / Sponsor diff --git a/lib/src/upgrade_messages.dart b/lib/src/upgrade_messages.dart index 0b03a731..3a5821a0 100644 --- a/lib/src/upgrade_messages.dart +++ b/lib/src/upgrade_messages.dart @@ -135,6 +135,11 @@ class UpgraderMessages { message = 'نسخه‌ی جدیدی از {{appName}} موجود است! نسخه‌ی {{currentAppStoreVersion}} در دسترس است ولی شما همچنان از نسخه‌ی {{currentInstalledVersion}} استفاده می‌کنید.'; break; + case 'ps': + message = + 'د {{appName}} آپلیکشن نوې نسخه شتون لري! {{currentAppStoreVersion}} شتون لري، مګر تاسو اوس هم {{currentInstalledVersion}} کاروئ.'; + break; + case 'fil': message = 'May bagong bersyon ang {{appName}} na pwede nang magamit! Ang bersyong {{currentAppStoreVersion}} ay pwede nang magamit. Ikaw ay kasalukuyang gumagamit ng bersyong {{currentInstalledVersion}}.'; @@ -276,6 +281,9 @@ class UpgraderMessages { case 'fa': message = 'ردکردن'; break; + case 'ps': + message = 'ردکول'; + break; case 'fil': message = 'HUWAG PANSININ'; break; @@ -392,6 +400,9 @@ class UpgraderMessages { case 'fa': message = 'بعدا'; break; + case 'ps': + message = 'وروسته'; + break; case 'fil': message = 'MAMAYA'; break; @@ -505,6 +516,9 @@ class UpgraderMessages { case 'fa': message = 'بروزرسانی'; break; + case 'ps': + message = 'اوس تازه کړئ'; + break; case 'fil': message = 'I-UPDATE NA NGAYON'; break; @@ -618,6 +632,9 @@ class UpgraderMessages { case 'fa': message = 'آیا بروزرسانی می‌کنید؟'; break; + case 'ps': + message = 'آی غواړئ دا اوس تازه کړئ؟'; + break; case 'fil': message = 'Gusto mo bang i-update ito ngayon?'; break; @@ -759,6 +776,7 @@ class UpgraderMessages { case 'bn': case 'el': case 'fa': + case 'ps': case 'fil': case 'ht': case 'hu': @@ -807,6 +825,9 @@ class UpgraderMessages { case 'fa': message = 'نسخه‌ی جدید'; break; + case 'ps': + message = 'نوې نسخه'; + break; case 'fil': message = 'I-update ang app?'; break; diff --git a/test/upgrader_test.dart b/test/upgrader_test.dart index 02b4152c..1e909f7c 100644 --- a/test/upgrader_test.dart +++ b/test/upgrader_test.dart @@ -994,6 +994,7 @@ void main() { verifyMessages(UpgraderMessages(code: 'da'), 'da'); verifyMessages(UpgraderMessages(code: 'es'), 'es'); verifyMessages(UpgraderMessages(code: 'fa'), 'fa'); + verifyMessages(UpgraderMessages(code: 'ps'), 'ps'); verifyMessages(UpgraderMessages(code: 'fil'), 'fil'); verifyMessages(UpgraderMessages(code: 'fr'), 'fr'); verifyMessages(UpgraderMessages(code: 'de'), 'de');