From eefc88a3ba4964054f7c1fee109ad5e292b5f7ae Mon Sep 17 00:00:00 2001 From: Chris Beer <cabeer@stanford.edu> Date: Tue, 15 Jun 2021 14:22:22 -0700 Subject: [PATCH] Pluralize item counts for English, at least; fixes #3268 (#3446) --- src/components/ManifestListItem.js | 2 +- src/components/WindowSideBarAnnotationsPanel.js | 2 +- src/locales/en/translation.json | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/ManifestListItem.js b/src/components/ManifestListItem.js index 12f8516d2..1b4ae7d35 100644 --- a/src/components/ManifestListItem.js +++ b/src/components/ManifestListItem.js @@ -135,7 +135,7 @@ export class ManifestListItem extends React.Component { </Grid> <Grid item xs={8} sm={4}> <Typography className={ns('manifest-list-item-provider')}>{provider || t('addedFromUrl')}</Typography> - <Typography>{t('numItems', { number: size })}</Typography> + <Typography>{t('numItems', { count: size, number: size })}</Typography> </Grid> <Grid item xs={4} sm={2}> diff --git a/src/components/WindowSideBarAnnotationsPanel.js b/src/components/WindowSideBarAnnotationsPanel.js index 06068abe3..94dd83145 100644 --- a/src/components/WindowSideBarAnnotationsPanel.js +++ b/src/components/WindowSideBarAnnotationsPanel.js @@ -26,7 +26,7 @@ export class WindowSideBarAnnotationsPanel extends Component { titleControls={<AnnotationSettings windowId={windowId} />} > <div className={classes.section}> - <Typography component="p" variant="subtitle2">{t('showingNumAnnotations', { number: annotationCount })}</Typography> + <Typography component="p" variant="subtitle2">{t('showingNumAnnotations', { count: annotationCount, number: annotationCount })}</Typography> </div> {canvasIds.map((canvasId, index) => ( diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 72b645b83..4065408ec 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -93,7 +93,8 @@ "moveCompanionWindowToRight": "Move to right", "nextCanvas": "Next item", "noItemSelected": "No item selected", - "numItems": "{{number}} items", + "numItems": "{{number}} item", + "numItems_plural": "{{number}} items", "off": "Off", "openCompanionWindow_annotations": "Annotations", "openCompanionWindow_attribution": "Rights", @@ -121,7 +122,8 @@ "searchSubmitAria": "Submit search", "searchTitle": "Search", "selectWorkspaceMenu": "Select workspace type", - "showingNumAnnotations": "Showing {{number}} annotations", + "showingNumAnnotations": "Showing {{number}} annotation", + "showingNumAnnotations_plural": "Showing {{number}} annotations", "showCollection": "Show collection", "showZoomControls": "Show zoom controls", "sidebarPanelsNavigation": "Sidebar panels navigation", @@ -134,8 +136,10 @@ "thumbnailNavigation": "Thumbnails", "thumbnails": "Thumbnails", "toggleWindowSideBar": "Toggle sidebar", - "totalCollections": "{{count}} collections", - "totalManifests": "{{count}} manifests", + "totalCollections": "{{count}} collection", + "totalCollections_plural": "{{count}} collections", + "totalManifests": "{{count}} manifest", + "totalManifests_plural": "{{count}} manifests", "tryAgain": "Try again", "untitled": "[Untitled]", "view": "View", -- GitLab