From a929851662830683a337230e4da6f689c88211b1 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Wed, 17 Aug 2022 13:25:08 +0100 Subject: [PATCH] fix: minor time improvement --- assets/i18n/en.json | 1 + lib/ui/widgets/latest_commit_card.dart | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/i18n/en.json b/assets/i18n/en.json index 8817561e..f9e1cc73 100644 --- a/assets/i18n/en.json +++ b/assets/i18n/en.json @@ -17,6 +17,7 @@ }, "latestCommitCard": { "loadingLabel": "Loading", + "timeagoLabel": "{time} ago", "patcherLabel": "Patcher: ", "managerLabel": "Manager: ", "updateButton": "Update Manager" diff --git a/lib/ui/widgets/latest_commit_card.dart b/lib/ui/widgets/latest_commit_card.dart index 052b00de..8fbd1dff 100644 --- a/lib/ui/widgets/latest_commit_card.dart +++ b/lib/ui/widgets/latest_commit_card.dart @@ -55,7 +55,11 @@ class _LatestCommitCardState extends State { ), builder: (context, snapshot) => Text( snapshot.data!.isNotEmpty - ? snapshot.data! + ? FlutterI18n.translate( + context, + 'latestCommitCard.timeagoLabel', + translationParams: {'time': snapshot.data!}, + ) : FlutterI18n.translate( context, 'latestCommitCard.loadingLabel', @@ -88,7 +92,11 @@ class _LatestCommitCardState extends State { ), builder: (context, snapshot) => Text( snapshot.data!.isNotEmpty - ? snapshot.data! + ? FlutterI18n.translate( + context, + 'latestCommitCard.timeagoLabel', + translationParams: {'time': snapshot.data!}, + ) : FlutterI18n.translate( context, 'latestCommitCard.loadingLabel',