diff --git a/components/pronouns/PronounsIndex.vue b/components/pronouns/PronounsIndex.vue
index 993f0b8de..a74e2d16a 100644
--- a/components/pronouns/PronounsIndex.vue
+++ b/components/pronouns/PronounsIndex.vue
@@ -63,7 +63,7 @@ const anyPronouns = buildAnyPronounsList(config, pronounLibrary);
-
+
diff --git a/server/api/search.get.ts b/server/api/search.get.ts
index cc4df4506..297fd6449 100644
--- a/server/api/search.get.ts
+++ b/server/api/search.get.ts
@@ -13,10 +13,10 @@ import { getSourcesEntries } from '~/server/express/sources.ts';
import { getTermsEntries } from '~/server/express/terms.ts';
import { loadSuml, loadSumlFromBase } from '~/server/loader.ts';
import { rootDir } from '~/server/paths.ts';
-import { parsePronouns } from '~/src/buildPronoun.ts';
+import { parsePronounGroups, parsePronouns, shortForVariant } from '~/src/buildPronoun.ts';
import { buildCalendar } from '~/src/calendar/calendar.ts';
import { Day } from '~/src/calendar/helpers.ts';
-import { genders, gendersWithNumerus } from '~/src/classes.ts';
+import { genders, gendersWithNumerus, PronounLibrary } from '~/src/classes.ts';
import forbidden from '~/src/forbidden.ts';
import { clearLinkedText, buildImageUrl } from '~/src/helpers.ts';
import parseMarkdown from '~/src/parseMarkdown.ts';
@@ -472,7 +472,9 @@ const kinds: SearchKind[] = [
}
const pronouns = parsePronouns(config, loadTsv(`${rootDir}/data/pronouns/pronouns.tsv`));
- return Object.values(pronouns).map((pronoun, id): SearchDocument => {
+ const pronounGroups = parsePronounGroups(loadTsv(`${rootDir}/data/pronouns/pronounGroups.tsv`));
+ const pronounLibrary = new PronounLibrary(config, pronounGroups, pronouns);
+ const documents = Object.values(pronouns).map((pronoun, id): SearchDocument => {
const description = Array.isArray(pronoun.description)
? pronoun.description.join()
: pronoun.description;
@@ -491,6 +493,83 @@ const kinds: SearchKind[] = [
content: `${description}: ${history} ${morphemes}`,
};
});
+
+ if (config.pronouns.generator.enabled) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.route)}#generator`,
+ title: translator.translate('home.generator.header'),
+ content: translator.translate('home.generator.description'),
+ });
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.route)}#multiple`,
+ title: config.pronouns.multiple.name,
+ content: clearLinkedText(config.pronouns.multiple.description, false),
+ });
+ if (config.pronouns.null !== false) {
+ for (const variant of config.pronouns.null.routes) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(variant)}`,
+ title: shortForVariant('null', variant, translator),
+ content: clearLinkedText(translator.translate('pronouns.null.description'), false),
+ });
+ }
+ }
+ if (config.pronouns.emoji !== false) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.route)}#emoji`,
+ title: config.pronouns.emoji.description,
+ content: clearLinkedText(config.pronouns.emoji.history, false),
+ });
+ }
+ if (config.pronouns.mirror) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.mirror.route)}`,
+ title: clearLinkedText(config.pronouns.mirror.name, false),
+ content: clearLinkedText(config.pronouns.mirror.description, false),
+ });
+ }
+ if (config.pronouns.any) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.any)}`,
+ title: translator.translate('pronouns.any.short'),
+ content: clearLinkedText(translator.translate('pronouns.any.description'), false),
+ });
+ for (const [variant, merged] of Object.entries(pronounLibrary.byKey())) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(config.pronouns.any)}:${encodeURIComponent(variant)}`,
+ title: merged.short(translator),
+ content: clearLinkedText(translator.translate('pronouns.any.description'), false),
+ });
+ }
+ }
+ if (config.pronouns.ask) {
+ for (const variant of config.pronouns.ask.routes) {
+ documents.push({
+ id: documents.length,
+ kind: this.kind,
+ url: `/${encodeURIComponent(variant)}`,
+ title: shortForVariant('ask', variant, translator),
+ content: clearLinkedText(translator.translate('pronouns.ask.description'), false),
+ });
+ }
+ }
+ }
+
+ return documents;
},
transformDocument(transformed: SearchDocument, termsByField: Record) {
transformed.title = `${transformed.title}`;