From 04e333aa36600ca3106eddeea714af31cc9f9db9 Mon Sep 17 00:00:00 2001 From: myl7 Date: Sun, 6 Feb 2022 20:09:59 +0800 Subject: [PATCH] fix double plurals with context --- components/FileListing.tsx | 7 +++++-- i18next-parser.config.js | 1 + next-i18next.config.js | 7 ++++++- public/locales/en/common.json | 8 ++++++-- public/locales/zh-CN/common.json | 4 +++- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/components/FileListing.tsx b/components/FileListing.tsx index 499f330..2df9202 100644 --- a/components/FileListing.tsx +++ b/components/FileListing.tsx @@ -321,10 +321,13 @@ const FileListing: FC<{ query?: ParsedUrlQuery }> = ({ query }) => { {!onlyOnePage && (
- {t('- showing {{count}} page(s) of {{totalFileNum}} files -', { + {t('- showing {{count}} page(s) ', { count: size, totalFileNum: isLoadingMore ? '...' : folderChildren.length - })} + }) + + (isLoadingMore + ? t('of {{count}} file(s) -', { count: folderChildren.length, context: 'loading' }) + : t('of {{count}} file(s) -', { count: folderChildren.length, context: 'loaded' }))}