Allow for single form pronouns

This commit removes the leading slash if there is no second or third form for the pronoun.
This commit is contained in:
Sigmundur Mørkøre 2025-06-06 07:12:12 +01:00
parent 74cbfae8c3
commit b38abf2c6a

View File

@ -426,7 +426,8 @@ export class Pronoun {
if (optionN === optionG && optionsGAlt.length && this.config.pronouns.shortMorphemes !== 3) {
optionG = optionsGAlt[i < optionsGAlt.length - 1 ? i : optionsGAlt.length - 1];
}
let nameOption = `${optionN}/${optionG}`;
// If there is no secondary option, don't include a `/`
let nameOption = optionG ? `${optionN}/${optionG}` : optionN;
if (this.config.pronouns.shortMorphemes === 3) {
let thirdForms = (this.morphemes[this.config.pronouns.morphemes[2]] || '').split('&');
if (this.config.locale === 'ru' || this.config.locale === 'ua') {
@ -440,6 +441,7 @@ export class Pronoun {
options.add(nameOption);
}
return [...options];
}