From 27a7bebc32a527cc86857008b491b9571e807183 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 27 Feb 2020 19:20:51 +0100 Subject: viewer: added a count of results found in other folders when no-results are found Using list formatting for the no-result translation, instead of string concatenation --- viewer/src/locales/en.json | 6 +++--- viewer/src/views/GallerySearch.vue | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/viewer/src/locales/en.json b/viewer/src/locales/en.json index 81ddd1e..58adcd2 100644 --- a/viewer/src/locales/en.json +++ b/viewer/src/locales/en.json @@ -2,6 +2,7 @@ "tagInput.placeholder": "Filters", "tagInput.nomatch": "No match", "search.no-results": "No results", + "search.no-results.otherfolders": "No results • {0} result{1} in other folders", "panelLeft.propositions": "Related filters", "tag-propositions.substraction": "Exclude items with this tag", "tag-propositions.addition": "Include all items with this tag", @@ -13,6 +14,5 @@ "command.search.search": "Search", "command.back": "Go back", "command.parent": "Go to parent directory", - "directory.no-results": "Empty directory", - "search.no-results.otherfolders": "result(s) in other folders" -} \ No newline at end of file + "directory.no-results": "Empty directory" +} diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue index 9f2ac17..d638df2 100644 --- a/viewer/src/views/GallerySearch.vue +++ b/viewer/src/views/GallerySearch.vue @@ -49,7 +49,8 @@ export default class GalleryPicture extends Vue { } noResult() { - return `${this.$t("search.no-results")} • ${this.otherCount} ${this.$t("search.no-results.otherfolders")}`; + const params = [this.otherCount, this.otherCount > 1 ? "s" : ""]; + return this.$t("search.no-results.otherfolders", params); } } -- cgit v1.2.3