feat: Added support for i18n (#2439)

* Added translation for various react components in OHIF-v3

* Added a test language for debugging- test-LNG 

* Added copy for test language to not get overwritten
This commit is contained in:
Alireza authored and GitHub committed 2021-06-15 10:56:33 -04:00
1 parent fdb6ca41d6
commit 1bf651e763
42 files changed
+365 -63

No files matched your search

+2
View File
@@ -1,6 +1,8 @@
cp -r src/locales/test-LNG src/temp
rm -rf src/locales/
mkdir -p src/locales/
cd src/locales/
npx locize --config-path ../../.locize download --ver latest
cd ../../
node ./writeLocaleIndexFiles.js
cp -r src/temp src/locales/test-LNG
@@ -5,5 +5,7 @@
"MAX": "Máximo",
"NonTargets": "No objetivos",
"Relabel": "Re-etiquetar",
"Targets": "Objetivos"
}
"Targets": "Objetivos",
"Export": "Exportar",
"Create Report": "Crear reporte"
}
+2
View File
@@ -7,6 +7,7 @@ import nl from './nl/';
import pt_BR from './pt-BR/';
import vi from './vi/';
import zh from './zh/';
import test_lng from './test-LNG/';
export default {
...ar,
@@ -18,4 +19,5 @@ export default {
...pt_BR,
...vi,
...zh,
...test_lng
};
@@ -0,0 +1,4 @@
{
"Export": "Exportar",
"Create Report": "Criar relatório"
}
+2
View File
@@ -5,6 +5,7 @@ import Common from './Common.json';
import DatePicker from './DatePicker.json';
import Header from './Header.json';
import UserPreferencesModal from './UserPreferencesModal.json';
import MeasurementTable from './MeasurementTable.json';
export default {
'pt-BR': {
@@ -15,5 +16,6 @@ export default {
DatePicker,
Header,
UserPreferencesModal,
MeasurementTable,
},
};
@@ -0,0 +1,14 @@
{
"Browser": "Browser",
"Build Number": "Build Number",
"Latest 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",
"Visit the forum": "Visit the forum"
}
@@ -0,0 +1,54 @@
{
"Acquired": "Test Acquired",
"Angle": "Test Angle",
"Axial": "Test Axial",
"Bidirectional": "Test Bidirectional",
"Brush": "Test Brush",
"CINE": "Test CINE",
"Cancel": "Test Cancel",
"Circle": "Test Circle",
"Clear": "Test Clear",
"Coronal": "Test Coronal",
"Crosshairs": "Test Crosshairs",
"Download": "Test Download",
"Ellipse": "Test Ellipse",
"Elliptical": "Test Elliptical",
"Flip H": "Test Flip H",
"Flip V": "Test Flip V",
"Freehand": "Test Freehand",
"Invert": "Test Invert",
"Layout": "Test $t(Common:Layout)",
"Length": "Test Length",
"Levels": "Test Levels",
"Magnify": "Test Magnify",
"Manual": "Test Manual",
"Measurements": "Test Measurements",
"More": "Test $t(Common:More)",
"Next": "Test $t(Common:Next)",
"Pan": "Test Pan",
"Play": "Test $t(Common:Play)",
"Previous": "Test $t(Common:Previous)",
"Probe": "Test Probe",
"ROI Window": "Test ROI Window",
"Rectangle": "Test Rectangle",
"Reset": "Test $t(Common:Reset)",
"Reset to Defaults": "Test $t(Common:Reset) to Defaults",
"Rotate Right": "Test Rotate Right",
"Sagittal": "Test Sagittal",
"Save": "Test Save",
"Stack Scroll": "Test Stack Scroll",
"Stop": "Test $t(Common:Stop)",
"Themes": "Test Themes",
"Zoom": "Test Zoom",
"Grid Layout": "Test Grid Layout",
"W/L Presets": "Test W/L Presets",
"More Measure Tools": "Test More Measure Tools",
"More Tools": "Test More Tools",
"Capture": "Test Capture",
"Annotation": "Test Annotation",
"Soft Tissue": "Test Soft Tissue",
"Lung": "Test Lung",
"Liver": "Test Liver",
"Bone": "Test Bone",
"Cine": "Test Cine"
}
@@ -0,0 +1,8 @@
{
"Next image": "$t(Common:Next) $t(Common:Image)",
"Play / Stop": "$t(Common:Play) / $t(Common:Stop)",
"Previous image": "$t(Common:Previous) $t(Common:Image)",
"Skip to first image": "Skip to first $t(Common:Image)",
"Skip to last image": "Skip to last $t(Common:Image)",
"fps": "fps"
}
@@ -0,0 +1,16 @@
{
"Close": "Test Close",
"Image": "Test Image",
"Layout": "Test Layout",
"Measurements": "Test Measurements",
"More": "Test More",
"Next": "Test Next",
"Play": "Test Play",
"Previous": "Test Previous",
"Reset": "Test Reset",
"RowsPerPage": "Test rows per page",
"Series": "Test Series",
"Show": "Test Show",
"Stop": "Test Stop",
"StudyDate": "Test Study Date"
}
@@ -0,0 +1,5 @@
{
"Clear dates": "Clear dates",
"End Date": "End Date",
"Start Date": "Start Date"
}
@@ -0,0 +1,6 @@
{
"About": "Test About",
"INVESTIGATIONAL USE ONLY": "Test Investigational",
"Options": "Test Options",
"Preferences": "Test Preferences"
}
@@ -0,0 +1,12 @@
{
"Measurements": "Test Measurements",
"No tracked measurements": "Test No tracked measurements",
"Create Report": "Test Create Report",
"Export": "Test Export",
"Delete": "Delete",
"Description": "Description",
"MAX": "MAX",
"NonTargets": "NonTargets",
"Relabel": "Relabel",
"Targets": "Targets"
}
@@ -0,0 +1,13 @@
{
"Download High Quality Image": "Test Download High Quality Image",
"Cancel": "Test Cancel",
"Download": "Test Download",
"File Name": "Test File Name",
"Active viewport has no displayed image": "Test Active viewport has no displayed image",
"Image preview": "Test Image preview",
"Show Annotations": "Test Show Annotations",
"File Type": "Test File Type",
"Image height (px)": "Test Image height (px)",
"Image width (px)": "Test Image width (px)",
"Please specify the dimensions, filename, and desired type for the output image.": "Test Please specify the dimensions, filename, and desired type for the output image."
}
@@ -0,0 +1,3 @@
{
"Basic Viewer": "Test Basic Viewer"
}
@@ -0,0 +1,8 @@
{
"Age": "Test Age",
"Sex": "Test Sex",
"MRN": "Test MRN",
"Thickness": "Test Thickness",
"Spacing": "Test Spacing",
"Scanner": "Test Scanner"
}
@@ -0,0 +1,4 @@
{
"Studies": "Test Studies",
"Measurements": "Test Measurements"
}
@@ -0,0 +1,5 @@
{
"Primary": "Test Primary",
"Recent": "Test Recent",
"All": "Test All"
}
@@ -0,0 +1,21 @@
{
"AccessionNumber": "Test Accession #",
"Accession": "Test Accession",
"Next >": "Test Next >",
"< Previous": "Test < Previous",
"Results per page": "Test Results per page",
"Empty": "Test Empty",
"MRN": "Test MRN",
"Modality": "Test Modality",
"PatientName": "Test PatientName",
"Patient Name": "Test Patient Name",
"Description": "Test Description",
"StudyDate": "Test Study Date",
"Study date": "Test Study Date",
"Studies": "Test Studies",
"Series": "Test Series",
"Instances": "Test Instances",
"Study List": "Test Study List",
"Study list": "Test Study list",
"Filter list to 100 studies or less to enable sorting": "Test Filter list to 100 studies or less to enable sorting"
}
@@ -0,0 +1,3 @@
{
"Zoom": "toolTip1"
}
@@ -0,0 +1,14 @@
{
"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)",
"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",
"Function": "Test function",
"Shortcut": "Test shortcut",
"Language": "Test language",
"Hotkeys": "Test hotkeys",
"General": "Test general"
}
@@ -0,0 +1,14 @@
{
"emptyFilenameError": "The file name cannot be empty.",
"fileType": "File Type",
"filename": "File Name",
"formTitle": "Please specify the dimensions, filename, and desired type for the output image.",
"imageHeight": "Image height (px)",
"imagePreview": "Image Preview",
"imageWidth": "Image width (px)",
"keepAspectRatio": "Keep aspect ratio",
"loadingPreview": "Loading Image Preview...",
"minHeightError": "The minimum valid height is 100px.",
"minWidthError": "The minimum valid width is 100px.",
"showAnnotations": "Show Annotations"
}
@@ -0,0 +1,37 @@
import AboutModal from './AboutModal.json';
import Buttons from './Buttons.json';
import CineDialog from './CineDialog.json';
import Common from './Common.json';
import DatePicker from './DatePicker.json';
import Header from './Header.json';
import MeasurementTable from './MeasurementTable.json';
import StudyList from './StudyList.json';
import UserPreferencesModal from './UserPreferencesModal.json';
import ViewportDownloadForm from './ViewportDownloadForm.json';
import ToolTip from './ToolTip.json';
import StudyBrowser from './StudyBrowser.json';
import SidePanel from './SidePanel.json';
import PatientInfo from './PatientInfo.json';
import Modes from './Modes.json';
import Modals from './Modals.json';
export default {
'test-LNG': {
AboutModal,
Buttons,
CineDialog,
Common,
DatePicker,
Header,
MeasurementTable,
StudyList,
UserPreferencesModal,
ViewportDownloadForm,
ToolTip,
StudyBrowser,
PatientInfo,
Modes,
SidePanel,
Modals
},
};
+1
View File
@@ -54,6 +54,7 @@ const languagesMap = {
zh: 'Chinese',
'zh-CN': 'Chinese (China)',
'zh-TW': 'Chinese (Taiwan)',
'test-LNG': 'Test Language',
};
const getLanguageLabel = (language) => {