A3: singular and plural counts in the Problems window
The summary and the per-file count tooltip pick one/other catalog
messages ("1 error", "3 errors") instead of the plural-free wording.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
765dbf71b7
commit
af24899ac5
3 changed files with 35 additions and 7 deletions
|
|
@ -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(
|
|||
<span class="problems__file-dir">{{ dirName(group.path) }}</span>
|
||||
<span
|
||||
class="problems__file-count"
|
||||
:title="t('problems.file.count', { count: String(group.rows.length) })"
|
||||
:title="fileCountTitle(group.rows.length)"
|
||||
>{{ group.rows.length }}</span>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue