From 274ea45cb86b2e40f93cc1916dbd47a2cfc59c2a Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 18 Jan 2026 23:01:01 +0100 Subject: [PATCH] Fix stringOrStringArrayToText --- web/components/filters/diet-filter.tsx | 1 + web/components/filters/education-filter.tsx | 1 + web/components/filters/interest-filter.tsx | 1 + web/components/filters/language-filter.tsx | 1 + web/components/filters/mbti-filter.tsx | 1 + web/components/filters/political-filter.tsx | 1 + web/components/filters/relationship-filter.tsx | 1 + web/components/filters/relationship-status-filter.tsx | 1 + web/components/filters/religion-filter.tsx | 1 + web/components/filters/romantic-filter.tsx | 1 + web/components/profile-about.tsx | 4 ++++ web/lib/util/string-or-string-array-to-text.ts | 4 ++-- 12 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/components/filters/diet-filter.tsx b/web/components/filters/diet-filter.tsx index 4653bf9..6079d72 100644 --- a/web/components/filters/diet-filter.tsx +++ b/web/components/filters/diet-filter.tsx @@ -43,6 +43,7 @@ export function DietFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/education-filter.tsx b/web/components/filters/education-filter.tsx index 729fd72..ee8802b 100644 --- a/web/components/filters/education-filter.tsx +++ b/web/components/filters/education-filter.tsx @@ -37,6 +37,7 @@ export function EducationFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/interest-filter.tsx b/web/components/filters/interest-filter.tsx index 12f4880..e463283 100644 --- a/web/components/filters/interest-filter.tsx +++ b/web/components/filters/interest-filter.tsx @@ -39,6 +39,7 @@ export function InterestFilterText(props: { {stringOrStringArrayToText({ text: options.map((o) => t(`profile.${label}.${toKey(o)}`, o)), capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/language-filter.tsx b/web/components/filters/language-filter.tsx index e747a14..72411f3 100644 --- a/web/components/filters/language-filter.tsx +++ b/web/components/filters/language-filter.tsx @@ -46,6 +46,7 @@ export function LanguageFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/mbti-filter.tsx b/web/components/filters/mbti-filter.tsx index 91dd2f3..8e8ccb2 100644 --- a/web/components/filters/mbti-filter.tsx +++ b/web/components/filters/mbti-filter.tsx @@ -42,6 +42,7 @@ export function MbtiFilterText(props: { {stringOrStringArrayToText({ text: displayTypes, capitalizeFirstLetterOption: false, + t: t, })}{' '} diff --git a/web/components/filters/political-filter.tsx b/web/components/filters/political-filter.tsx index 23f4837..8a5a567 100644 --- a/web/components/filters/political-filter.tsx +++ b/web/components/filters/political-filter.tsx @@ -47,6 +47,7 @@ export function PoliticalFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/relationship-filter.tsx b/web/components/filters/relationship-filter.tsx index a9af1cd..64398cb 100644 --- a/web/components/filters/relationship-filter.tsx +++ b/web/components/filters/relationship-filter.tsx @@ -42,6 +42,7 @@ export function RelationshipFilterText(props: { {stringOrStringArrayToText({ text: convertedRelationships, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/relationship-status-filter.tsx b/web/components/filters/relationship-status-filter.tsx index f6a16fb..7c8dba2 100644 --- a/web/components/filters/relationship-status-filter.tsx +++ b/web/components/filters/relationship-status-filter.tsx @@ -46,6 +46,7 @@ export function RelationshipStatusFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/religion-filter.tsx b/web/components/filters/religion-filter.tsx index 67a0b9f..bbe125b 100644 --- a/web/components/filters/religion-filter.tsx +++ b/web/components/filters/religion-filter.tsx @@ -48,6 +48,7 @@ export function ReligionFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/filters/romantic-filter.tsx b/web/components/filters/romantic-filter.tsx index 05f81ca..e7998b8 100644 --- a/web/components/filters/romantic-filter.tsx +++ b/web/components/filters/romantic-filter.tsx @@ -43,6 +43,7 @@ export function RomanticFilterText(props: { {stringOrStringArrayToText({ text: convertedTypes, capitalizeFirstLetterOption: true, + t: t, })}{' '} diff --git a/web/components/profile-about.tsx b/web/components/profile-about.tsx index 4dd8321..6c0ab14 100644 --- a/web/components/profile-about.tsx +++ b/web/components/profile-about.tsx @@ -42,6 +42,7 @@ export function AboutRow(props: { suffix?: string | null }) { const {icon, text, preText, suffix} = props + const t = useT() if (!text?.length && !preText && !suffix) { return <> } @@ -55,6 +56,7 @@ export function AboutRow(props: { preText: preText, asSentence: false, capitalizeFirstLetterOption: true, + t: t, }) } if (suffix) { @@ -150,6 +152,7 @@ function Seeking(props: { profile: Profile }) { preText: t('profile.interested_in', 'Interested in'), asSentence: true, capitalizeFirstLetterOption: false, + t: t, }) const noMin = (min ?? MIN_INT) <= 18 @@ -188,6 +191,7 @@ function RelationshipType(props: { profile: Profile }) { preText: t('profile.seeking', 'Seeking'), asSentence: true, capitalizeFirstLetterOption: false, + t: t, }) if (relationshipTypes?.includes('relationship')) { const romanticStyles = profile.pref_romantic_styles diff --git a/web/lib/util/string-or-string-array-to-text.ts b/web/lib/util/string-or-string-array-to-text.ts index e6c90cb..1d51d51 100644 --- a/web/lib/util/string-or-string-array-to-text.ts +++ b/web/lib/util/string-or-string-array-to-text.ts @@ -1,5 +1,4 @@ import {filterDefined} from 'common/util/array' -import {useT} from "web/lib/locale"; export default function stringOrStringArrayToText(fields: { text: string[] | string | null | undefined @@ -7,6 +6,7 @@ export default function stringOrStringArrayToText(fields: { postText?: string asSentence?: boolean capitalizeFirstLetterOption?: boolean + t: any }): string | null { const { text, @@ -14,8 +14,8 @@ export default function stringOrStringArrayToText(fields: { postText = '', asSentence, capitalizeFirstLetterOption, + t, } = fields - const t = useT() if (!text || text.length < 1) { return null