diff --git a/ui/src/components/problems/ProblemsToolWindow.vue b/ui/src/components/problems/ProblemsToolWindow.vue index 2d58da2..6803403 100644 --- a/ui/src/components/problems/ProblemsToolWindow.vue +++ b/ui/src/components/problems/ProblemsToolWindow.vue @@ -68,13 +68,27 @@ const status = computed(() => { return t("problems.empty"); } const c = problems.counts; + const others = c.info + c.hint; return t("problems.summary", { - errors: String(c.error), - warnings: String(c.warning), - infos: String(c.info + c.hint), + errors: + c.error === 1 ? t("problems.count.error.one") : t("problems.count.error.other", { count: String(c.error) }), + warnings: + c.warning === 1 + ? t("problems.count.warning.one") + : t("problems.count.warning.other", { count: String(c.warning) }), + infos: t("problems.count.other", { count: String(others) }), }); }); +/** + * The tooltip of a file's problem count, singular for one. + * + * @param count - the file's problems. + */ +function fileCountTitle(count: number): string { + return count === 1 ? t("problems.file.count.one") : t("problems.file.count.other", { count: String(count) }); +} + /** A file with its rows and their indexes in the flat list. */ interface ProblemGroup { /** Project-relative path. */ @@ -238,7 +252,7 @@ watch( {{ dirName(group.path) }} {{ group.rows.length }}