From 35f11fbf672a4eb86afb8a57801a9e608d8bbe14 Mon Sep 17 00:00:00 2001 From: Ben Hall Date: Thu, 9 Dec 2021 20:42:42 +0000 Subject: [PATCH] Simple check for negative process.exitCode when active download is cancelled re #41 (#42) * slight improvements to italian * some corrections thanks to Alessandro Volturno * consistently dithering is better than inconsistency * Simple check for negative process.exitCode when active download is cancelled re #41 * added cancel download to pot * Suggested translations added to existing lanquages * First addition missed the italian evolution Co-authored-by: Phil Clifford Co-authored-by: Yannick Mauray --- assets/i18n/de.po | 7 +++++-- assets/i18n/fr.po | 5 ++++- assets/i18n/it.po | 7 +++++-- assets/i18n/quickgui.pot | 3 +++ lib/src/pages/downloader.dart | 10 ++++++++-- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/assets/i18n/de.po b/assets/i18n/de.po index ca57e3e..221496f 100644 --- a/assets/i18n/de.po +++ b/assets/i18n/de.po @@ -3,14 +3,14 @@ msgid "" msgstr "" "Project-Id-Version: quickgui\n" "POT-Creation-Date: 2021-09-29 09:59+0200\n" -"PO-Revision-Date: 2021-11-14 23:05+0100\n" +"PO-Revision-Date: 2021-12-02 20:24+0000\n" "Last-Translator: Philipp Kiemle \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 21.08.3\n" +"X-Generator: Poedit 3.0\n" "X-Poedit-Basepath: .\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -56,6 +56,9 @@ msgstr "Herunterladen …{0}%" msgid "Downloading {0}" msgstr "{0} wird herunterladen" +msgid "Download cancelled" +msgstr "Download abgebrochen" + msgid "Download complete" msgstr "Download abgeschlossen" diff --git a/assets/i18n/fr.po b/assets/i18n/fr.po index b6fbac5..f066b67 100644 --- a/assets/i18n/fr.po +++ b/assets/i18n/fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: quickgui\n" "POT-Creation-Date: 2021-09-29 09:59+0200\n" -"PO-Revision-Date: 2021-11-11 16:44+0100\n" +"PO-Revision-Date: 2021-12-02 20:23+0000\n" "Last-Translator: Yannick Mauray\n" "Language-Team: Yannick Mauray\n" "Language: fr\n" @@ -69,6 +69,9 @@ msgstr "Téléchargement...{0}%" msgid "Downloading {0}" msgstr "Téléchargement de {0}" +msgid "Download cancelled" +msgstr "Téléchargement annulé" + #, fuzzy msgid "Download complete" msgstr "Téléchargement terminé" diff --git a/assets/i18n/it.po b/assets/i18n/it.po index 25a0991..2d784c3 100644 --- a/assets/i18n/it.po +++ b/assets/i18n/it.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: quickgui\n" "POT-Creation-Date: 2021-09-29 09:59+0200\n" -"PO-Revision-Date: 2021-11-22 20:13+0000\n" -"Last-Translator: \n" +"PO-Revision-Date: 2021-12-02 20:24+0000\n" +"Last-Translator: Phil Clifford \n" "Language-Team: Italian\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -60,6 +60,9 @@ msgstr "Scaricando...{0}%" msgid "Downloading {0}" msgstr "Scaricamento di {0}" +msgid "Download cancelled" +msgstr "Scaricamento interrotto" + msgid "Download complete" msgstr "Scaricamento completato" diff --git a/assets/i18n/quickgui.pot b/assets/i18n/quickgui.pot index 7a2e745..6e4ce61 100644 --- a/assets/i18n/quickgui.pot +++ b/assets/i18n/quickgui.pot @@ -55,6 +55,9 @@ msgstr "" msgid "Downloading {0}" msgstr "" +msgid "Download cancelled" +msgstr "" + msgid "Download complete" msgstr "" diff --git a/lib/src/pages/downloader.dart b/lib/src/pages/downloader.dart index dfe3195..ac0d381 100644 --- a/lib/src/pages/downloader.dart +++ b/lib/src/pages/downloader.dart @@ -81,12 +81,18 @@ class _DownloaderState extends State { } process.exitCode.then((value) { + bool _cancelled = value.isNegative; controller.close(); setState(() { _downloadFinished = true; notificationsClient.notify( - context.t('Download complete'), - body: context.t('Download of {0} has completed.', args: [widget.operatingSystem.name]), + _cancelled ? context.t('Download cancelled') : context.t('Download complete'), + body: _cancelled + ? context.t( + 'Download of {0} has completed.', + args: [widget.operatingSystem.name], + ) + : context.t('Download cancelled.'), appName: 'Quickgui', expireTimeoutMs: 10000, /* 10 seconds */ );