docs(hud): describe the character-only summary cap and trim comments

This commit is contained in:
German Khokhlov committed 2026-11-03 14:34:32 +04:00
1 parent 33381c5981
commit ab8691383b
4 files changed
+12 -14

No files matched your search

+5 -5
View File
@@ -52,11 +52,11 @@ function toHudSummary(value, requested) {
.split(/\s+/)
.map((word) => word.replace(/^['’·・-]+|['’·・-]+$/gu, ''))
.filter(Boolean);
// Japanese and Chinese have no spaces to count words by: cap characters.
if (hudSummaryIsUnspaced(locale))
return capAtWord(words.join(' '), HUD_SUMMARY_MAX_UNSPACED_CHARS, locale);
// No word count: the model counts Rue de Rivoli as one word.
return capAtWord(words.join(' '), HUD_SUMMARY_MAX_CHARS, locale);
// Characters, not words: the model counts Rue de Rivoli as one word.
const max = hudSummaryIsUnspaced(locale)
? HUD_SUMMARY_MAX_UNSPACED_CHARS
: HUD_SUMMARY_MAX_CHARS;
return capAtWord(words.join(' '), max, locale);
}
/**