Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(i18n): enhanced i18n support #3730

Merged
merged 11 commits into from
Oct 31, 2023
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 @@ -244,11 +244,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 {
row: [
Expand Down Expand Up @@ -316,10 +316,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 @@ -404,7 +404,7 @@ function WorkList({
onClick: () =>
show({
content: AboutModal,
title: 'About OHIF Viewer',
title: t('AboutModal:About OHIF Viewer'),
contentProps: { versionNumber, commitHash },
}),
},
Expand All @@ -413,7 +413,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:StudyDescription'),
jbocce marked this conversation as resolved.
Show resolved Hide resolved
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
6 changes: 3 additions & 3 deletions platform/i18n/src/locales/de/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"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"
}
6 changes: 3 additions & 3 deletions platform/i18n/src/locales/en-US/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"Browser": "Browser",
"Build Number": "Build Number",
"Latest Master Commits": "Latest Master Commits",
"Build number": "Build Number",
"Last master commits": "Latest Master Commits",
"More details": "More details",
"Name": "Name",
"OHIF Viewer - About": "OHIF Viewer - About",
jbocce marked this conversation as resolved.
Show resolved Hide resolved
"OS": "OS",
"Report an issue": "Report an issue",
"Repository URL": "Repository URL",
"Value": "Value",
"Version Information": "Version Information",
"Version information": "Version Information",
"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
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/en-US/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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"
Expand Down
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"
}
6 changes: 3 additions & 3 deletions platform/i18n/src/locales/es/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"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",
jbocce marked this conversation as resolved.
Show resolved Hide resolved
"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
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/es/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +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"
Expand Down
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": "ユーザプレファレンス"
}
6 changes: 3 additions & 3 deletions platform/i18n/src/locales/pt-BR/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"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",
jbocce marked this conversation as resolved.
Show resolved Hide resolved
"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"
}
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/test-LNG/AboutModal.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"Browser": "Browser",
"Build Number": "Build Number",
"Latest Master Commits": "Latest Master Commits",
"Last master commits": "Latest Master Commits",
"More details": "More details",
"Name": "Name",
"OHIF Viewer - About": "OHIF Viewer - About",
jbocce marked this conversation as resolved.
Show resolved Hide resolved
"OS": "OS",
"Report an issue": "Report an issue",
"Repository URL": "Repository URL",
"Value": "Value",
"Version Information": "Version Information",
"Version information": "Version Information",
"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
2 changes: 1 addition & 1 deletion platform/i18n/src/locales/test-LNG/StudyList.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Description": "Test Description",
"StudyDate": "Test Study Date",
"Study date": "Test Study Date",
"Studies": "Test Studies",
"Number of studies": "Test Studies",
"Series": "Test Series",
"Instances": "Test Instances",
"Study List": "Test Study List",
Expand Down
4 changes: 2 additions & 2 deletions platform/i18n/src/locales/test-LNG/UserPreferencesModal.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"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": "Test Preferences saved",
"User Preferences": "Test User Preferences",
"User preferences": "Test User Preferences",
"Function": "Test function",
"Shortcut": "Test shortcut",
"Language": "Test language",
Expand Down
Loading