diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/AboutSection/EmptyContentSection.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/AboutSection/EmptyContentSection.tsx index 63af0e4db562ca..cf86fb7df94d6f 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/AboutSection/EmptyContentSection.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/AboutSection/EmptyContentSection.tsx @@ -27,7 +27,7 @@ interface Props { export default function EmptyContentSection({ hideLinksButton, readOnly }: Props) { const routeToTab = useRouteToTab(); const refetch = useRefetch(); - const { t } = useTranslation(['empty-message']); + const { t } = useTranslation(['translation', 'empty-message']); return ( @@ -38,7 +38,7 @@ export default function EmptyContentSection({ hideLinksButton, readOnly }: Props {!readOnly && ( )} {!readOnly && !hideLinksButton && ( diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx index 24032582610827..db3d5c9342389a 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx @@ -24,7 +24,7 @@ interface Props { export default function DataProductSection({ readOnly }: Props) { const [isModalVisible, setIsModalVisible] = useState(false); const { entityData, urn } = useEntityData(); - const { t } = useTranslation(['empty-message']); + const { t } = useTranslation(['translation', 'empty-message']); const [batchSetDataProductMutation] = useBatchSetDataProductMutation(); const [dataProduct, setDataProduct] = useState(null); const dataProductRelationships = entityData?.dataProduct?.relationships; diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Domain/SidebarDomainSection.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Domain/SidebarDomainSection.tsx index 91e9cd423ff673..00510ba2d14c68 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Domain/SidebarDomainSection.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Domain/SidebarDomainSection.tsx @@ -107,7 +107,7 @@ export const SidebarDomainSection = ({ readOnly, properties }: Props) => { )} {!readOnly && ( setShowModal(true)}> - {t('crud.setWithname', { name: t('common.domain') })} + {t('crud.setWithName', { name: t('common.domain') })} )} diff --git a/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagement.tsx b/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagement.tsx index faffe7ca8705d8..bf094e67e80d07 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagement.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagement.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from 'styled-components'; import { Button, Table } from 'antd'; +import { useTranslation } from 'react-i18next'; import { useBaseEntity } from '../../../EntityContext'; import { GetDatasetQuery, useGetExternalRolesQuery } from '../../../../../../graphql/dataset.generated'; import { useGetMeQuery } from '../../../../../../graphql/me.generated'; import { handleAccessRoles } from './utils'; import AccessManagerDescription from './AccessManagerDescription'; -import { useTranslation } from 'react-i18next'; const StyledTable = styled(Table)` overflow: inherit; diff --git a/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagerDescription.tsx b/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagerDescription.tsx index ce2afd3c2cdb1c..a026552bcf23ef 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagerDescription.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Dataset/AccessManagement/AccessManagerDescription.tsx @@ -33,7 +33,9 @@ export default function AccessManagerDescription({ description }: Props) { toggleExpanded(); }} > - {(shouldTruncateDescription && (expanded ? ` ${t('common.readLess')}` : `...${t('common.readMore')}`)) || undefined} + {(shouldTruncateDescription && + (expanded ? ` ${t('common.readLess')}` : `...${t('common.readMore')}`)) || + undefined} ); diff --git a/datahub-web-react/src/app/entity/tag/TagProfile.tsx b/datahub-web-react/src/app/entity/tag/TagProfile.tsx index eacb6359ab8592..76275fc90f6d14 100644 --- a/datahub-web-react/src/app/entity/tag/TagProfile.tsx +++ b/datahub-web-react/src/app/entity/tag/TagProfile.tsx @@ -1,13 +1,11 @@ import React from 'react'; - import { useParams } from 'react-router'; import styled from 'styled-components'; - +import { useTranslation } from 'react-i18next'; import { Message } from '../../shared/Message'; import { decodeUrn } from '../shared/utils'; import TagStyleEntity from '../../shared/TagStyleEntity'; import { useGetTagQuery } from '../../../graphql/tag.generated'; -import { useTranslation } from 'react-i18next'; const PageContainer = styled.div` padding: 32px 100px; diff --git a/datahub-web-react/src/app/glossary/GlossarySearch.tsx b/datahub-web-react/src/app/glossary/GlossarySearch.tsx index 1c0a81104c002b..ff33c847be88ac 100644 --- a/datahub-web-react/src/app/glossary/GlossarySearch.tsx +++ b/datahub-web-react/src/app/glossary/GlossarySearch.tsx @@ -69,7 +69,7 @@ function GlossarySearch() { setIsSearchBarFocused(false)}> ; + return ; } diff --git a/datahub-web-react/src/app/identity/user/SelectRole.tsx b/datahub-web-react/src/app/identity/user/SelectRole.tsx index 2bf947a615af37..2b036510620df1 100644 --- a/datahub-web-react/src/app/identity/user/SelectRole.tsx +++ b/datahub-web-react/src/app/identity/user/SelectRole.tsx @@ -3,12 +3,12 @@ import { UserOutlined } from '@ant-design/icons'; import { Select } from 'antd'; import { useApolloClient } from '@apollo/client'; import styled from 'styled-components'; +import { useTranslation } from 'react-i18next'; import { CorpUser, DataHubRole } from '../../../types.generated'; import AssignRoleConfirmation from './AssignRoleConfirmation'; import { mapRoleIcon } from './UserUtils'; import { ANTD_GRAY } from '../../entity/shared/constants'; import { clearRoleListCache } from '../../permissions/roles/cacheUtils'; -import { useTranslation } from 'react-i18next'; const NO_ROLE_TRANS_KEY = 'permissions.noRole'; const NO_ROLE_URN = 'urn:li:dataHubRole:NoRole'; diff --git a/datahub-web-react/src/app/ingest/source/IngestedAssets.tsx b/datahub-web-react/src/app/ingest/source/IngestedAssets.tsx index 6ab216ada55f89..1c3b2deb8f09e7 100644 --- a/datahub-web-react/src/app/ingest/source/IngestedAssets.tsx +++ b/datahub-web-react/src/app/ingest/source/IngestedAssets.tsx @@ -139,7 +139,7 @@ export default function IngestedAssets({ id }: Props) { {showAssetSearch && ( ScheduleColumn(schedule, record, t), }, { title: t('ingest.executionCount'), @@ -77,7 +77,7 @@ function IngestionSourceTable({ title: t('ingest.lastExecution'), dataIndex: 'lastExecTime', key: 'lastExecTime', - render: LastExecutionColumn, + render: (schedule: any) => LastExecutionColumn(schedule, t), sorter: (sourceA, sourceB) => sourceA.lastExecTime - sourceB.lastExecTime, }, { diff --git a/datahub-web-react/src/app/ingest/source/IngestionSourceTableColumns.tsx b/datahub-web-react/src/app/ingest/source/IngestionSourceTableColumns.tsx index e0d5281c9c4ff3..00e7f0917049df 100644 --- a/datahub-web-react/src/app/ingest/source/IngestionSourceTableColumns.tsx +++ b/datahub-web-react/src/app/ingest/source/IngestionSourceTableColumns.tsx @@ -5,6 +5,7 @@ import cronstrue from 'cronstrue'; import React from 'react'; import styled from 'styled-components/macro'; import { useTranslation } from 'react-i18next'; +import { TFunction } from 'i18next'; import { ANTD_GRAY } from '../../entity/shared/constants'; import { capitalizeFirstLetter } from '../../shared/textUtil'; import useGetSourceLogoUrl from './builder/useGetSourceLogoUrl'; @@ -19,7 +20,7 @@ const PreviewImage = styled(Image)` max-height: 28px; width: auto; object-fit: contain; - margin: 0px; + margin: 0; background-color: transparent; `; @@ -30,8 +31,8 @@ const StatusContainer = styled.div` `; const StatusButton = styled(Button)` - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; `; const ActionButtonContainer = styled.div` @@ -49,8 +50,6 @@ const CliBadge = styled.span` border-radius: 15px; border: 1px solid ${ANTD_GRAY[8]}; padding: 1px 4px; - font-size: 10px; - font-size: 8px; font-weight: bold; letter-spacing: 0.5px; @@ -93,15 +92,13 @@ export function TypeColumn({ type, record }: TypeColumnProps) { ); } -export function LastExecutionColumn(time: any) { - const { t } = useTranslation(); +export function LastExecutionColumn(time: any, t: TFunction) { const executionDate = time && new Date(time); const localTime = executionDate && `${executionDate.toLocaleDateString()} at ${executionDate.toLocaleTimeString()}`; return {localTime || t('common.none')}; } -export function ScheduleColumn(schedule: any, record: any) { - const { t } = useTranslation(); +export function ScheduleColumn(schedule: any, record: any, t: TFunction) { const tooltip = schedule && `${t('common.runs')} ${cronstrue.toString(schedule).toLowerCase()} (${record.timezone})`; return ( diff --git a/datahub-web-react/src/app/ingest/source/builder/IngestionSourceBuilderModal.tsx b/datahub-web-react/src/app/ingest/source/builder/IngestionSourceBuilderModal.tsx index 569db90d93817e..c44941fcd53324 100644 --- a/datahub-web-react/src/app/ingest/source/builder/IngestionSourceBuilderModal.tsx +++ b/datahub-web-react/src/app/ingest/source/builder/IngestionSourceBuilderModal.tsx @@ -68,7 +68,9 @@ type Props = { export const IngestionSourceBuilderModal = ({ initialState, visible, onSubmit, onCancel }: Props) => { const { t } = useTranslation(); const isEditing = initialState !== undefined; - const titleText = isEditing ? 'Edit Ingestion Source' : 'New Ingestion Source'; + const titleText = isEditing + ? t('crud.editWithName', { name: t('ingest.ingestionSource') }) + : t('crud.createWithName', { name: t('ingest.ingestionSource') }); const initialStep = isEditing ? IngestionSourceBuilderStep.DEFINE_RECIPE : IngestionSourceBuilderStep.SELECT_TEMPLATE; diff --git a/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTable.tsx b/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTable.tsx index e1423a2bc9ecc6..d4a8dcee7a9316 100644 --- a/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTable.tsx +++ b/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTable.tsx @@ -27,16 +27,16 @@ export default function IngestionExecutionTable({ title: t('ingest.requestedAt'), dataIndex: 'requestedAt', key: 'requestedAt', - render: TimeColumn, + render: (time: string) => TimeColumn(time, t), }, { title: t('ingest.startedAt'), dataIndex: 'executedAt', key: 'executedAt', - render: TimeColumn, + render: (time: string) => TimeColumn(time, t), }, { - title: `${t('ingest.duration')} (s)`, + title: t('ingest.duration'), dataIndex: 'duration', key: 'duration', render: (durationMs: number) => { @@ -56,7 +56,7 @@ export default function IngestionExecutionTable({ title: t('common.source'), dataIndex: 'source', key: 'source', - render: SourceColumn, + render: (source: string) => SourceColumn(source, t), }, { title: '', diff --git a/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTableColumns.tsx b/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTableColumns.tsx index 954287291f455a..7598e8973d0e41 100644 --- a/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTableColumns.tsx +++ b/datahub-web-react/src/app/ingest/source/executions/IngestionExecutionTableColumns.tsx @@ -3,6 +3,7 @@ import { CopyOutlined } from '@ant-design/icons'; import { Button, Typography, Tooltip } from 'antd'; import styled from 'styled-components'; import { useTranslation } from 'react-i18next'; +import { TFunction } from 'i18next'; import { getExecutionRequestStatusDisplayColor, getExecutionRequestStatusIcon, @@ -21,12 +22,11 @@ const StatusContainer = styled.div` `; const StatusButton = styled(Button)` - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; `; -export function TimeColumn(time: string) { - const { t } = useTranslation(); +export function TimeColumn(time: string, t: TFunction) { const date = time && new Date(time); const localTime = date && `${date.toLocaleDateString()} at ${date.toLocaleTimeString()}`; return {localTime || t('common.none')}; @@ -55,8 +55,7 @@ export function StatusColumn({ status, record, setFocusExecutionUrn }: StatusCol ); } -export function SourceColumn(source: string) { - const { t } = useTranslation(); +export function SourceColumn(source: string, t: TFunction) { return ( (source === MANUAL_INGESTION_SOURCE && t('ingest.manualExecution')) || (source === SCHEDULED_INGESTION_SOURCE && t('ingest.scheduledExecution')) || diff --git a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx index c16e1150e4981a..35c29f3e120595 100644 --- a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx +++ b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx @@ -45,7 +45,7 @@ export default function PolicyTypeForm({ labelAlign="right" label={{t('common.name')}} > - {t('nameForNewPolicy')} + {t('permissions.nameForNewPolicy')} }, + }} + /> + }, }} /> diff --git a/datahub-web-react/src/conf/locales/en/empty-message.json b/datahub-web-react/src/conf/locales/en/empty-message.json index 586f568b09c066..48527bf47b218b 100644 --- a/datahub-web-react/src/conf/locales/en/empty-message.json +++ b/datahub-web-react/src/conf/locales/en/empty-message.json @@ -1,4 +1,3 @@ - { "documentation": { "title": "No documentation yet", diff --git a/datahub-web-react/src/conf/locales/en/translation.json b/datahub-web-react/src/conf/locales/en/translation.json index 6d6fa815dd7ef9..1eaf654c6b92ac 100644 --- a/datahub-web-react/src/conf/locales/en/translation.json +++ b/datahub-web-react/src/conf/locales/en/translation.json @@ -708,6 +708,8 @@ "welcomeBack": "Welcome back" }, "ingest": { + "viewIngestedAssets": "View Ingested Assets", + "ingestionSource": "Ingestion Source", "aConnectionWasNotAbleToBeEstablishedWithSourceName": "A connection was not able to be established with {{sourceName}}.", "aConnectionWasSuccessfullyEstablishedWithSourceName": "A connection was successfully established with {{sourceName}}.", "advancedProvideCustomCLIVersionToUseForIngestion": "Advanced: Provide a custom CLI version to use for ingestion.", @@ -1381,6 +1383,7 @@ "policyAppliesToLabel": "Select the users & groups that this policy should apply to.", "policyAppliesToUserDescription": "Search for specific users that this policy should apply to, or select `All Users` to apply it to all users.", "policyBuilderSteps": { + "assignUserAndGroups": "Assign Users & Groups", "choosePolicyType": "Choose Policy Type", "configurePrivileges": "Configure Privileges" @@ -1393,7 +1396,8 @@ "successfullyDeactivatedPolicy": "Successfully deactivated policy.", "successfullyRemovedPolicy": "Successfully removed policy.", "successfullySavedPolicy": "Successfully saved policy.", - "typeOfPolicyDescription_component": "The Platform policy type allows you to assign top-level DataHub Platform privileges to users.These include managing users and groups, creating policies, viewing analytics dashboards and more.

The Metadata policy type allows you to assign metadata privileges to users. These include the ability to manipulate metadata like ownership, tags, documentation associated with Datasets, Charts, Dashboards, & more.", + "typeOfPolicyDescriptionPlatform_component": "The Platform policy type allows you to assign top-level DataHub Platform privileges to users.These include managing users and groups, creating policies, viewing analytics dashboards and more.

", + "typeOfPolicyDescriptionMetadata_component": "The Metadata policy type allows you to assign metadata privileges to users. These include the ability to manipulate metadata like ownership, tags, documentation associated with Datasets, Charts, Dashboards, & more.", "typeOfPolicyToCreate": "The type of policy you would like to create." }, "placeholder": { diff --git a/datahub-web-react/src/conf/locales/fr/empty-message.json b/datahub-web-react/src/conf/locales/fr/empty-message.json index 38b6063af23e10..39b26413fd9997 100644 --- a/datahub-web-react/src/conf/locales/fr/empty-message.json +++ b/datahub-web-react/src/conf/locales/fr/empty-message.json @@ -1,4 +1,3 @@ - { "documentation": { "title": "Aucune documentation pour le moment", diff --git a/datahub-web-react/src/conf/locales/fr/translation.json b/datahub-web-react/src/conf/locales/fr/translation.json index 2ce4e9197c42ff..d9959711ad8be2 100644 --- a/datahub-web-react/src/conf/locales/fr/translation.json +++ b/datahub-web-react/src/conf/locales/fr/translation.json @@ -708,6 +708,8 @@ "welcomeBack": "Bienvenue" }, "ingest": { + "viewIngestedAssets": "Voir les Assets ingérés", + "ingestionSource": "Source d'Ingestion", "aConnectionWasNotAbleToBeEstablishedWithSourceName": "Impossible d'établir une connexion avec {{sourceName}}.", "aConnectionWasSuccessfullyEstablishedWithSourceName": "Une connexion a été établie avec succès avec {{sourceName}}.", "advancedProvideCustomCLIVersionToUseForIngestion": "Avancé : Fournissez une version personnalisée de l'interface de ligne de commande (CLI) à utiliser pour l'ingestion.", @@ -1381,9 +1383,9 @@ "policyAppliesToLabel": "Choisissez les Utilisateurs et Groupes auxquel ce Droit s'appliquera.", "policyAppliesToUserDescription": "Cherchz des Utilisateurs spécifiques auxquels ce Droit doit s'appliquer ou sélectionnez TouT Utilisateurs pour l'appliquer à tous les utilisateurs.", "policyBuilderSteps": { - "assignUserAndGroups": "Assigners des Utilisateurs et des Groupes", - "choosePolicyType": "Choisir un Type de Droit", - "configurePrivileges": "Configurer les Privilèges" + "assignUserAndGroups": "Assigner Utilisateurs et Groupes", + "choosePolicyType": "Choisir Type de Droit", + "configurePrivileges": "Configurer Privilèges" }, "privilegesLabel": "Choisissez un ensemble de privilèges à accorder.", "resourceDescription": "Cherchez des ressources spécifiques auxquelles appliquer ce Droit. Si vous sélectionnez Aucun, le droit s'appliquera à toute les ressources du type sélectionné.", @@ -1393,7 +1395,8 @@ "successfullyDeactivatedPolicy": "Droit désactivé.", "successfullyRemovedPolicy": "Droit supprimé.", "successfullySavedPolicy": "Droit enregistré.", - "typeOfPolicyDescription_component": "Le Droit Plateforme vous permet d'attribuer des privilèges de niveau supérieur à la plateforme DataHub aux utilisateurs. Cela inclut la gestion des utilisateurs et des groupes, la création de politiques, la consultation des tableaux de bord d'analyse, et bien plus encore.

Le type de politique MetaData vous permet d'attribuer des privilèges de metadatas aux utilisateurs. Cela inclut la possibilité de manipuler des métadonnées telles que la propriété, les balises, la documentation associée aux jeux de données, aux graphiques, aux tableaux de bord, et bien plus encore.", + "typeOfPolicyDescriptionPlatform_component": "Le Droit Plateforme vous permet d'attribuer des privilèges de niveau supérieur à la plateforme DataHub aux utilisateurs. Cela inclut la gestion des utilisateurs et des groupes, la création de politiques, la consultation des tableaux de bord d'analyse, et bien plus encore.

", + "typeOfPolicyDescriptionMetadata_component": "Le Droit MetaData vous permet d'attribuer des privilèges de metadatas aux utilisateurs. Cela inclut la possibilité de manipuler des métadonnées telles que la propriété, les balises, la documentation associée aux jeux de données, aux graphiques, aux tableaux de bord, et bien plus encore.", "typeOfPolicyToCreate": "Le type de droit que vous voulez créer." }, "placeholder": { @@ -1418,7 +1421,7 @@ "searchWithName": "Rechercher {{name}}...", "selectAColumn": "Sélectionner une colonne", "shortLabelForLink": "Un libellé court pour ce lien", - "viewUsefulForDataAnalysts": "Cette Vue est utile pour les Data Analyste", + "viewUsefulForDataAnalysts": "Cette Vue est utile pour les Data Analystes", "yourPolicyNamePlaceholder": "Le nom de votre Droit" }, "post": { diff --git a/datahub-web-react/src/i18n.js b/datahub-web-react/src/i18n.js index 29afe651287c95..8d595674f25b6f 100644 --- a/datahub-web-react/src/i18n.js +++ b/datahub-web-react/src/i18n.js @@ -54,11 +54,6 @@ i18n .init({ fallbackLng: 'en', debug: true, - // ns: ['translation', 'empty-message', 'form', 'react-cron', 'theme'], - // backend: { - // loadPath: '/conf/locales/{{lng}}/{{ns}}.json', - // allowMultiLoading: true, - // }, resources, interpolation: { escapeValue: false, // not needed for react as it escapes by default