From 4abed529d381a461ed5ed0af187acd4c7d9939f0 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 2 Jan 2026 19:23:12 +0200 Subject: [PATCH] Translate compat prompts --- .../answer-compatibility-question-content.tsx | 8 ++-- .../compatibility-questions-display.tsx | 3 +- web/components/profile-about.tsx | 2 +- web/components/profile-comment-section.tsx | 37 +++++++++---------- web/messages/fr.json | 21 +++++++++++ 5 files changed, 45 insertions(+), 26 deletions(-) diff --git a/web/components/answers/answer-compatibility-question-content.tsx b/web/components/answers/answer-compatibility-question-content.tsx index ca196f51..a07b52ee 100644 --- a/web/components/answers/answer-compatibility-question-content.tsx +++ b/web/components/answers/answer-compatibility-question-content.tsx @@ -194,7 +194,7 @@ export function AnswerCompatibilityQuestionContent(props: { )} > - {t('answers.content.your_answer', 'Your answer')} + {t('answers.preferred.your_answer', 'Your answer')} @@ -217,7 +217,7 @@ export function AnswerCompatibilityQuestionContent(props: { {t('answers.content.importance', 'Importance')} [t(`answers.importance.${v}`, k), v]))} setChoice={(choice: number) => setAnswer({...answer, importance: choice}) } @@ -263,7 +263,7 @@ export function AnswerCompatibilityQuestionContent(props: { skipLoading && 'animate-pulse' )} > - {t('answers.content.skip', 'Skip')} + {t('answers.menu.skip', 'Skip')} )} diff --git a/web/components/answers/compatibility-questions-display.tsx b/web/components/answers/compatibility-questions-display.tsx index 500a7ad8..9195fd7a 100644 --- a/web/components/answers/compatibility-questions-display.tsx +++ b/web/components/answers/compatibility-questions-display.tsx @@ -704,9 +704,10 @@ function CompatibilityDisplay(props: { function ImportanceDisplay(props: { importance: number }) { const {importance} = props + const t = useT() return ( - {getStringKeyFromNumValue(importance, IMPORTANCE_CHOICES)} + {t(`answers.importance.${importance}`, getStringKeyFromNumValue(importance, IMPORTANCE_CHOICES) as string)} ) } diff --git a/web/components/profile-about.tsx b/web/components/profile-about.tsx index 4b3020b3..b1c15189 100644 --- a/web/components/profile-about.tsx +++ b/web/components/profile-about.tsx @@ -145,7 +145,7 @@ function Seeking(props: { profile: Profile }) { text: prefGender?.length == 5 ? ['people'] - : prefGender?.map((gender) => convertGenderPlural(gender as Gender)), + : prefGender?.map((gender) => t(`profile.gender.plural.${gender}`, convertGenderPlural(gender as Gender)).toLowerCase()), preText: t('profile.interested_in', 'Interested in'), asSentence: true, capitalizeFirstLetterOption: false, diff --git a/web/components/profile-comment-section.tsx b/web/components/profile-comment-section.tsx index 777576de..49f60f93 100644 --- a/web/components/profile-comment-section.tsx +++ b/web/components/profile-comment-section.tsx @@ -1,19 +1,16 @@ -import { Col } from 'web/components/layout/col' -import { groupBy, orderBy } from 'lodash' -import { useLiveCommentsOnProfile } from 'web/hooks/use-comments-on-profile' -import { - ProfileCommentInput, - ProfileProfileCommentThread, -} from 'web/components/profile-comments' -import { User } from 'common/user' -import { Row } from 'web/components/layout/row' +import {Col} from 'web/components/layout/col' +import {groupBy, orderBy} from 'lodash' +import {useLiveCommentsOnProfile} from 'web/hooks/use-comments-on-profile' +import {ProfileCommentInput, ProfileProfileCommentThread,} from 'web/components/profile-comments' +import {User} from 'common/user' +import {Row} from 'web/components/layout/row' import ShortToggle from 'web/components/widgets/short-toggle' -import { useState } from 'react' -import { updateProfile } from 'web/lib/api' -import { Tooltip } from 'web/components/widgets/tooltip' -import { toast } from 'react-hot-toast' -import { Subtitle } from './widgets/profile-subtitle' -import { Profile } from 'common/profiles/profile' +import {useState} from 'react' +import {updateProfile} from 'web/lib/api' +import {Tooltip} from 'web/components/widgets/tooltip' +import {toast} from 'react-hot-toast' +import {Subtitle} from './widgets/profile-subtitle' +import {Profile} from 'common/profiles/profile' import {useT} from "web/lib/locale"; export const ProfileCommentSection = (props: { @@ -22,7 +19,7 @@ export const ProfileCommentSection = (props: { currentUser: User | null | undefined simpleView?: boolean }) => { - const { onUser, currentUser, simpleView } = props + const {onUser, currentUser, simpleView} = props const t = useT() const comments = useLiveCommentsOnProfile(onUser.id).filter((c) => !c.hidden) const parentComments = comments.filter((c) => !c.replyToCommentId) @@ -47,8 +44,8 @@ export const ProfileCommentSection = (props: { { - const update = { comments_enabled: on } - setProfile((l) => ({ ...l, ...update })) + const update = {comments_enabled: on} + setProfile((l) => ({...l, ...update})) toast.promise(updateProfile(update), { loading: on ? t('profile.comments.enabling', 'Enabling endorsements from others') @@ -86,11 +83,11 @@ export const ProfileCommentSection = (props: { {!profile.comments_enabled && (isCurrentUser ? ( - {t('profile.comments.feature_disabled_other', 'This feature is disabled')} + {t('profile.comments.feature_disabled_self', 'This feature is disabled')} ) : ( - {t('profile.comments.feature_disabled_other', '{name} has disabled endorsements from others.', { name: onUser.name })} + {t('profile.comments.feature_disabled_other', '{name} has disabled endorsements from others.', {name: onUser.name})} ))} diff --git a/web/messages/fr.json b/web/messages/fr.json index a341e44b..f57b07f5 100644 --- a/web/messages/fr.json +++ b/web/messages/fr.json @@ -490,11 +490,14 @@ "answers.answer.view_list": "Voir la liste des questions", "answers.answer.answer_skipped": "Répondre à {n} questions ignorées", "answers.preferred.your_answer": "Votre réponse", + "answers.content.answers_you_accept": "Réponses que vous acceptez", "answers.preferred.user_answer": "La réponse de {name}", "answers.menu.edit": "Modifier", "answers.menu.delete": "Supprimer", "answers.menu.skip": "Ignorer", "answers.compatible": "Compatible", + "answers.finish": "Terminer", + "answers.next": "Suivant", "answers.incompatible": "Incompatible", "answers.modal.preferred_of_user": "Les réponses préférées de {name}", "answers.modal.user_marked": "{name} a marqué ceci comme ", @@ -505,6 +508,21 @@ "answers.free.add_free_response": "Ajouter une réponse libre", "answers.free.choose_question": "Choisissez une question à laquelle répondre", "answers.free.see_others": "Voir {count} autres réponses", + "answers.display.your_prompts": "Vos questions de compatibilité", + "answers.display.user_prompts": "Questions de compatibilité de {name}", + "answers.display.none_answered_you": "Vous n'avez pas encore répondu aux questions de compatibilité !", + "answers.display.none_answered_user": "{name} n'a pas encore répondu aux questions de compatibilité !", + "answers.display.add_some": "Ajoutez-en pour mieux voir avec qui vous seriez le plus compatible.", + "answers.display.already_answered_all": "Vous avez déjà répondu à toutes les questions de compatibilité —", + "answers.display.answer_more": "Répondez à plus de questions pour augmenter vos scores de compatibilité — ou ", + "answers.display.none": "Aucune", + "answers.display.acceptable": "Acceptable", + "answers.display.also_acceptable": "Également acceptable", + "answers.importance.0": "Peu important", + "answers.importance.1": "Assez important", + "answers.importance.2": "Important", + "answers.importance.3": "Très important", + "answers.content.your_thoughts": "Vos pensées (optionnelles, mais recommendées)", "profile.interested_in": "Intéressé·e par", "profile.age_any": "de tout âge", "profile.age_exact": "exactement {min} ans", @@ -527,8 +545,11 @@ "profile.has_kids_one": "A {count} enfant", "profile.has_kids_many": "A {count} enfants", "profile.gender.male": "Homme", + "profile.gender.plural.male": "Hommes", "profile.gender.female": "Femme", + "profile.gender.plural.female": "Femmes", "profile.gender.other": "Autre", + "profile.gender.plural.other": "Autres", "profile.relationship.collaboration": "Collaboration", "profile.relationship.friendship": "Amitié", "profile.relationship.relationship": "Relation",