diff --git a/src/components/AboutAOUnit/AboutAOUnit.js b/src/components/AboutAOUnit/AboutAOUnit.js index 1e2d77ab1..cb4a65cb7 100644 --- a/src/components/AboutAOUnit/AboutAOUnit.js +++ b/src/components/AboutAOUnit/AboutAOUnit.js @@ -3,7 +3,6 @@ import { useDataMutation, useTimeZoneConversion, } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button, CircularLoader, @@ -27,6 +26,7 @@ import React, { forwardRef, useImperativeHandle, } from 'react' +import i18n from '../../locales/index.js' import { formatList } from '../../modules/list.js' import { RichTextParser } from '../RichText/index.js' import styles from './styles/AboutAOUnit.style.js' diff --git a/src/components/AboutAOUnit/utils.js b/src/components/AboutAOUnit/utils.js index 88bae014c..4cbaecb49 100644 --- a/src/components/AboutAOUnit/utils.js +++ b/src/components/AboutAOUnit/utils.js @@ -1,4 +1,4 @@ -import i18n from '@dhis2/d2-i18n' +import i18n from '../../locales/index.js' export const AO_TYPE_VISUALIZATION = 'visualization' export const AO_TYPE_MAP = 'map' diff --git a/src/components/CachedDataQueryProvider.js b/src/components/CachedDataQueryProvider.js index e4a3786d0..d1b8f542f 100644 --- a/src/components/CachedDataQueryProvider.js +++ b/src/components/CachedDataQueryProvider.js @@ -1,8 +1,8 @@ import { useDataQuery } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Layer, CenteredContent, CircularLoader, NoticeBox } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { createContext, useContext } from 'react' +import i18n from '../locales/index.js' const CachedDataQueryCtx = createContext({}) diff --git a/src/components/DataDimension/Calculation/FormulaField.js b/src/components/DataDimension/Calculation/FormulaField.js index 388394deb..79cdcea82 100644 --- a/src/components/DataDimension/Calculation/FormulaField.js +++ b/src/components/DataDimension/Calculation/FormulaField.js @@ -1,10 +1,10 @@ -import i18n from '@dhis2/d2-i18n' import { Center, CircularLoader } from '@dhis2/ui' import { useDroppable } from '@dnd-kit/core' import { SortableContext } from '@dnd-kit/sortable' import PropTypes from 'prop-types' import React from 'react' import FormulaIcon from '../../../assets/FormulaIcon.js' +import i18n from '../../../locales/index.js' import DropZone from './DropZone.js' import FormulaItem from './FormulaItem.js' import styles from './styles/FormulaField.style.js' diff --git a/src/components/FileMenu/utils.js b/src/components/FileMenu/utils.js index 5f69b331e..ae95418cc 100644 --- a/src/components/FileMenu/utils.js +++ b/src/components/FileMenu/utils.js @@ -1,4 +1,4 @@ -import i18n from '@dhis2/d2-i18n' +import i18n from '../../locales/index.js' export const FILE_TYPE_EVENT_REPORT = 'eventReport' export const FILE_TYPE_VISUALIZATION = 'visualization' diff --git a/src/components/Interpretations/InterpretationModal/Comment.js b/src/components/Interpretations/InterpretationModal/Comment.js index e1fef4fe1..22e1c49fc 100644 --- a/src/components/Interpretations/InterpretationModal/Comment.js +++ b/src/components/Interpretations/InterpretationModal/Comment.js @@ -1,7 +1,7 @@ -import i18n from '@dhis2/d2-i18n' import { IconEdit16 } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' +import i18n from '../../../locales/index.js' import { Message, MessageIconButton, diff --git a/src/components/Interpretations/InterpretationModal/CommentAddForm.js b/src/components/Interpretations/InterpretationModal/CommentAddForm.js index 0b8f98498..605993e27 100644 --- a/src/components/Interpretations/InterpretationModal/CommentAddForm.js +++ b/src/components/Interpretations/InterpretationModal/CommentAddForm.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useRef, useState } from 'react' +import i18n from '../../../locales/index.js' import { RichTextEditor } from '../../RichText/index.js' import { MessageEditorContainer, diff --git a/src/components/Interpretations/InterpretationModal/CommentDeleteButton.js b/src/components/Interpretations/InterpretationModal/CommentDeleteButton.js index 363733235..76fa68df7 100644 --- a/src/components/Interpretations/InterpretationModal/CommentDeleteButton.js +++ b/src/components/Interpretations/InterpretationModal/CommentDeleteButton.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { IconDelete16, colors } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' +import i18n from '../../../locales/index.js' import { MessageIconButton } from '../common/index.js' const mutation = { diff --git a/src/components/Interpretations/InterpretationModal/CommentUpdateForm.js b/src/components/Interpretations/InterpretationModal/CommentUpdateForm.js index dc90d2175..ac37d8bcc 100644 --- a/src/components/Interpretations/InterpretationModal/CommentUpdateForm.js +++ b/src/components/Interpretations/InterpretationModal/CommentUpdateForm.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button, spacers, colors } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState, useRef } from 'react' +import i18n from '../../../locales/index.js' import { RichTextEditor } from '../../RichText/index.js' import { MessageEditorContainer, MessageButtonStrip } from '../common/index.js' diff --git a/src/components/Interpretations/InterpretationModal/InterpretationModal.js b/src/components/Interpretations/InterpretationModal/InterpretationModal.js index 425eb053c..6d2e7aaeb 100644 --- a/src/components/Interpretations/InterpretationModal/InterpretationModal.js +++ b/src/components/Interpretations/InterpretationModal/InterpretationModal.js @@ -1,5 +1,4 @@ import { useDataQuery } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Modal, ModalActions, @@ -16,6 +15,7 @@ import cx from 'classnames' import PropTypes from 'prop-types' import React, { useEffect, useState, useMemo } from 'react' import css from 'styled-jsx/css' +import i18n from '../../../locales/index.js' import { InterpretationThread } from './InterpretationThread.js' import { useModalContentWidth } from './useModalContentWidth.js' diff --git a/src/components/Interpretations/InterpretationsUnit/InterpretationForm.js b/src/components/Interpretations/InterpretationsUnit/InterpretationForm.js index c6467a453..6084c8985 100644 --- a/src/components/Interpretations/InterpretationsUnit/InterpretationForm.js +++ b/src/components/Interpretations/InterpretationsUnit/InterpretationForm.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button, Input } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useRef, useState } from 'react' +import i18n from '../../../locales/index.js' import { RichTextEditor } from '../../RichText/index.js' import { MessageEditorContainer, MessageButtonStrip } from '../common/index.js' diff --git a/src/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js b/src/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js index 33311fceb..c8070033f 100644 --- a/src/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +++ b/src/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js @@ -1,5 +1,4 @@ import { useDataQuery } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { CircularLoader, IconChevronDown24, @@ -16,6 +15,7 @@ import React, { useImperativeHandle, forwardRef, } from 'react' +import i18n from '../../../locales/index.js' import { InterpretationForm } from './InterpretationForm.js' import { InterpretationList } from './InterpretationList.js' diff --git a/src/components/Interpretations/common/Interpretation/Interpretation.js b/src/components/Interpretations/common/Interpretation/Interpretation.js index 8167aa244..e8380de4a 100644 --- a/src/components/Interpretations/common/Interpretation/Interpretation.js +++ b/src/components/Interpretations/common/Interpretation/Interpretation.js @@ -1,4 +1,3 @@ -import i18n from '@dhis2/d2-i18n' import { Button, SharingDialog, @@ -11,6 +10,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' +import i18n from '../../../../locales/index.js' import { Message, MessageStatsBar, diff --git a/src/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js b/src/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js index cae57b00b..573b18ce3 100644 --- a/src/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +++ b/src/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { IconDelete16 } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../../../locales/index.js' import { MessageIconButton } from '../index.js' const mutation = { diff --git a/src/components/Interpretations/common/Interpretation/InterpretationSharingLink.js b/src/components/Interpretations/common/Interpretation/InterpretationSharingLink.js index f13f6a94a..d381df6de 100644 --- a/src/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +++ b/src/components/Interpretations/common/Interpretation/InterpretationSharingLink.js @@ -1,7 +1,7 @@ -import i18n from '@dhis2/d2-i18n' import { SharingDialog, colors, spacers } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' +import i18n from '../../../../locales/index.js' const InterpretationSharingLink = ({ type, id }) => { const [showSharingDialog, setShowSharingDialog] = useState(false) diff --git a/src/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js b/src/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js index 9891d7052..2ad945234 100644 --- a/src/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +++ b/src/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js @@ -1,8 +1,8 @@ import { useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button, spacers, colors } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' +import i18n from '../../../../locales/index.js' import { RichTextEditor } from '../../../RichText/index.js' import { MessageEditorContainer, diff --git a/src/components/OfflineTooltip.js b/src/components/OfflineTooltip.js index 85b548532..74da2f006 100644 --- a/src/components/OfflineTooltip.js +++ b/src/components/OfflineTooltip.js @@ -1,9 +1,9 @@ import { useDhis2ConnectionStatus } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Tooltip } from '@dhis2/ui' import cx from 'classnames' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../locales/index.js' import { styles } from './styles/OfflineTooltip.style.js' const OfflineTooltip = ({ diff --git a/src/components/OpenFileDialog/CreatedByFilter.js b/src/components/OpenFileDialog/CreatedByFilter.js index b7bd74a43..ae43db1f3 100644 --- a/src/components/OpenFileDialog/CreatedByFilter.js +++ b/src/components/OpenFileDialog/CreatedByFilter.js @@ -1,7 +1,7 @@ -import i18n from '@dhis2/d2-i18n' import { SingleSelect, SingleSelectOption } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../locales/index.js' // TODO change the "Created by" prefix to "Creator" or something that does not require a context for the translators diff --git a/src/components/OpenFileDialog/CustomSelectOption.js b/src/components/OpenFileDialog/CustomSelectOption.js index 9e7f7b0ef..d5dcd8fcb 100644 --- a/src/components/OpenFileDialog/CustomSelectOption.js +++ b/src/components/OpenFileDialog/CustomSelectOption.js @@ -1,8 +1,8 @@ -import i18n from '@dhis2/d2-i18n' import { MenuDivider, Tooltip } from '@dhis2/ui' import cx from 'classnames' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../locales/index.js' import styles from './styles/CustomSelectOption.style.js' const CustomSelectOptionItem = ({ diff --git a/src/components/OpenFileDialog/NameFilter.js b/src/components/OpenFileDialog/NameFilter.js index 1b6f3b2e3..0e05aed71 100644 --- a/src/components/OpenFileDialog/NameFilter.js +++ b/src/components/OpenFileDialog/NameFilter.js @@ -1,7 +1,7 @@ -import i18n from '@dhis2/d2-i18n' import { Input } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../locales/index.js' export const NameFilter = ({ dataTest, value, onChange }) => ( ( ( diff --git a/src/components/TranslationDialog/TranslationModal/LocalesSelect.js b/src/components/TranslationDialog/TranslationModal/LocalesSelect.js index 57a00078b..2f8b20c09 100644 --- a/src/components/TranslationDialog/TranslationModal/LocalesSelect.js +++ b/src/components/TranslationDialog/TranslationModal/LocalesSelect.js @@ -1,8 +1,8 @@ import { useDataQuery } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { SingleSelect, SingleSelectOption } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../../locales/index.js' const query = { locales: { diff --git a/src/components/TranslationDialog/TranslationModal/TranslationForm.js b/src/components/TranslationDialog/TranslationModal/TranslationForm.js index 1152acb33..440fac847 100644 --- a/src/components/TranslationDialog/TranslationModal/TranslationForm.js +++ b/src/components/TranslationDialog/TranslationModal/TranslationForm.js @@ -1,5 +1,4 @@ import { useAlert, useDataMutation } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { CenteredContent, DataTable, @@ -13,6 +12,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useEffect, useRef, useState } from 'react' +import i18n from '../../../locales/index.js' import { LocalesSelect } from './LocalesSelect.js' import { TranslationModalActions } from './TranslationModalActions.js' diff --git a/src/components/TranslationDialog/TranslationModal/TranslationModal.js b/src/components/TranslationDialog/TranslationModal/TranslationModal.js index 0e0e6f80a..57d277a81 100644 --- a/src/components/TranslationDialog/TranslationModal/TranslationModal.js +++ b/src/components/TranslationDialog/TranslationModal/TranslationModal.js @@ -1,4 +1,3 @@ -import i18n from '@dhis2/d2-i18n' import { CenteredContent, CircularLoader, @@ -8,6 +7,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useEffect, useState } from 'react' +import i18n from '../../../locales/index.js' import { TranslationForm } from './TranslationForm.js' import { TranslationModalActions } from './TranslationModalActions.js' import { useTranslationsResults } from './useTranslationsResults.js' diff --git a/src/components/TranslationDialog/TranslationModal/TranslationModalActions.js b/src/components/TranslationDialog/TranslationModal/TranslationModalActions.js index 71d2cd582..d3a09a067 100644 --- a/src/components/TranslationDialog/TranslationModal/TranslationModalActions.js +++ b/src/components/TranslationDialog/TranslationModal/TranslationModalActions.js @@ -1,8 +1,8 @@ import { useDhis2ConnectionStatus } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { Button, ButtonStrip, ModalActions } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../../locales/index.js' import { OfflineTooltip } from '../../OfflineTooltip.js' const SaveButton = ({ disabled, loading, onClick }) => ( diff --git a/src/components/TranslationDialog/TranslationModal/useTranslationsResults.js b/src/components/TranslationDialog/TranslationModal/useTranslationsResults.js index bed37cf8e..844cc62d3 100644 --- a/src/components/TranslationDialog/TranslationModal/useTranslationsResults.js +++ b/src/components/TranslationDialog/TranslationModal/useTranslationsResults.js @@ -1,6 +1,6 @@ import { useAlert, useDataQuery } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' import { useRef } from 'react' +import i18n from '../../../locales/index.js' export const useTranslationsResults = ({ resource }) => { const translationsQueryRef = useRef({ diff --git a/src/components/UserMention/UserList.js b/src/components/UserMention/UserList.js index 5aa04a844..1b9af72fe 100644 --- a/src/components/UserMention/UserList.js +++ b/src/components/UserMention/UserList.js @@ -1,7 +1,7 @@ -import i18n from '@dhis2/d2-i18n' import { MenuItem } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' +import i18n from '../../locales/index.js' export const UserList = ({ users, selectedUserIndex, onUserClick, pager }) => { return ( diff --git a/src/components/UserMention/UserMentionWrapper.js b/src/components/UserMention/UserMentionWrapper.js index 4550d5513..9d9c085e4 100644 --- a/src/components/UserMention/UserMentionWrapper.js +++ b/src/components/UserMention/UserMentionWrapper.js @@ -1,4 +1,3 @@ -import i18n from '@dhis2/d2-i18n' import { CenteredContent, CircularLoader, @@ -11,6 +10,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState, useRef } from 'react' +import i18n from '../../locales/index.js' import { resolvedHeaderStyle, userMentionWrapperClasses, diff --git a/src/modules/pivotTable/PivotTableEngine.js b/src/modules/pivotTable/PivotTableEngine.js index ad798e686..a50d2737d 100644 --- a/src/modules/pivotTable/PivotTableEngine.js +++ b/src/modules/pivotTable/PivotTableEngine.js @@ -1,5 +1,5 @@ -import i18n from '@dhis2/d2-i18n' import times from 'lodash/times' +import i18n from '../../locales/index.js' import { DIMENSION_TYPE_DATA, DIMENSION_TYPE_DATA_ELEMENT_GROUP_SET,