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

@@ -10,6 +10,10 @@ import {
useModal,
} from '@ohif/ui';
import i18n from '@ohif/i18n';
const { availableLanguages, defaultLanguage, currentLanguage } = i18n;
import { useAppConfig } from '@state';
function Toolbar({ servicesManager }) {
@@ -108,8 +112,12 @@ function ViewerLayout({
hotkeyDefaults
),
hotkeyDefinitions,
currentLanguage: currentLanguage(),
availableLanguages,
defaultLanguage,
onCancel: hide,
onSubmit: ({ hotkeyDefinitions }) => {
onSubmit: ({ hotkeyDefinitions, language }) => {
i18n.changeLanguage(language.value);
hotkeysManager.setHotkeys(hotkeyDefinitions);
hide();
},
@@ -1,13 +1,17 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, ButtonGroup, Icon, IconButton } from '@ohif/ui';
import { useTranslation } from 'react-i18next';
import { Button, ButtonGroup } from '@ohif/ui';
function ActionButtons({ onExportClick, onCreateReportClick }) {
const { t } = useTranslation('MeasurementTable');
return (
<React.Fragment>
<ButtonGroup color="black" size="inherit">
<Button className="text-base px-2 py-2" onClick={onExportClick}>
Export
{t('Export')}
</Button>
</ButtonGroup>
<Button
@@ -17,7 +21,7 @@ function ActionButtons({ onExportClick, onCreateReportClick }) {
color="black"
onClick={onCreateReportClick}
>
Create Report
{t('Create Report')}
</Button>
</React.Fragment>
);