From e5c8650df0e57b03f68d69fd779a60fe447411a3 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 2 Jan 2026 18:11:29 +0200 Subject: [PATCH] Translate profile-about.tsx to french --- web/components/profile-about.tsx | 72 ++++---- web/messages/fr.json | 278 ++++++++++++++++++++++++++++--- 2 files changed, 292 insertions(+), 58 deletions(-) diff --git a/web/components/profile-about.tsx b/web/components/profile-about.tsx index 34fe9b30..4b3020b3 100644 --- a/web/components/profile-about.tsx +++ b/web/components/profile-about.tsx @@ -87,25 +87,25 @@ export default function ProfileAbout(props: { } - text={profile.work} + text={profile.work?.map(work => t(`profile.work.${toKey(work)}`, work))} /> } - text={profile.political_beliefs?.map(belief => t(`profile.about.political_beliefs.${belief}`, INVERTED_POLITICAL_CHOICES[belief]))} + text={profile.political_beliefs?.map(belief => t(`profile.political.${belief}`, INVERTED_POLITICAL_CHOICES[belief]))} suffix={profile.political_details} /> } - text={profile.religion?.map(belief => t(`profile.about.religion.${belief}`, INVERTED_RELIGION_CHOICES[belief]))} + text={profile.religion?.map(belief => t(`profile.religion.${belief}`, INVERTED_RELIGION_CHOICES[belief]))} suffix={profile.religious_beliefs} /> } - text={profile.interests?.map(interest => t(`profile.about.interests.${interest}`, interest))} + text={profile.interests?.map(interest => t(`profile.interests.${toKey(interest)}`, interest))} /> } - text={profile.causes?.map(cause => t(`profile.about.causes.${cause}`, cause))} + text={profile.causes?.map(cause => t(`profile.causes.${toKey(cause)}`, cause))} /> } @@ -115,17 +115,17 @@ export default function ProfileAbout(props: { icon={} text={profile.ethnicity ?.filter((r) => r !== 'other') - ?.map((r: any) => t(`profile.about.race.${r}`, convertRace(r)))} + ?.map((r: any) => t(`profile.race.${r}`, convertRace(r)))} /> } - text={profile.diet?.map(e => INVERTED_DIET_CHOICES[e])} + text={profile.diet?.map(e => t(`profile.diet.${e}`, INVERTED_DIET_CHOICES[e]))} /> } - text={profile.languages?.map(v => INVERTED_LANGUAGE_CHOICES[v])} + text={profile.languages?.map(v => t(`profile.language.${v}`, INVERTED_LANGUAGE_CHOICES[v]))} /> @@ -146,7 +146,7 @@ function Seeking(props: { profile: Profile }) { prefGender?.length == 5 ? ['people'] : prefGender?.map((gender) => convertGenderPlural(gender as Gender)), - preText: t('profile.about.interested_in', 'Interested in'), + preText: t('profile.interested_in', 'Interested in'), asSentence: true, capitalizeFirstLetterOption: false, }) @@ -156,14 +156,14 @@ function Seeking(props: { profile: Profile }) { const ageRangeText = noMin && noMax - ? t('profile.about.age_any', 'of any age') + ? t('profile.age_any', 'of any age') : min == max - ? t('profile.about.age_exact', 'exactly {min} years old', {min}) + ? t('profile.age_exact', 'exactly {min} years old', {min}) : noMax - ? t('profile.about.age_older_than', 'older than {min}', {min}) + ? t('profile.age_older_than', 'older than {min}', {min}) : noMin - ? t('profile.about.age_younger_than', 'younger than {max}', {max}) - : t('profile.about.age_between', 'between {min} - {max} years old', {min, max}) + ? t('profile.age_younger_than', 'younger than {max}', {max}) + : t('profile.age_between', 'between {min} - {max} years old', {min, max}) if (!prefGender || prefGender.length < 1) { return <> @@ -182,15 +182,15 @@ function RelationshipType(props: { profile: Profile }) { const relationshipTypes = profile.pref_relation_styles let seekingGenderText = stringOrStringArrayToText({ text: relationshipTypes?.map((rel) => - convertRelationshipType(rel as RelationshipType).toLowerCase() + t(`profile.relationship.${rel}`, convertRelationshipType(rel as RelationshipType)) ).sort(), - preText: t('profile.about.seeking', 'Seeking'), + preText: t('profile.seeking', 'Seeking'), asSentence: true, capitalizeFirstLetterOption: false, }) if (relationshipTypes?.includes('relationship')) { const romanticStyles = profile.pref_romantic_styles - ?.map((style) => INVERTED_ROMANTIC_CHOICES[style].toLowerCase()) + ?.map((style) => t(`profile.romantic.${style}`, INVERTED_ROMANTIC_CHOICES[style]).toLowerCase()) .filter(Boolean) if (romanticStyles && romanticStyles.length > 0) { seekingGenderText += ` (${romanticStyles.join(', ')})` @@ -215,7 +215,7 @@ function RelationshipStatus(props: { profile: Profile }) { return ( t(`profile.about.relationship_status.${v}`, INVERTED_RELATIONSHIP_STATUS_CHOICES[v]))} + text={relationship_status?.map(v => t(`profile.relationship_status.${v}`, INVERTED_RELATIONSHIP_STATUS_CHOICES[v]))} /> ) } @@ -229,10 +229,10 @@ function Education(props: { profile: Profile }) { let text = '' if (educationLevel) { - text += capitalizeAndRemoveUnderscores(t(`profile.about.education.${educationLevel}`, INVERTED_EDUCATION_CHOICES[educationLevel])) + text += capitalizeAndRemoveUnderscores(t(`profile.education.${educationLevel}`, INVERTED_EDUCATION_CHOICES[educationLevel])) } if (university) { - if (educationLevel) text += ` ${t('profile.about.at', 'at')} ` + if (educationLevel) text += ` ${t('profile.at', 'at')} ` text += capitalizeAndRemoveUnderscores(university) } if (text.length === 0) { @@ -257,7 +257,7 @@ function Occupation(props: { profile: Profile }) { } const occupationText = `${ occupation_title ? capitalizeAndRemoveUnderscores(occupation_title) : '' - }${occupation_title && company ? ` ${t('profile.about.at', 'at')} ` : ''}${ + }${occupation_title && company ? ` ${t('profile.at', 'at')} ` : ''}${ company ? capitalizeAndRemoveUnderscores(company) : '' }` return ( @@ -275,13 +275,13 @@ function Smoker(props: { profile: Profile }) { if (isSmoker == null) return null if (isSmoker) { return ( - } text={t('profile.about.smokes', 'Smokes')}/> + } text={t('profile.smokes', 'Smokes')}/> ) } return ( } - text={t('profile.about.doesnt_smoke', "Doesn't smoke")} + text={t('profile.doesnt_smoke', "Doesn't smoke")} /> ) } @@ -295,7 +295,7 @@ function Drinks(props: { profile: Profile }) { return ( } - text={t('profile.about.doesnt_drink', "Doesn't drink")} + text={t('profile.doesnt_drink', "Doesn't drink")} /> ) } @@ -304,8 +304,8 @@ function Drinks(props: { profile: Profile }) { icon={} text={ drinksPerMonth === 1 - ? t('profile.about.drinks_one', '1 drink per month') - : t('profile.about.drinks_many', '{count} drinks per month', {count: drinksPerMonth}) + ? t('profile.drinks_one', '1 drink per month') + : t('profile.drinks_many', '{count} drinks per month', {count: drinksPerMonth}) } /> ) @@ -318,14 +318,14 @@ function WantsKids(props: { profile: Profile }) { if (wantsKidsStrength == null || wantsKidsStrength < 0) return null const wantsKidsText = wantsKidsStrength == 0 - ? t('profile.about.wants_kids_0', "Does not want children") + ? t('profile.wants_kids_0', "Does not want children") : wantsKidsStrength == 1 - ? t('profile.about.wants_kids_1', "Prefers not to have children") + ? t('profile.wants_kids_1', "Prefers not to have children") : wantsKidsStrength == 2 - ? t('profile.about.wants_kids_2', "Neutral or open to having children") + ? t('profile.wants_kids_2', "Neutral or open to having children") : wantsKidsStrength == 3 - ? t('profile.about.wants_kids_3', "Leaning towards wanting children") - : t('profile.about.wants_kids_4', "Wants children") + ? t('profile.wants_kids_3', "Leaning towards wanting children") + : t('profile.wants_kids_4', "Wants children") return ( } - text={t('profile.about.last_online', 'Last online {time}', {time: fromNow(lastOnlineTime, true)})} + text={t('profile.last_online', 'Last online {time}', {time: fromNow(lastOnlineTime, true)})} /> ) } @@ -353,8 +353,8 @@ function HasKids(props: { profile: Profile }) { const hasKidsText = profile.has_kids && profile.has_kids > 0 ? profile.has_kids > 1 - ? t('profile.about.has_kids_many', 'Has {count} kids', {count: profile.has_kids}) - : t('profile.about.has_kids_one', 'Has {count} kid', {count: profile.has_kids}) + ? t('profile.has_kids_many', 'Has {count} kids', {count: profile.has_kids}) + : t('profile.has_kids_one', 'Has {count} kid', {count: profile.has_kids}) : null return } text={hasKidsText}/> } @@ -396,3 +396,7 @@ const capitalizeAndRemoveUnderscores = (str: string) => { const withSpaces = str.replace(/_/g, ' ') return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1) } + +const toKey = (str: string) => { + return str.replace(/ /g, '_').toLowerCase() +} diff --git a/web/messages/fr.json b/web/messages/fr.json index a0da5c19..6248d4d0 100644 --- a/web/messages/fr.json +++ b/web/messages/fr.json @@ -23,7 +23,7 @@ "settings.danger_zone": "Zone dangereuse", "settings.delete_account": "Supprimer le compte", "settings.delete_confirm": "Êtes-vous sûr de vouloir supprimer votre profil ? Cela ne peut pas être annulé.", - "settings.delete.loading": "Suppression du compte...", + "settings.delete.loading": "Suppression du compte..", "settings.delete.success": "Votre compte a été supprimé.", "settings.delete.error": "Échec de la suppression du compte.", "settings.email.updated_success": "Adresse e‑mail mise à jour avec succès", @@ -244,7 +244,7 @@ "register.error.email_in_use": "Cet e‑mail est déjà enregistré", "register.error.unknown": "Échec de l'inscription", "register.toast.signup_failed": "Échec de l'inscription : ", - "register.button.creating": "Création du compte...", + "register.button.creating": "Création du compte..", "register.button.email": "S'inscrire avec l'e‑mail", "register.or_sign_up_with": "Ou inscrivez-vous avec", "register.already_account": "Vous avez déjà un compte ?", @@ -471,7 +471,7 @@ "deleteyourself.confirm_phrase": "delete my account", "deleteyourself.open_label": "Supprimer définitivement ce compte", "deleteyourself.submit": "Supprimer le compte", - "deleteyourself.toast.loading": "Suppression du compte...", + "deleteyourself.toast.loading": "Suppression du compte..", "deleteyourself.toast.success": "Votre compte a été supprimé.", "deleteyourself.toast.error": "Échec de la suppression du compte.", "deleteyourself.title": "Êtes-vous sûr ?", @@ -504,25 +504,255 @@ "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", - "profile.about.interested_in": "Intéressé·e par", - "profile.about.age_any": "de tout âge", - "profile.about.age_exact": "exactement {min} ans", - "profile.about.age_older_than": "plus de {min} ans", - "profile.about.age_younger_than": "moins de {max} ans", - "profile.about.age_between": "entre {min} et {max} ans", - "profile.about.seeking": "Recherche", - "profile.about.at": "à", - "profile.about.smokes": "Fume", - "profile.about.doesnt_smoke": "Ne fume pas", - "profile.about.doesnt_drink": "Ne boit pas", - "profile.about.drinks_one": "1 boisson par mois", - "profile.about.drinks_many": "{count} boissons par mois", - "profile.about.wants_kids_0": "Ne veut pas d'enfants", - "profile.about.wants_kids_1": "Préfère ne pas avoir d'enfants", - "profile.about.wants_kids_2": "Neutre ou ouvert·e à avoir des enfants", - "profile.about.wants_kids_3": "Tend à vouloir des enfants", - "profile.about.wants_kids_4": "Veut des enfants", - "profile.about.last_online": "Dernière connexion {time}", - "profile.about.has_kids_one": "A {count} enfant", - "profile.about.has_kids_many": "A {count} enfants" + "profile.interested_in": "Intéressé·e par", + "profile.age_any": "de tout âge", + "profile.age_exact": "exactement {min} ans", + "profile.age_older_than": "plus de {min} ans", + "profile.age_younger_than": "moins de {max} ans", + "profile.age_between": "entre {min} et {max} ans", + "profile.seeking": "Recherche", + "profile.at": "à", + "profile.smokes": "Fume", + "profile.doesnt_smoke": "Ne fume pas", + "profile.doesnt_drink": "Ne boit pas", + "profile.drinks_one": "1 boisson par mois", + "profile.drinks_many": "{count} boissons par mois", + "profile.wants_kids_0": "Ne veut pas d'enfants", + "profile.wants_kids_1": "Préfère ne pas avoir d'enfants", + "profile.wants_kids_2": "Neutre ou ouvert·e à avoir des enfants", + "profile.wants_kids_3": "Tend à vouloir des enfants", + "profile.wants_kids_4": "Veut des enfants", + "profile.last_online": "Dernière connexion {time}", + "profile.has_kids_one": "A {count} enfant", + "profile.has_kids_many": "A {count} enfants", + "profile.relationship.collaboration": "Collaboration", + "profile.relationship.friendship": "Amitié", + "profile.relationship.relationship": "Relation", + "profile.relationship_status.single": "Célibataire", + "profile.relationship_status.married": "Marié·e", + "profile.relationship_status.casual": "En relation informelle", + "profile.relationship_status.long_term": "En relation à long terme", + "profile.relationship_status.open": "En relation ouverte", + "profile.romantic.mono": "Monogame", + "profile.romantic.poly": "Polyamoureux·se", + "profile.romantic.open": "Relation ouverte", + "profile.political.progressive": "Progressiste", + "profile.political.liberal": "Libéral·e", + "profile.political.moderate": "Modéré·e / Centriste", + "profile.political.conservative": "Conservateur·trice", + "profile.political.socialist": "Socialiste", + "profile.political.nationalist": "Nationaliste", + "profile.political.populist": "Populiste", + "profile.political.green": "Vert·e / Éco-socialiste", + "profile.political.technocratic": "Technocrate", + "profile.political.libertarian": "Libertarien·ne", + "profile.political.e/acc": "Accélérationnisme efficace", + "profile.political.pause ai": "Pause IA / Sceptique de la technologie", + "profile.political.other": "Indépendant·e / Autre", + "profile.diet.omnivore": "Omnivore", + "profile.diet.veg": "Végétarien·ne", + "profile.diet.vegan": "Végan·e", + "profile.diet.keto": "Cétogène", + "profile.diet.paleo": "Paléo", + "profile.diet.pescetarian": "Pescétarien·ne", + "profile.diet.other": "Autre", + "profile.education.high-school": "Lycée / Secondaire", + "profile.education.some-college": "Supérieur", + "profile.education.bachelors": "Licence / Baccalauréat", + "profile.education.masters": "Master", + "profile.education.doctorate": "Doctorat", + "profile.religion.atheist": "Athée", + "profile.religion.agnostic": "Agnostique", + "profile.religion.spiritual": "Spirituel·le", + "profile.religion.christian": "Chrétien·ne", + "profile.religion.muslim": "Musulman·e", + "profile.religion.jewish": "Juif·ve", + "profile.religion.hindu": "Hindou·e", + "profile.religion.buddhist": "Bouddhiste", + "profile.religion.sikh": "Sikh", + "profile.religion.taoist": "Taoïste", + "profile.religion.jain": "Jaïn", + "profile.religion.shinto": "Shinto", + "profile.religion.animist": "Animiste", + "profile.religion.zoroastrian": "Zoroastrien·ne", + "profile.religion.unitarian_universalist": "Unitaire universaliste", + "profile.religion.other": "Autre", + "profile.race.african": "Origine noire/africaine", + "profile.race.asian": "Asiatique de l'Est", + "profile.race.south_asian": "Asiatique du Sud/Sud-Est", + "profile.race.caucasian": "Blanc·he / Caucasien·ne", + "profile.race.hispanic": "Hispanique/Latino·a", + "profile.race.middle_eastern": "Moyen-Orient", + "profile.race.native_american": "Amérindien·ne / Autochtone", + "profile.race.other": "Autre", + "profile.language.akan": "Akan", + "profile.language.amharic": "Amharique", + "profile.language.arabic": "Arabe", + "profile.language.assamese": "Assamais", + "profile.language.awadhi": "Awadhi", + "profile.language.azerbaijani": "Azéri", + "profile.language.balochi": "Baloutche", + "profile.language.belarusian": "Biélorusse", + "profile.language.bengali": "Bengali", + "profile.language.bhojpuri": "Bhojpuri", + "profile.language.burmese": "Birman", + "profile.language.cebuano": "Cebuano", + "profile.language.chewa": "Chewa", + "profile.language.chhattisgarhi": "Chhattisgarhi", + "profile.language.chittagonian": "Chittagonien", + "profile.language.czech": "Tchèque", + "profile.language.deccan": "Déccani", + "profile.language.dhundhari": "Dhundhari", + "profile.language.dutch": "Néerlandais", + "profile.language.eastern-min": "Min de l'Est", + "profile.language.english": "Anglais", + "profile.language.french": "Français", + "profile.language.fula": "Peul", + "profile.language.gan": "Gan", + "profile.language.german": "Allemand", + "profile.language.greek": "Grec", + "profile.language.gujarati": "Gujarati", + "profile.language.haitian-creole": "Créole haïtien", + "profile.language.hakka": "Hakka", + "profile.language.haryanvi": "Haryanvi", + "profile.language.hausa": "Haoussa", + "profile.language.hiligaynon": "Hiligaynon", + "profile.language.hindi": "Hindi", + "profile.language.hmong": "Hmong", + "profile.language.hungarian": "Hongrois", + "profile.language.igbo": "Igbo", + "profile.language.ilocano": "Ilocano", + "profile.language.italian": "Italien", + "profile.language.japanese": "Japonais", + "profile.language.javanese": "Javanais", + "profile.language.jin": "Jin", + "profile.language.kannada": "Kannada", + "profile.language.kazakh": "Kazakh", + "profile.language.khmer": "Khmer", + "profile.language.kinyarwanda": "Kinyarwanda", + "profile.language.kirundi": "Kirundi", + "profile.language.konkani": "Konkani", + "profile.language.korean": "Coréen", + "profile.language.kurdish": "Kurde", + "profile.language.madurese": "Madurais", + "profile.language.magahi": "Magahi", + "profile.language.maithili": "Maithili", + "profile.language.malagasy": "Malgache", + "profile.language.malay/indonesian": "Malais/Indonésien", + "profile.language.malayalam": "Malayalam", + "profile.language.mandarin": "Mandarin", + "profile.language.marathi": "Marathi", + "profile.language.marwari": "Marwari", + "profile.language.mossi": "Mossi", + "profile.language.nepali": "Népalais", + "profile.language.northern-min": "Min du Nord", + "profile.language.odia": "Odia", + "profile.language.oromo": "Oromo", + "profile.language.pashto": "Pachto", + "profile.language.persian": "Persan", + "profile.language.polish": "Polonais", + "profile.language.portuguese": "Portugais", + "profile.language.punjabi": "Pendjabi", + "profile.language.quechua": "Quechua", + "profile.language.romanian": "Roumain", + "profile.language.russian": "Russe", + "profile.language.saraiki": "Saraiki", + "profile.language.serbo-croatian": "Serbo-croate", + "profile.language.shona": "Shona", + "profile.language.sindhi": "Sindhi", + "profile.language.sinhala": "Cingalais", + "profile.language.somali": "Somali", + "profile.language.southern-min": "Min du Sud", + "profile.language.spanish": "Espagnol", + "profile.language.sundanese": "Soundanais", + "profile.language.swedish": "Suédois", + "profile.language.swahili": "Swahili", + "profile.language.sylheti": "Sylheti", + "profile.language.tagalog": "Tagalog", + "profile.language.tamil": "Tamoul", + "profile.language.telugu": "Télougou", + "profile.language.thai": "Thaï", + "profile.language.turkish": "Turc", + "profile.language.turkmen": "Turkmène", + "profile.language.ukrainian": "Ukrainien", + "profile.language.urdu": "Ourdou", + "profile.language.uyghur": "Ouïghour", + "profile.language.uzbek": "Ouzbek", + "profile.language.vietnamese": "Vietnamien", + "profile.language.wu": "Wu", + "profile.language.xhosa": "Xhosa", + "profile.language.xiang": "Xiang", + "profile.language.yoruba": "Yoruba", + "profile.language.yue": "Yue", + "profile.language.zhuang": "Zhuang", + "profile.language.zulu": "Zoulou", + "profile.interests.crafting": "Artisanat", + "profile.interests.piano": "Piano", + "profile.interests.guitar": "Guitare", + "profile.interests.cooking": "Cuisine", + "profile.interests.crochet": "Crochet", + "profile.interests.collecting": "Collection", + "profile.interests.dancing": "Danse", + "profile.interests.video_games": "Jeux vidéo", + "profile.interests.photography": "Photographie", + "profile.interests.traveling": "Voyage", + "profile.interests.running": "Course à pied", + "profile.interests.chess": "Échecs", + "profile.interests.coding": "Programmation", + "profile.interests.writing": "Écriture", + "profile.interests.reading": "Lecture", + "profile.interests.gym": "Salle de sport", + "profile.interests.music_listening": "Écoute de musique", + "profile.interests.gardening": "Jardinage", + "profile.interests.music_playing": "Pratique musicale", + "profile.interests.hiking": "Randonnée", + "profile.interests.meditation": "Méditation", + "profile.interests.yoga": "Yoga", + "profile.interests.game_design": "Conception de jeux", + "profile.interests.drawing": "Dessin", + "profile.interests.painting": "Peinture", + "profile.interests.pottery": "Poterie", + "profile.interests.philosophy": "Philosophie", + "profile.causes.disaster_relief": "Secours en cas de catastrophe", + "profile.causes.gender_equality": "Égalité des genres", + "profile.causes.cause_agnostic": "Cause agnostique", + "profile.causes.human_rights": "Droits humains", + "profile.causes.degrowth": "Décroissance", + "profile.causes.animal_rights": "Droits des animaux", + "profile.causes.biodiversity": "Biodiversité", + "profile.causes.mental_health": "Santé mentale", + "profile.causes.sustainability": "Durabilité", + "profile.causes.animal_welfare": "Bien-être animal", + "profile.causes.climate_change": "Changement climatique", + "profile.causes.extreme_poverty": "Pauvreté extrême", + "profile.causes.education": "Éducation", + "profile.causes.ai_safety": "Sécurité de l'IA", + "profile.work.law": "Droit", + "profile.work.it": "Informatique", + "profile.work.construction": "Construction", + "profile.work.music": "Musique", + "profile.work.film": "Cinéma", + "profile.work.medicine": "Médecine", + "profile.work.nursing": "Soins infirmiers", + "profile.work.tourism": "Tourisme", + "profile.work.sports": "Sport", + "profile.work.agriculture": "Agriculture", + "profile.work.spirits_maker": "Fabricant de spiritueux", + "profile.work.engineering": "Ingénierie", + "profile.work.journalism": "Journalisme", + "profile.work.academia": "Monde universitaire", + "profile.work.data_science": "Science des données", + "profile.work.social_work": "Travail social", + "profile.work.social_enterprise": "Entreprise sociale", + "profile.work.research_and_design": "Recherche et conception", + "profile.work.human_resources": "Ressources humaines", + "profile.work.consulting": "Conseil", + "profile.work.management": "Gestion", + "profile.work.marketing": "Marketing", + "profile.work.fashion": "Mode", + "profile.work.education": "Éducation", + "profile.work.graphic_design": "Design graphique", + "profile.work.content_design": "Design de contenu", + "profile.work.sales": "Vente", + "profile.work.finance": "Finance" } \ No newline at end of file