Skip to content

Commit

Permalink
feat(i18n): enhanced i18n support (OHIF#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelpisarev authored and thanh-nguyen-dang committed Apr 30, 2024
1 parent bdd2c26 commit 50048a5
Show file tree
Hide file tree
Showing 46 changed files with 146 additions and 134 deletions.
4 changes: 2 additions & 2 deletions extensions/default/src/ViewerLayout/ViewerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ViewerHeader({ hotkeysManager, extensionManager, servicesManager }) {
onClick: () =>
show({
content: AboutModal,
title: 'About OHIF Viewer',
title: t('AboutModal:About OHIF Viewer'),
contentProps: { versionNumber, commitHash },
}),
},
Expand All @@ -62,7 +62,7 @@ function ViewerHeader({ hotkeysManager, extensionManager, servicesManager }) {
icon: 'settings',
onClick: () =>
show({
title: t('UserPreferencesModal:User Preferences'),
title: t('UserPreferencesModal:User preferences'),
content: UserPreferences,
contentProps: {
hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
Expand Down
16 changes: 8 additions & 8 deletions platform/app/src/routes/WorkList/WorkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ function WorkList({
const studyDate =
date &&
moment(date, ['YYYYMMDD', 'YYYY.MM.DD'], true).isValid() &&
moment(date, ['YYYYMMDD', 'YYYY.MM.DD']).format('MMM-DD-YYYY');
moment(date, ['YYYYMMDD', 'YYYY.MM.DD']).format(t('Common:localDateFormat','MMM-DD-YYYY'));
const studyTime =
time &&
moment(time, ['HH', 'HHmm', 'HHmmss', 'HHmmss.SSS']).isValid() &&
moment(time, ['HH', 'HHmm', 'HHmmss', 'HHmmss.SSS']).format('hh:mm A');
moment(time, ['HH', 'HHmm', 'HHmmss', 'HHmmss.SSS']).format(t('Common:localTimeFormat', 'hh:mm A'));

return {
dataCY: `studyRow-${studyInstanceUid}`,
Expand Down Expand Up @@ -327,10 +327,10 @@ function WorkList({
expandedContent: (
<StudyListExpandedRow
seriesTableColumns={{
description: 'Description',
seriesNumber: 'Series',
modality: 'Modality',
instances: 'Instances',
description: t('StudyList:Description'),
seriesNumber: t('StudyList:Series'),
modality: t('StudyList:Modality'),
instances: t('StudyList:Instances'),
}}
seriesTableDataSource={
seriesInStudiesMap.has(studyInstanceUid)
Expand Down Expand Up @@ -416,7 +416,7 @@ function WorkList({
onClick: () =>
show({
content: AboutModal,
title: 'About OHIF Viewer',
title: t('AboutModal:About OHIF Viewer'),
contentProps: { versionNumber, commitHash },
}),
},
Expand All @@ -425,7 +425,7 @@ function WorkList({
icon: 'settings',
onClick: () =>
show({
title: t('UserPreferencesModal:User Preferences'),
title: t('UserPreferencesModal:User preferences'),
content: UserPreferences,
contentProps: {
hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
Expand Down
16 changes: 9 additions & 7 deletions platform/app/src/routes/WorkList/filtersMeta.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
import i18n from 'i18next';

const filtersMeta = [
{
name: 'patientName',
displayName: 'PatientName',
displayName: i18n.t('StudyList:PatientName'),
inputType: 'Text',
isSortable: true,
gridCol: 4,
},
{
name: 'mrn',
displayName: 'MRN',
displayName: i18n.t('StudyList:MRN'),
inputType: 'Text',
isSortable: true,
gridCol: 3,
},
{
name: 'studyDate',
displayName: 'StudyDate',
displayName: i18n.t('StudyList:StudyDate'),
inputType: 'DateRange',
isSortable: true,
gridCol: 5,
},
{
name: 'description',
displayName: 'StudyDescription',
displayName: i18n.t('StudyList:Description'),
inputType: 'Text',
isSortable: true,
gridCol: 4,
},
{
name: 'modalities',
displayName: 'Modality',
displayName: i18n.t('StudyList:Modality'),
inputType: 'MultiSelect',
inputProps: {
options: [
Expand Down Expand Up @@ -110,14 +112,14 @@ const filtersMeta = [
},
{
name: 'accession',
displayName: 'AccessionNumber',
displayName: i18n.t('StudyList:AccessionNumber'),
inputType: 'Text',
isSortable: true,
gridCol: 3,
},
{
name: 'instances',
displayName: 'Instances',
displayName: i18n.t('StudyList:Instances'),
inputType: 'None',
isSortable: false,
gridCol: 2,
Expand Down
8 changes: 4 additions & 4 deletions platform/i18n/src/locales/de/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"About OHIF Viewer": "Über OHIF Viewer",
"Browser": "Browser",
"Build Number": "Build-Nummer",
"Latest Master Commits": "Letzter Master Commit",
"Build number": "Build-Nummer",
"Last master commits": "Letzter Master Commit",
"More details": "Mehr Details",
"Name": "Name",
"About OHIF Viewer": "Über OHIF Viewer",
"OS": "OS",
"Report an issue": "Ein Problem melden",
"Repository URL": "Repository URL",
"Value": "Wert",
"Version Information": "Informationen zur Version",
"Version information": "Informationen zur Version",
"Visit the forum": "Besuchen Sie das Forum"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/de/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"Rectangle": "Rechteck",
"Reset": "$t(Common:Reset)",
"Reset View": "$t(Common:Reset)",
"Reset to Defaults": "Auf Default zurücksetzen",
"Reset to defaults": "Auf Default zurücksetzen",
"Rotate Right": "Nach rechts drehen",
"Rotate +90": "Drehen +90",
"Sagittal": "Sagittal",
Expand Down
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/de/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"Description": "Beschreibung",
"Study list": "Studienliste",
"Instances": "Instanzen",
"Studies": "Studien"
"Number of studies": "Studien"
}
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/de/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"Cancel": "$t(Buttons:Cancel)",
"No hotkeys found": "Keine Hotkeys gefunden.",
"Reset to Defaults": "$t(Buttons:Reset to Defaults)",
"Reset to defaults": "$t(Buttons:Reset to defaults)",
"ResetDefaultMessage": "Einstellungen zurückgesetzt. Bitte speichern.",
"Save": "$t(Buttons:Save)",
"SaveMessage": "Gespeichert",
"User Preferences": "Benutzereinstellungen",
"User preferences": "Benutzereinstellungen",
"Language": "Sprache",
"General": "Allgemein"
}
12 changes: 8 additions & 4 deletions platform/i18n/src/locales/en-US/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"About OHIF Viewer": "About OHIF Viewer",
"Browser": "Browser",
"Build Number": "Build Number",
"Latest Master Commits": "Latest Master Commits",
"Build number": "Build Number",
"Commit hash": "Commit hash",
"Data citation": "Data citation",
"Important links": "Important links",
"Last master commits": "Latest Master Commits",
"More details": "More details",
"Name": "Name",
"OHIF Viewer - About": "OHIF Viewer - About",
"OS": "OS",
"Report an issue": "Report an issue",
"Repository URL": "Repository URL",
"Value": "Value",
"Version Information": "Version Information",
"Version information": "Version Information",
"Version number": "Version number",
"Visit the forum": "Visit the forum"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/en-US/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"Rectangle": "Rectangle",
"Reference Lines": "Reference Lines",
"Reset": "$t(Common:Reset)",
"Reset to Defaults": "$t(Common:Reset) to Defaults",
"Reset to defaults": "$t(Common:Reset) to Defaults",
"Rotate Right": "Rotate Right",
"Sagittal": "Sagittal",
"Save": "Save",
Expand Down
6 changes: 5 additions & 1 deletion platform/i18n/src/locales/en-US/DatePicker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"Clear dates": "Clear dates",
"Close": "$t(Common:Close)",
"End Date": "End Date",
"Start Date": "Start Date"
"Last 7 days": "Last 7 days",
"Last 30 days": "Last 30 days",
"Start Date": "Start Date",
"Today": "Today"
}
5 changes: 2 additions & 3 deletions platform/i18n/src/locales/en-US/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"Previous": "< Back",
"Page": "Page",
"Next": "Next >",
"ResultsPerPage": "Results per page",
"Studies": "Studies",
"Results per page": "Results per page",
"Number of studies": "Studies",
"StudyDate": "Study Date",
"StudyDescription": "Description",
"StudyList": "Study List"
}
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/en-US/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"Cancel": "$t(Buttons:Cancel)",
"No hotkeys found": "No hotkeys are configured for this application. Hotkeys can be configured in the application's app-config.js file.",
"Reset to Defaults": "$t(Buttons:Reset to Defaults)",
"Reset to defaults": "$t(Buttons:Reset to defaults)",
"ResetDefaultMessage": "Preferences successfully reset to default. <br /> You must <strong>Save</strong> to perform this action.",
"Save": "$t(Buttons:Save)",
"SaveMessage": "Preferences saved",
"User Preferences": "User Preferences"
"User preferences": "User Preferences"
}
8 changes: 4 additions & 4 deletions platform/i18n/src/locales/es/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"About OHIF Viewer": "Sobre OHIF Viewer",
"Browser": "Navegador",
"Build Number": "Número de compilación",
"Latest Master Commits": "Últimos Master Commits",
"Build number": "Número de compilación",
"Last master commits": "Últimos Master Commits",
"More details": "Más detalles",
"Name": "Nombre",
"OHIF Viewer - About": "Sobre OHIF Viewer",
"OS": "SO",
"Report an issue": "Informar un problema",
"Repository URL": "URL del repositorio",
"Value": "Valor",
"Version Information": "Información de la versión",
"Version information": "Información de la versión",
"Visit the forum": "Visita el foro"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/es/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"ROI Window": "Ventana ROI",
"Rectangle": "Rectángulo",
"Reset": "$t(Common:Reset)",
"Reset to Defaults": "$t(Common:Reset) por defecto",
"Reset to defaults": "$t(Common:Reset) por defecto",
"Rotate Right": "Girar ->",
"Sagittal": "Sagital",
"Save": "Guardar",
Expand Down
5 changes: 2 additions & 3 deletions platform/i18n/src/locales/es/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"Previous": "< Anterior",
"Page": "Página",
"Next": "Siguiente >",
"ResultsPerPage": "Resultados por página",
"Studies": "Estudios",
"Results per page": "Resultados por página",
"Number of studies": "Estudios",
"StudyDate": "Fecha del estudio",
"StudyDescription": "Descripción",
"StudyList": "Lista de Estudios"
}
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/es/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Cancel": "$t(Buttons:Cancel)",
"Reset to Defaults": "$t(Buttons:Reset to Defaults)",
"Reset to defaults": "$t(Buttons:Reset to defaults)",
"Save": "$t(Buttons:Save)",
"User Preferences": "Preferencias de Usuario"
"User preferences": "Preferencias de Usuario"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/fr/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"ROI Window": "ROI fenêtrage",
"Rectangle": "Rectangle",
"Reset": "$t(Common:Reset)",
"Reset to Defaults": "Valeurs d'usine",
"Reset to defaults": "Valeurs d'usine",
"Rotate Right": "Tourner à droite",
"Sagittal": "Sagittal",
"Save": "Sauvegarder",
Expand Down
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/fr/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Cancel": "$t(Buttons:Cancel)",
"Reset to Defaults": "$t(Buttons:Reset to Defaults)",
"Reset to defaults": "$t(Buttons:Reset to defaults)",
"Save": "$t(Buttons:Save)",
"User Preferences": "Préférences utilisateur"
"User preferences": "Préférences utilisateur"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/ja-JP/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"ROI Window": "ROIウィンドウ",
"Rectangle": "長方形",
"Reset": "$t(Common:Reset)",
"Reset to Defaults": "デフォルトへ$t(Common:Reset)",
"Reset to defaults": "デフォルトへ$t(Common:Reset)",
"Rotate Right": "右に回転",
"Sagittal": "サジタル",
"Save": "保存",
Expand Down
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/ja-JP/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Cancel": "$t(Buttons:Cancel)",
"Reset to Defaults": "$t(Buttons:Reset to Defaults)",
"Reset to defaults": "$t(Buttons:Reset to defaults)",
"Save": "$t(Buttons:Save)",
"User Preferences": "ユーザプレファレンス"
"User preferences": "ユーザプレファレンス"
}
8 changes: 4 additions & 4 deletions platform/i18n/src/locales/pt-BR/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"About OHIF Viewer": "OHIF Viewer - Sobre",
"Browser": "Navegador",
"Build Number": "Número da compilação",
"Latest Master Commits": "Últimos Commits na Master",
"Build number": "Número da compilação",
"Last master commits": "Últimos Commits na Master",
"More details": "Mais detalhes",
"Name": "Nome",
"OHIF Viewer - About": "OHIF Viewer - Sobre",
"OS": "SO",
"Report an issue": "Informar um problema",
"Repository URL": "URL do Repositório",
"Value": "Valor",
"Version Information": "Informação da Versão",
"Version information": "Informação da Versão",
"Visit the forum": "Visite o fórum"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/pt-BR/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"ROI Window": "Janela ROI",
"Rectangle": "Retângulo",
"Reset": "$t(Common:Reset)",
"Reset to Defaults": "$t(Common:Reset) para o Padrão",
"Reset to defaults": "$t(Common:Reset) para o Padrão",
"Rotate Right": "Girar à direita",
"Sagittal": "Sagital",
"Save": "Salvar",
Expand Down
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/pt-BR/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Cancel": "Cancelar",
"Reset to Defaults": "$t(Common:Reset) para Padrão",
"Reset to defaults": "$t(Common:Reset) para Padrão",
"ResetDefaultMessage": "Preferências resetadas com sucesso. <br /> Você deve <strong>Salvar</strong> para que essa ação seja realizada.",
"Save": "Salvar",
"SaveMessage": "Preferências salvas",
"User Preferences": "Preferências do Usuário"
"User preferences": "Preferências do Usuário"
}
10 changes: 7 additions & 3 deletions platform/i18n/src/locales/test-LNG/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"About OHIF Viewer": "About OHIF Viewer",
"Browser": "Browser",
"Build Number": "Build Number",
"Latest Master Commits": "Latest Master Commits",
"Commit hash": "Commit hash",
"Data citation": "Data citation",
"Important links": "Important links",
"Last master commits": "Latest Master Commits",
"More details": "More details",
"Name": "Name",
"OHIF Viewer - About": "OHIF Viewer - About",
"OS": "OS",
"Report an issue": "Report an issue",
"Repository URL": "Repository URL",
"Value": "Value",
"Version Information": "Version Information",
"Version information": "Version Information",
"Version number": "Version number",
"Visit the forum": "Visit the forum"
}
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/test-LNG/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"ROI Window": "Test ROI Window",
"Rectangle": "Test Rectangle",
"Reset": "Test $t(Common:Reset)",
"Reset to Defaults": "Test $t(Common:Reset) to Defaults",
"Reset to defaults": "Test $t(Common:Reset) to Defaults",
"Rotate Right": "Test Rotate Right",
"Sagittal": "Test Sagittal",
"Save": "Test Save",
Expand Down
Loading

0 comments on commit 50048a5

Please sign in to comment.