From 3d64fb24315689a855a17cdf07a4da1009705ade Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 5 Sep 2020 08:59:10 -0700 Subject: [PATCH] fix(pagination): use singular page range text if total is 1 --- src/Pagination/Pagination.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pagination/Pagination.svelte b/src/Pagination/Pagination.svelte index 9776867a..f23f8659 100644 --- a/src/Pagination/Pagination.svelte +++ b/src/Pagination/Pagination.svelte @@ -82,7 +82,8 @@ * Override the page range text * @type {(current: number, total: number) => string} [pageRangeText = (current: number, total: number) => string] */ - export let pageRangeText = (current, total) => `of ${total} pages`; + export let pageRangeText = (current, total) => + `of ${total} page${total === 1 ? "" : "s"}`; /** * Set an id for the top-level element