Skip to content

Commit

Permalink
refactor: import i18n from d2-i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Nov 4, 2024
1 parent 98a7193 commit 799a44f
Show file tree
Hide file tree
Showing 83 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion src/components/AboutAOUnit/AboutAOUnit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
useDataMutation,
useTimeZoneConversion,
} from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Button,
CircularLoader,
Expand All @@ -26,7 +27,6 @@ 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'
Expand Down
2 changes: 1 addition & 1 deletion src/components/AboutAOUnit/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from '../../locales/index.js'
import i18n from '@dhis2/d2-i18n'

export const AO_TYPE_VISUALIZATION = 'visualization'
export const AO_TYPE_MAP = 'map'
Expand Down
2 changes: 1 addition & 1 deletion src/components/CachedDataQueryProvider.js
Original file line number Diff line number Diff line change
@@ -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({})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useAlert, useDataMutation, useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Button,
Modal,
Expand All @@ -17,7 +18,6 @@ import {
updateCalculationMutation,
validateExpressionMutation,
} from '../../../api/expression.js'
import i18n from '../../../locales/index.js'
import {
parseExpressionToArray,
parseArrayToExpression,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useDataEngine } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
CircularLoader,
InputField,
Expand All @@ -12,7 +13,6 @@ import cx from 'classnames'
import PropTypes from 'prop-types'
import React, { useEffect, useRef, useState } from 'react'
import { apiFetchOptions, apiFetchGroups } from '../../../api/dimensions.js'
import i18n from '../../../locales/index.js'
import {
TOTALS,
DETAIL,
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/Calculation/FormulaField.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../../locales/index.js'
import { getOperators } from '../../../modules/expressions.js'
import DraggableOperator from './Operator.js'
import styles from './styles/MathOperatorSelector.style.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/DataTypeSelector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from '@dhis2/d2-i18n'
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../locales/index.js'
import { DIMENSION_TYPE_ALL, dataTypeMap } from '../../modules/dataTypes.js'
import { getDisplayNameByVisType } from '../../modules/visTypes.js'
import { useDataDimensionContext } from './DataDimension.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/DetailSelector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from '@dhis2/d2-i18n'
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../locales/index.js'
import { TOTALS, DETAIL } from '../../modules/dataTypes.js'
import styles from './styles/DetailSelector.style.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/GroupSelector.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useDataEngine } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useEffect, useState } from 'react'
import { apiFetchGroups } from '../../api/dimensions.js'
import i18n from '../../locales/index.js'
import {
dataTypeMap as dataTypes,
SUB_GROUP_DETAIL,
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/ItemSelector.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useDataEngine } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import { Transfer, InputField, IconInfo16, Button, IconAdd24 } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState } from 'react'
import { apiFetchOptions } from '../../api/dimensions.js'
import i18n from '../../locales/index.js'
import { DATA_SETS_CONSTANTS, REPORTING_RATE } from '../../modules/dataSets.js'
import {
DIMENSION_TYPE_ALL,
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataDimension/MetricSelector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from '@dhis2/d2-i18n'
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../locales/index.js'
import { DATA_SETS_CONSTANTS } from '../../modules/dataSets.js'
import { DIMENSION_TYPE_ALL } from '../../modules/dataTypes.js'
import styles from './styles/MetricSelector.style.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/DimensionMenu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from '@dhis2/d2-i18n'
import { MenuDivider, FlyoutMenu, MenuItem, Tooltip } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../locales/index.js'
import { getAxisNameByLayoutType } from '../modules/axis.js'
import { AXIS_ID_FILTERS } from '../modules/layout/axis.js'
import { getAvailableAxes } from '../modules/layoutUiRules/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/DimensionsPanel/DimensionsPanel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import i18n from '../../locales/index.js'
import Filter from '../Filter/Filter.js'
import DimensionList from './List/DimensionList.js'
import { styles } from './styles/DimensionsPanel.style.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/DimensionsPanel/List/DimensionList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import i18n from '../../../locales/index.js'
import {
getPredefinedDimensions,
getFixedDimensions,
Expand Down
2 changes: 1 addition & 1 deletion src/components/DimensionsPanel/List/RecommendedIcon.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from '@dhis2/d2-i18n'
import { Tooltip } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../../locales/index.js'
import { styles } from './styles/RecommendedIcon.style.js'

const RecommendedIcon = ({ isRecommended, dataTest }) =>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DynamicDimension/DynamicDimension.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useDataEngine } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import { Radio, Field } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import { apiFetchItemsByDimension } from '../../api/dimensions.js'
import i18n from '../../locales/index.js'
import ItemSelector from './ItemSelector.js'
import styles from './styles/DynamicDimension.style.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/DynamicDimension/ItemSelector.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import i18n from '@dhis2/d2-i18n'
import { Transfer, InputField } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState, useEffect, useCallback } from 'react'
import GenericIcon from '../../assets/DimensionItemIcons/GenericIcon.js'
import i18n from '../../locales/index.js'
import {
TRANSFER_HEIGHT,
TRANSFER_OPTIONS_WIDTH,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/DeleteDialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useDataMutation } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalTitle,
Expand All @@ -9,7 +10,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useMemo } from 'react'
import i18n from '../../locales/index.js'
import {
supportedFileTypes,
endpointFromFileType,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/FileMenu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18n from '@dhis2/d2-i18n'
import {
IconAdd24,
IconLaunch24,
Expand All @@ -13,7 +14,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState } from 'react'
import i18n from '../../locales/index.js'
import { OpenFileDialog } from '../OpenFileDialog/OpenFileDialog.js'
import {
HoverMenuListItem,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/GetLinkDialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useConfig } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalContent,
Expand All @@ -9,7 +10,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import i18n from '../../locales/index.js'
import { styles } from './GetLinkDialog.styles.js'
import { supportedFileTypes, appPathFor } from './utils.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/RenameDialog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useDataMutation } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalTitle,
Expand All @@ -11,7 +12,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useMemo, useState } from 'react'
import i18n from '../../locales/index.js'
import { modalStyles } from './FileMenu.styles.js'
import {
supportedFileTypes,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/SaveAsDialog.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalTitle,
Expand All @@ -10,7 +11,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState } from 'react'
import i18n from '../../locales/index.js'
import { modalStyles } from './FileMenu.styles.js'
import { supportedFileTypes, labelForFileType } from './utils.js'

Expand Down
2 changes: 1 addition & 1 deletion src/components/FileMenu/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from '../../locales/index.js'
import i18n from '@dhis2/d2-i18n'

export const FILE_TYPE_EVENT_REPORT = 'eventReport'
export const FILE_TYPE_VISUALIZATION = 'visualization'
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
Modal,
ModalActions,
Expand All @@ -15,7 +16,6 @@ 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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import {
CircularLoader,
IconChevronDown24,
Expand All @@ -15,7 +16,6 @@ import React, {
useImperativeHandle,
forwardRef,
} from 'react'
import i18n from '../../../locales/index.js'
import { InterpretationForm } from './InterpretationForm.js'
import { InterpretationList } from './InterpretationList.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18n from '@dhis2/d2-i18n'
import {
Button,
SharingDialog,
Expand All @@ -10,7 +11,6 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState } from 'react'
import i18n from '../../../../locales/index.js'
import {
Message,
MessageStatsBar,
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/OfflineTooltip.js
Original file line number Diff line number Diff line change
@@ -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 = ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/OpenFileDialog/CreatedByFilter.js
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading

0 comments on commit 799a44f

Please sign in to comment.