From 0a313a277cc807204a4786e8aed75d751c12eaa3 Mon Sep 17 00:00:00 2001 From: xnorly <90561547+xnorly@users.noreply.github.com> Date: Mon, 17 Jan 2022 13:27:35 +0100 Subject: [PATCH] Fix plural/singular (#6319) * Fix plural/singular When upgradableCount is 1, the banner should use singular: "You have 1 extension that needs" Otherwise the banner should use plural: "You have 2 extensions that need" * move conditional outside and duplicate strings * Update packages/page-accounts/src/Accounts/BannerExtension.tsx Co-authored-by: Jaco --- packages/page-accounts/src/Accounts/BannerExtension.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/page-accounts/src/Accounts/BannerExtension.tsx b/packages/page-accounts/src/Accounts/BannerExtension.tsx index e5dcaf2312..0db9d4ea32 100644 --- a/packages/page-accounts/src/Accounts/BannerExtension.tsx +++ b/packages/page-accounts/src/Accounts/BannerExtension.tsx @@ -40,7 +40,13 @@ function BannerExtension (): React.ReactElement | null { return ( -

{t('You have {{upgradableCount}} extensions that need to be updated with the latest chain properties in order to display the correct information for the chain you are connected to. This update includes chain metadata and chain properties.', { replace: { upgradableCount } })}

+

+ {upgradableCount === 1 + ? t('You have 1 extension that needs to be updated with the latest chain properties in order to display the correct information for the chain you are connected to.') + : t('You have {{upgradableCount}} extensions that need to be updated with the latest chain properties in order to display the correct information for the chain you are connected to.', { replace: { upgradableCount } }) + } + {t(' This update includes chain metadata and chain properties.')} +

Visit your settings page to apply the updates to the injected extensions.

);