From c2a1cb51bc229d8731a9f4337d24ba67d3ccd854 Mon Sep 17 00:00:00 2001 From: ndespouy Date: Thu, 14 Sep 2023 16:44:51 +0400 Subject: [PATCH 1/9] i18n - Correction --- datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx index c16e1150e4981a..70b9dc0dc2fc4d 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')} Date: Fri, 15 Sep 2023 11:04:06 +0400 Subject: [PATCH 2/9] i18n - Policy type description separated into two --- .../src/app/permissions/policy/PolicyTypeForm.tsx | 14 ++++++++++---- .../src/conf/locales/en/translation.json | 3 ++- .../src/conf/locales/fr/translation.json | 5 +++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx index 70b9dc0dc2fc4d..5ab0a03d1c7f1f 100644 --- a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx +++ b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx @@ -69,10 +69,16 @@ export default function PolicyTypeForm({ }, - }} + {...{ + i18nKey: 'permissions.typeOfPolicyDescriptionPlatform_component', + components: { bold: }, + }} + /> + }, + }} /> diff --git a/datahub-web-react/src/conf/locales/en/translation.json b/datahub-web-react/src/conf/locales/en/translation.json index 6d6fa815dd7ef9..e8fdaa84e925ec 100644 --- a/datahub-web-react/src/conf/locales/en/translation.json +++ b/datahub-web-react/src/conf/locales/en/translation.json @@ -1393,7 +1393,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/translation.json b/datahub-web-react/src/conf/locales/fr/translation.json index 2ce4e9197c42ff..d7d0908903dbfa 100644 --- a/datahub-web-react/src/conf/locales/fr/translation.json +++ b/datahub-web-react/src/conf/locales/fr/translation.json @@ -1393,7 +1393,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 +1419,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": { From 70b3b68f519b9ea0f1b889188b05eea91e85b61f Mon Sep 17 00:00:00 2001 From: ndespouy Date: Fri, 15 Sep 2023 11:41:33 +0400 Subject: [PATCH 3/9] i18n - Policy type description separated into two --- .../AccessManagement/AccessManagement.tsx | 2 +- .../AccessManagerDescription.tsx | 4 +++- .../src/app/entity/tag/TagProfile.tsx | 4 +--- .../src/app/identity/user/SelectRole.tsx | 2 +- .../app/permissions/policy/PolicyTypeForm.tsx | 16 ++++++++-------- .../src/conf/locales/fr/translation.json | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) 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/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/permissions/policy/PolicyTypeForm.tsx b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx index 5ab0a03d1c7f1f..35c29f3e120595 100644 --- a/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx +++ b/datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx @@ -69,16 +69,16 @@ export default function PolicyTypeForm({ }, - }} + {...{ + i18nKey: 'permissions.typeOfPolicyDescriptionPlatform_component', + components: { bold: }, + }} /> }, - }} + {...{ + i18nKey: 'permissions.typeOfPolicyDescriptionMetadata_component', + components: { bold: }, + }} /> diff --git a/datahub-web-react/src/conf/locales/fr/translation.json b/datahub-web-react/src/conf/locales/fr/translation.json index d7d0908903dbfa..ab45293a793261 100644 --- a/datahub-web-react/src/conf/locales/fr/translation.json +++ b/datahub-web-react/src/conf/locales/fr/translation.json @@ -1381,9 +1381,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é.", From 3524c7f4df6eeb99c775f592114bba5ea9406b42 Mon Sep 17 00:00:00 2001 From: ndespouy Date: Mon, 18 Sep 2023 21:07:30 +0400 Subject: [PATCH 4/9] Correction i18n --- .../app/ingest/source/IngestionSourceTable.tsx | 4 ++-- .../ingest/source/IngestionSourceTableColumns.tsx | 15 ++++++--------- .../builder/IngestionSourceBuilderModal.tsx | 2 +- .../src/conf/locales/en/translation.json | 2 ++ .../src/conf/locales/fr/translation.json | 1 + 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/datahub-web-react/src/app/ingest/source/IngestionSourceTable.tsx b/datahub-web-react/src/app/ingest/source/IngestionSourceTable.tsx index 57b9272e09729f..ca5c248e2519df 100644 --- a/datahub-web-react/src/app/ingest/source/IngestionSourceTable.tsx +++ b/datahub-web-react/src/app/ingest/source/IngestionSourceTable.tsx @@ -64,7 +64,7 @@ function IngestionSourceTable({ title: t('common.schedule'), dataIndex: 'schedule', key: 'schedule', - render: ScheduleColumn, + render: (schedule: any, record: any) => 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..0f37d39f30dd7c 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,7 @@ 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/conf/locales/en/translation.json b/datahub-web-react/src/conf/locales/en/translation.json index e8fdaa84e925ec..545fa0e3f1671f 100644 --- a/datahub-web-react/src/conf/locales/en/translation.json +++ b/datahub-web-react/src/conf/locales/en/translation.json @@ -708,6 +708,7 @@ "welcomeBack": "Welcome back" }, "ingest": { + "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 +1382,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" diff --git a/datahub-web-react/src/conf/locales/fr/translation.json b/datahub-web-react/src/conf/locales/fr/translation.json index ab45293a793261..3603bb3c7cda2e 100644 --- a/datahub-web-react/src/conf/locales/fr/translation.json +++ b/datahub-web-react/src/conf/locales/fr/translation.json @@ -708,6 +708,7 @@ "welcomeBack": "Bienvenue" }, "ingest": { + "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.", From cf6dd91e85622d3c32f55a94610b1f60cf16510d Mon Sep 17 00:00:00 2001 From: ndespouy Date: Tue, 19 Sep 2023 13:48:04 +0400 Subject: [PATCH 5/9] Clean trad --- .../app/ingest/source/builder/IngestionSourceBuilderModal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0f37d39f30dd7c..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 ? t('crud.editWithName', { name: t('ingest.ingestionSource')}) : t('crud.createWithName', { name: t('ingest.ingestionSource')}); + 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; From 7af140bbde834ac9ffec3cb856d41d87ef6126de Mon Sep 17 00:00:00 2001 From: ndespouy Date: Tue, 19 Sep 2023 14:24:44 +0400 Subject: [PATCH 6/9] Clean trad --- .../source/executions/IngestionExecutionTable.tsx | 8 ++++---- .../executions/IngestionExecutionTableColumns.tsx | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) 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')) || From 088520ceb5558fd2b68d9bf7ce0e7d39dd0a9535 Mon Sep 17 00:00:00 2001 From: ndespouy Date: Wed, 20 Sep 2023 10:51:04 +0400 Subject: [PATCH 7/9] Corrections --- .../src/app/identity/user/AssignRoleConfirmation.tsx | 9 ++++++++- .../src/app/ingest/source/IngestedAssets.tsx | 2 +- datahub-web-react/src/conf/locales/en/translation.json | 1 + datahub-web-react/src/conf/locales/fr/translation.json | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/datahub-web-react/src/app/identity/user/AssignRoleConfirmation.tsx b/datahub-web-react/src/app/identity/user/AssignRoleConfirmation.tsx index 37f7f4eb59ffc0..86915b93b01f37 100644 --- a/datahub-web-react/src/app/identity/user/AssignRoleConfirmation.tsx +++ b/datahub-web-react/src/app/identity/user/AssignRoleConfirmation.tsx @@ -74,5 +74,12 @@ export default function AssignRoleConfirmation({ }) : t('user.removeRoleTitle', { username }); - return ; + return ; } 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 && ( Date: Thu, 21 Sep 2023 14:22:40 +0400 Subject: [PATCH 8/9] Correction --- datahub-web-react/src/app/glossary/GlossarySearch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)}> Date: Fri, 22 Sep 2023 13:39:20 +0400 Subject: [PATCH 9/9] Correction i18n --- .../profile/sidebar/AboutSection/EmptyContentSection.tsx | 4 ++-- .../profile/sidebar/DataProduct/DataProductSection.tsx | 2 +- .../profile/sidebar/Domain/SidebarDomainSection.tsx | 2 +- datahub-web-react/src/conf/locales/en/empty-message.json | 1 - datahub-web-react/src/conf/locales/fr/empty-message.json | 1 - datahub-web-react/src/i18n.js | 9 ++------- 6 files changed, 6 insertions(+), 13 deletions(-) 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/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/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/i18n.js b/datahub-web-react/src/i18n.js index 0da6bb736d5e5f..8d595674f25b6f 100644 --- a/datahub-web-react/src/i18n.js +++ b/datahub-web-react/src/i18n.js @@ -23,14 +23,14 @@ import * as frTheme from './conf/locales/fr/theme.json'; const resources = { en: { translation: enTranslation.default, - 'empty-Message': enEmptyMessage.default, + 'empty-message': enEmptyMessage.default, form: enForm.default, 'react-cron': enReactCron.default, theme: enTheme.default, }, fr: { translation: frTranslation.default, - 'empty-Message': frEmptyMessage.default, + 'empty-message': frEmptyMessage.default, form: frForm.default, 'react-cron': frReactCron.default, theme: frTheme.default, @@ -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