Skip to content

Commit

Permalink
Merge pull request #166 from bento-platform/new-translations
Browse files Browse the repository at this point in the history
New translations
  • Loading branch information
davidlougheed authored Jul 15, 2024
2 parents 5c639be + d2e0df5 commit fb80193
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 16 deletions.
24 changes: 13 additions & 11 deletions src/js/components/Search/SearchResultsPane.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import React, { useCallback } from 'react';
import { Card, Col, Row, Statistic, Typography, Space } from 'antd';
import { TeamOutlined } from '@ant-design/icons';
import { BiDna } from 'react-icons/bi';
import { PieChart } from 'bento-charts';
import CustomEmpty from '../Util/CustomEmpty';
import ExpSvg from '../Util/ExpSvg';
import { BOX_SHADOW, COUNTS_FILL, PIE_CHART_HEIGHT } from '@/constants/overviewConstants';
import { useTranslationDefault } from '@/hooks';
import { useTranslationDefault, useTranslationCustom } from '@/hooks';
import { ChartData } from '@/types/data';

const SearchResultsPane = ({
Expand All @@ -19,7 +19,9 @@ const SearchResultsPane = ({
experimentCount,
experimentChartData,
}: SearchResultsPaneProps) => {
const t = useTranslationDefault();
const td = useTranslationDefault();
const t = useTranslationCustom();
const translateMap = useCallback(({ x, y }: { x: string; y: number }) => ({ x: t(x), y }), [t]);

return (
<div style={{ paddingBottom: 8, display: 'flex', justifyContent: 'center', width: '100%' }}>
Expand All @@ -46,19 +48,19 @@ const SearchResultsPane = ({
<Col xs={24} lg={4}>
<Space direction="vertical" size="middle" style={{ display: 'flex' }}>
<Statistic
title={t('Individuals')}
value={hasInsufficientData ? t(message) : individualCount}
title={td('Individuals')}
value={hasInsufficientData ? td(message) : individualCount}
valueStyle={{ color: COUNTS_FILL }}
prefix={<TeamOutlined />}
/>
<Statistic
title={t('Biosamples')}
title={td('Biosamples')}
value={hasInsufficientData ? '----' : biosampleCount}
valueStyle={{ color: COUNTS_FILL }}
prefix={<BiDna />}
/>
<Statistic
title={t('Experiments')}
title={td('Experiments')}
value={hasInsufficientData ? '----' : experimentCount}
valueStyle={{ color: COUNTS_FILL }}
prefix={<ExpSvg />}
Expand All @@ -67,20 +69,20 @@ const SearchResultsPane = ({
</Col>
<Col xs={24} lg={10}>
<Typography.Title level={5} style={{ marginTop: 0 }}>
{t('Biosamples')}
{td('Biosamples')}
</Typography.Title>
{!hasInsufficientData && biosampleChartData.length ? (
<PieChart data={biosampleChartData} height={PIE_CHART_HEIGHT} sort={true} />
<PieChart data={biosampleChartData} height={PIE_CHART_HEIGHT} sort={true} dataMap={translateMap} />
) : (
<CustomEmpty text="No Results" />
)}
</Col>
<Col xs={24} lg={10}>
<Typography.Title level={5} style={{ marginTop: 0 }}>
{t('Experiments')}
{td('Experiments')}
</Typography.Title>
{!hasInsufficientData && experimentChartData.length ? (
<PieChart data={experimentChartData} height={PIE_CHART_HEIGHT} sort={true} />
<PieChart data={experimentChartData} height={PIE_CHART_HEIGHT} sort={true} dataMap={translateMap} />
) : (
<CustomEmpty text="No Results" />
)}
Expand Down
102 changes: 101 additions & 1 deletion src/public/locales/en/translation_en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"years": "years",
"MALE": "MALE",
"FEMALE": "FEMALE",
"Age": "Age",
Expand All @@ -12,5 +13,104 @@
"Types of experiments performed on a sample": "Types of experiments performed on a sample",
"Demographics": "Demographics",
"I have no problems in walking about": "I have no problems in walking about",
"Results": "Results"
"Results": "Results",
"General": "General",
"Measurements": "Measurements",
"Medical Actions": "Medical Actions",
"Interpretations": "Interpretations",
"Experiments": "Experiments",
"Date of initial verbal consent (participant, legal representative or tutor), yyyy-mm-dd": "Date of initial verbal consent (participant, legal representative or tutor), yyyy-mm-dd",
"Covid severity": "Covid severity",
"Dead": "Dead",
"Moderate": "Moderate",
"Uninfected": "Uninfected",
"Severe": "Severe",
"Mild": "Mild",
"Mobility": "Mobility",
"I have slight problems in walking about": "I have slight problems in walking about",
"I have moderate problems in walking about": "I have moderate problems in walking about",
"I have severe problems in walking about": "I have severe problems in walking about",
"I am unable to walk about": "I am unable to walk about",
"Smoking Status": "Smoking Status",
"Non-smoker": "Non-smoker",
"Smoker": "Smoker",
"Former smoker": "Former smoker",
"Passive smoker": "Passive smoker",
"Not specified": "Not specified",
"Phenotypic Features": "Phenotypic Features",
"Individual phenotypic features, observed as either present or absent": "Individual phenotypic features, observed as either present or absent",
"Abdominal pain": "Abdominal pain",
"Asthma": "Asthma",
"Cardiac arrest": "Cardiac arrest",
"Chest pain": "Chest pain",
"Cough": "Cough",
"Dementia": "Dementia",
"Fever": "Fever",
"Headache": "Headache",
"HIV Infection": "HIV Infection",
"Hyperglycemia": "Hyperglycemia",
"Hypertension": "Hypertension",
"Loss of appetite": "Loss of appetite",
"Loss of sense of smell": "Loss of sense of smell",
"Nausea": "Nausea",
"Patient immunosuppressed": "Patient immunosuppressed",
"Pneumothorax": "Pneumothorax",
"Pulmonary hypertension": "Pulmonary hypertension",
"Viral pneumonia/pneumonitis": "Viral pneumonia/pneumonitis",
"blood": "blood",
"Plasma": "Plasma",
"Serum": "Serum",
"autoimmune disorder of cardiovascular system": "autoimmune disorder of cardiovascular system",
"coronary artery disease, autosomal dominant, 1": "coronary artery disease, autosomal dominant, 1",
"COVID-19": "COVID-19",
"Cystic fibrosis": "Cystic fibrosis",
"diabetes mellitus": "diabetes mellitus",
"Glioblastoma": "Glioblastoma",
"Hashimoto Thyroiditis": "Hashimoto Thyroiditis",
"Marfan syndrome": "Marfan syndrome",
"Miller syndrome": "Miller syndrome",
"Non-Hodgkin Lymphoma": "Non-Hodgkin Lymphoma",
"Polycythemia vera": "Polycythemia vera",
"Rheumatologic disease": "Rheumatologic disease",
"Takotsubo cardiomyopathy": "Takotsubo cardiomyopathy",
"viral pneumonia": "viral pneumonia",
"Sampled Tissues": "Sampled Tissues",
"Tissue from which the biosample was extracted": "Tissue from which the biosample was extracted",
"Diseases": "Diseases",
"Diseases observed as either present or absent": "Diseases observed as either present or absent",
"Numeric measures from a laboratory test": "Numeric measures from a laboratory test",
"BMI": "BMI",
"Body Mass Index": "Body Mass Index",
"Medical Procedures": "Medical Procedures",
"A clinical procedure performed on a subject": "A clinical procedure performed on a subject",
"Liver Biopsy": "Liver Biopsy",
"Magnetic Resonance Imaging": "Magnetic Resonance Imaging",
"Positron Emission Tomography": "Positron Emission Tomography",
"Punch Biopsy": "Punch Biopsy",
"X-Ray Imaging": "X-Ray Imaging",
"Medical Treatments": "Medical Treatments",
"Treatment with an agent such as a drug": "Treatment with an agent such as a drug",
"Ibuprofen": "Ibuprofen",
"Acetaminophen": "Acetaminophen",
"Genomic Interpretations": "Genomic Interpretations",
"Interpretation for an individual variant or gene (CANDIDATE, CONTRIBUTORY, etc)": "Interpretation for an individual variant or gene (CANDIDATE, CONTRIBUTORY, etc)",
"CONTRIBUTORY": "CONTRIBUTORY",
"Variant Pathogenicity": "Variant Pathogenicity",
"ACMG Pathogenicity category for a particular variant (BENIGN, PATHOGENIC, etc)": "ACMG Pathogenicity category for a particular variant (BENIGN, PATHOGENIC, etc)",
"PATHOGENIC": "PATHOGENIC",
"Metabolite profiling": "Metabolite profiling",
"Neutralizing antibody titers": "Neutralizing antibody titers",
"Other": "Other",
"Proteomic profiling": "Proteomic profiling",
"RNA-Seq": "RNA-Seq",
"WGS": "WGS",
"Study Types": "Study Types",
"Study type of the experiment (e.g. Genomics, Transcriptomics, etc.)": "Study type of the experiment (e.g. Genomics, Transcriptomics, etc.)",
"Genomics": "Genomics",
"Metabolomics": "Metabolomics",
"Proteomics": "Proteomics",
"Serology": "Serology",
"Transcriptomics": "Transcriptomics",
"Results File Types": "Results File Types",
"File type of experiment results files": "File type of experiment results files"
}
2 changes: 1 addition & 1 deletion src/public/locales/fr/default_translation_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Portal": "Portail",
"missing": "manquant(s)",
"Individuals": "Participants",
"in": "dans",
"in": "en",
"Get Data": "Obtenir",
"Biosamples": "Échantillons biologiques",
"Experiments": "Expériences",
Expand Down
106 changes: 103 additions & 3 deletions src/public/locales/fr/translation_fr.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,116 @@
{
"years": "années",
"MALE": "HOMME",
"FEMALE": "FEMME",
"Age": "Âge",
"Age at arrival": "Âge à l'arrivée",
"Sex": "Sexe",
"Sex at birth": "Sexe à la naissance",
"Demographics": "Démographie",
"Verbal consent date": "Date de consentement verbal",
"Verbal consent date": "Date du consentement verbal",
"Functional status": "Statut fonctionnel",
"Lab Test Result": "Résultats des tests de laboratoire",
"Experiment Types": "Types d'expériences",
"Types of experiments performed on a sample": "Types d'expériences réalisées sur un échantillon",
"I have no problems in walking about": "Je n’ai aucun problème à marcher",
"Results": "Résultats"
"I have no problems in walking about": "Je n'ai aucun problème à marcher",
"Results": "Résultats",
"General": "Général",
"Measurements": "Mesures",
"Medical Actions": "Actions médicales",
"Interpretations": "Interprétations",
"Experiments": "Expériences",
"Date of initial verbal consent (participant, legal representative or tutor), yyyy-mm-dd": "Date du consentement verbal initial (participant, représentant légal ou tuteur), aaaa-mm-jj",
"Covid severity": "Gravité de la Covid",
"Dead": "Décédé",
"Moderate": "Modéré",
"Uninfected": "Non infecté",
"Severe": "Sévère",
"Mild": "Léger",
"Mobility": "Mobilité",
"I have slight problems in walking about": "J'ai de légers problèmes à marcher",
"I have moderate problems in walking about": "J'ai des problèmes modérés à marcher",
"I have severe problems in walking about": "J'ai de graves problèmes à marcher",
"I am unable to walk about": "Je ne peux pas marcher",
"Smoking Status": "Statut tabagique",
"Non-smoker": "Non-fumeur",
"Smoker": "Fumeur",
"Former smoker": "Ex-fumeur",
"Passive smoker": "Tabagisme passif",
"Not specified": "Non spécifié",
"Phenotypic Features": "Caractéristiques phénotypiques",
"Individual phenotypic features, observed as either present or absent": "Caractéristiques phénotypiques individuelles, observées comme présentes ou absentes",
"Abdominal pain": "Douleur abdominale",
"Asthma": "Asthme",
"Cardiac arrest": "Arrêt cardiaque",
"Chest pain": "Douleur thoracique",
"Cough": "Toux",
"Dementia": "Démence",
"Fever": "Fièvre",
"Headache": "Mal de tête",
"HIV Infection": "Infection VIH",
"Hyperglycemia": "Hyperglycémie",
"Hypertension": "Hypertension",
"Loss of appetite": "Perte d'appétit",
"Loss of sense of smell": "Perte de l'odorat",
"Nausea": "Nausée",
"Patient immunosuppressed": "Patient immunodéprimé",
"Pneumothorax": "Pneumothorax",
"Pulmonary hypertension": "Hypertension pulmonaire",
"Viral pneumonia/pneumonitis": "Pneumonie/pneumonite virale",
"blood": "sang",
"Plasma": "Plasma",
"Serum": "Sérum",
"autoimmune disorder of cardiovascular system": "trouble auto-immun du système cardiovasculaire",
"coronary artery disease, autosomal dominant, 1": "maladie coronarienne, autosomique dominante, 1",
"COVID-19": "COVID-19",
"Cystic fibrosis": "Fibrose kystique",
"diabetes mellitus": "diabète sucré",
"Glioblastoma": "Glioblastome",
"Hashimoto Thyroiditis": "Thyroïdite de Hashimoto",
"Marfan syndrome": "Syndrome de Marfan",
"Miller syndrome": "Syndrome de Miller",
"Non-Hodgkin Lymphoma": "Lymphome non hodgkinien",
"Polycythemia vera": "Polycythémie vraie",
"Rheumatologic disease": "Problèmes rhumatologiques",
"Takotsubo cardiomyopathy": "Cardiomyopathie de Takotsubo",
"viral pneumonia": "pneumonie virale",
"Sampled Tissues": "Tissus échantillonnés",
"Tissue from which the biosample was extracted": "Tissu à partir duquel le biosample a été extrait",
"Diseases": "Maladies",
"Diseases observed as either present or absent": "Maladies observées comme présentes ou absentes",
"Numeric measures from a laboratory test": "Mesures numériques d'un test de laboratoire",
"BMI": "BMI",
"Body Mass Index": "Indice de masse corporelle",
"Medical Procedures": "Procédures médicales",
"A clinical procedure performed on a subject": "Une procédure clinique réalisée sur un sujet",
"Liver Biopsy": "Biopsie du foie",
"Magnetic Resonance Imaging": "Imagerie par résonance magnétique",
"Positron Emission Tomography": "Tomographie par émission de positrons",
"Punch Biopsy": "Biopsie au punch",
"X-Ray Imaging": "Imagerie par rayons X",
"Medical Treatments": "Traitements médicaux",
"Treatment with an agent such as a drug": "Traitement avec un agent tel qu'un médicament",
"Ibuprofen": "Ibuprofène",
"Acetaminophen": "Acétaminophène",
"Genomic Interpretations": "Interprétations génomiques",
"Interpretation for an individual variant or gene (CANDIDATE, CONTRIBUTORY, etc)": "Interprétation pour un variant individuel ou un gène (CANDIDAT, CONTRIBUTEUR, etc)",
"CONTRIBUTORY": "CONTRIBUTEUR",
"Variant Pathogenicity": "Pathogénicité du variant",
"ACMG Pathogenicity category for a particular variant (BENIGN, PATHOGENIC, etc)": "Catégorie de pathogénicité ACMG pour un variant particulier (BÉNIN, PATHOGÈNE, etc)",
"PATHOGENIC": "PATHOGÈNE",
"Metabolite profiling": "Profilage des métabolites",
"Neutralizing antibody titers": "Titres des anticorps neutralisants",
"Other": "Autre",
"Proteomic profiling": "Profilage protéomique",
"RNA-Seq": "Séquençage ARN",
"WGS": "Séquençage génomique complet",
"Study Types": "Types d'étude",
"Study type of the experiment (e.g. Genomics, Transcriptomics, etc.)": "Type d'étude de l'expérience (par exemple, Génomique, Transcriptomique, etc.)",
"Genomics": "Génomique",
"Metabolomics": "Métabolomique",
"Proteomics": "Protéomique",
"Serology": "Sérologie",
"Transcriptomics": "Transcriptomique",
"Results File Types": "Types de fichiers de résultats",
"File type of experiment results files": "Type de fichier des résultats d'expériences"
}

0 comments on commit fb80193

Please sign in to comment.