From 810b8f89f7963aa493ba8a711df1a42a409f09d0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 20 Dec 2020 11:47:16 +0200 Subject: [PATCH] Add tooltips --- lib/ui/app/menu_drawer.dart | 9 ++++++--- lib/utils/i18n.dart | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index da5bf0757..ce5c18cac 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -602,6 +602,7 @@ class SidebarFooter extends StatelessWidget { ) else if (account.isUpdateAvailable) IconButton( + tooltip: localization.updateAvailable, icon: Icon( Icons.warning, color: Theme.of(context).accentColor, @@ -932,8 +933,7 @@ void _showAbout(BuildContext context) async { ), AppButton( label: 'Flutter/Dart', - iconData: - MdiIcons.desktopClassic, + iconData: MdiIcons.desktopClassic, onPressed: () => launch(kSourceCodeFrontend), ), @@ -1009,7 +1009,10 @@ void _showAbout(BuildContext context) async { }, ), AppButton( - label: localization.forceUpdate.toUpperCase(), + label: (state.account.isUpdateAvailable + ? localization.updateApp + : localization.forceUpdate) + .toUpperCase(), iconData: MdiIcons.update, color: Colors.orange, onPressed: () => _showUpdate(context), diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index 057bacfae..2b4f0bc57 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { // STARTER: lang key - do not remove comment + 'update_app': 'Update App', 'started_import': 'Successfully started import', 'duplicate_column_mapping': 'Duplicate column mapping', 'uses_inclusive_taxes': 'Uses Inclusive Taxes', @@ -5309,6 +5310,8 @@ mixin LocalizationsProvider on LocaleCodeAware { String get startedImport => _localizedValues[localeCode]['started_import'] ?? ''; + String get updateApp => _localizedValues[localeCode]['update_app'] ?? ''; + String lookup(String key) { final lookupKey = toSnakeCase(key);