diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index baa9fb40..df50b436 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -1155,9 +1155,29 @@ "message": "SponsorBlock crowd-sourced chapters feature is only available to people who purchase a license, or for people who are granted access for free due their past contributions" }, "unsubmittedSegmentCounts": { - "message": "You currently have {0} unsubmitted segments on {1} videos", + "message": "You currently have {0} on {1}", "description": "Example: You currently have 12 unsubmitted segments on 5 videos" }, + "unsubmittedSegmentCountsZero": { + "message": "You currently have no unsubmitted segments", + "description": "Replaces 'unsubmittedSegmentCounts' string when there are no unsubmitted segments" + }, + "unsubmittedSegmentsSingular": { + "message": "unsubmitted segment", + "description": "Example: You currently have 1 *unsubmitted segment* on 1 video" + }, + "unsubmittedSegmentsPlural": { + "message": "unsubmitted segments", + "description": "Example: You currently have 12 *unsubmitted segments* on 5 videos" + }, + "videosSingular": { + "message": "video", + "description": "Example: You currently have 3 unsubmitted segments on 1 *video*" + }, + "videosPlural": { + "message": "videos", + "description": "Example: You currently have 12 unsubmitted segments on 5 *videos*" + }, "clearUnsubmittedSegments": { "message": "Clear all segments", "description": "Label for a button in settings" diff --git a/src/components/UnsubmittedVideosComponent.tsx b/src/components/UnsubmittedVideosComponent.tsx index 18ce43d7..04542adc 100644 --- a/src/components/UnsubmittedVideosComponent.tsx +++ b/src/components/UnsubmittedVideosComponent.tsx @@ -27,7 +27,12 @@ class UnsubmittedVideosComponent extends React.Component
- {chrome.i18n.getMessage("unsubmittedSegmentCounts").replace("{0}", segmentCount.toString()).replace("{1}", videoCount.toString())} + {segmentCount == 0 ? + chrome.i18n.getMessage("unsubmittedSegmentCountsZero") : + chrome.i18n.getMessage("unsubmittedSegmentCounts") + .replace("{0}", `${segmentCount} ${chrome.i18n.getMessage("unsubmittedSegments" + (segmentCount == 1 ? "Singular" : "Plural"))}`) + .replace("{1}", `${videoCount} ${chrome.i18n.getMessage("videos" + (videoCount == 1 ? "Singular" : "Plural"))}`) + }
{videoCount > 0 &&
this.setState({tableVisible: !this.state.tableVisible})}>