Skip to content

Commit

Permalink
Merge pull request #123 from bento-platform/chore/translations
Browse files Browse the repository at this point in the history
chore: add missing translations & bump version to 0.16.2
  • Loading branch information
davidlougheed authored Nov 1, 2023
2 parents bcb3961 + 509e4c9 commit bb59214
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bento_public",
"version": "0.16.1",
"version": "0.16.2",
"description": "A publicly accessible portal for clinical datasets, where users are able to see high-level statistics of the data available through predefined variables of interest and search the data using limited variables at a time. This portal allows users to gain a generic understanding of the data available (secure and firewalled) without the need to access it directly. Initially, this portal facilitates the search in English language only, but the French language will be added at a later time.",
"main": "index.js",
"scripts": {
Expand Down
12 changes: 7 additions & 5 deletions src/js/components/Overview/Drawer/ChartTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InputNumber, Tree, TreeProps } from 'antd';
import { useTranslation } from 'react-i18next';

import { rearrange, setDisplayedCharts, setChartWidth } from '@/features/data/data.store';
import { NON_DEFAULT_TRANSLATION } from '@/constants/configConstants';
import { DEFAULT_TRANSLATION, NON_DEFAULT_TRANSLATION } from '@/constants/configConstants';
import { ChartDataField } from '@/types/data';

interface MappedChartItem {
Expand All @@ -14,16 +14,18 @@ interface MappedChartItem {

const ChartTree = ({ charts, section }: ChartTreeProps) => {
const dispatch = useDispatch();
const { t } = useTranslation(NON_DEFAULT_TRANSLATION);

const { t } = useTranslation(DEFAULT_TRANSLATION);
const { t: td } = useTranslation(NON_DEFAULT_TRANSLATION);

const allCharts: MappedChartItem[] = useMemo(
() =>
charts.map(({ field: { title }, id, width }) => ({
title: (
<div style={{ display: 'flex' }}>
<span style={{ flex: 1 }}>{t(title)}</span>
<span style={{ flex: 1 }}>{td(title)}</span>
<span>
Width:{' '}
{t('Width')}:{' '}
<InputNumber
size="small"
min={1}
Expand All @@ -42,7 +44,7 @@ const ChartTree = ({ charts, section }: ChartTreeProps) => {
),
key: id,
})),
[charts]
[charts, t, td]
);

const onChartDrop: TreeProps['onDrop'] = useMemo(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Provenance/DownloadDats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { Button, Space } from 'antd';
import { DownloadOutlined } from '@ant-design/icons';
import { useTranslation } from 'react-i18next';
import { useTranslationDefault } from '@/hooks';
import { ProvenanceStoreDataset } from '@/types/provenance';

const DownloadDats = ({ metadata }: { metadata: ProvenanceStoreDataset }) => {
const { t } = useTranslation();
const t = useTranslationDefault();

const exportData = useCallback(() => {
window.location.href = `/datasets/${metadata.identifier}/dats`;
Expand Down
2 changes: 2 additions & 0 deletions src/public/locales/en/default_translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
"Date": "Date",
"Dates": "Dates",
"Description": "Description",
"Download DATS File": "Download DATS File",
"Manage Charts": "Manage Charts",
"Remove this chart": "Remove this chart",
"Width": "Width",
"Insufficient data available.": "Insufficient data available.",
"Terms of Use": "Terms of Use",
"No Data": "No Data",
Expand Down
5 changes: 2 additions & 3 deletions src/public/locales/en/translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"MALE": "MALE",
"FEMALE": "FEMALE",
"I have no problems in walking about": "I have no problems in walking about",
"Results": "Results",
"Download DATS File": "Download DATS File"
}
"Results": "Results"
}
2 changes: 2 additions & 0 deletions src/public/locales/fr/default_translation_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
"Date": "Date",
"Dates": "Dates",
"Description": "Description",
"Download DATS File": "Télécharcher le fichier DATS",
"Manage Charts": "Gestion des tableaux",
"Remove this chart": "Supprimer ce tableau",
"Width": "Largeur",
"Insufficient data available.": "Pas suffisamment de données.",
"Terms of Use": "Conditions d'utilisation (en anglais)",
"No Data": "Pas de données",
Expand Down
3 changes: 1 addition & 2 deletions src/public/locales/fr/translation_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
"Lab Test Result": "Résultats des tests de laboratoire",
"Experiment Types": "Types d'expériences",
"I have no problems in walking about": "Je n’ai aucun problème à marcher",
"Results": "Résultats",
"Download DATS File": "Télécharger le fichier DATS"
"Results": "Résultats"
}

0 comments on commit bb59214

Please sign in to comment.