Skip to content

Commit

Permalink
v11 - correction i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
NaicheD committed Sep 29, 2023
1 parent 71dfc14 commit 5469077
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 76 deletions.
27 changes: 0 additions & 27 deletions datahub-frontend/app/config/ConfigurationProvider.java

This file was deleted.

16 changes: 12 additions & 4 deletions datahub-web-react/src/app/domain/CreateDomainModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ export default function CreateDomainModal({ onClose, onCreate }: Props) {
}}
>
{isNestedDomainsEnabled && (
<FormItemWithMargin label={<FormItemLabel>{t('common.parent')} ({t('common.optional')})</FormItemLabel>}>
<FormItemWithMargin
label={
<FormItemLabel>
{t('common.parent')} ({t('common.optional')})
</FormItemLabel>
}
>
<DomainParentSelect
selectedParentUrn={selectedParentUrn}
setSelectedParentUrn={setSelectedParentUrn}
Expand Down Expand Up @@ -211,9 +217,11 @@ export default function CreateDomainModal({ onClose, onCreate }: Props) {
<Collapse ghost>
<Collapse.Panel header={<AdvancedLabel>{t('common.advancedOptions')}</AdvancedLabel>} key="1">
<FormItemWithMargin
label={<Typography.Text strong>
{entityRegistry.getEntityNameTrans(EntityType.Domain, t)} {t('common.id')}
</Typography.Text>}
label={
<Typography.Text strong>
{entityRegistry.getEntityNameTrans(EntityType.Domain, t)} {t('common.id')}
</Typography.Text>
}
help={t('domain.domainIdDescription')}
>
<FormItemNoMargin
Expand Down
6 changes: 4 additions & 2 deletions datahub-web-react/src/app/domain/ManageDomainsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export const ManageDomainsPage = () => {
<DomainsContext.Provider value={{ entityData, setEntityData, parentDomainsToUpdate, setParentDomainsToUpdate }}>
<PageContainer>
<PageHeaderContainer>
<PageTitle level={3}>{t('common.domains')}</PageTitle>
<Typography.Paragraph type="secondary">{t('domain.domainManagementDescription')}</Typography.Paragraph>
<PageTitle level={3}>{t('common.domains')}</PageTitle>
<Typography.Paragraph type="secondary">
{t('domain.domainManagementDescription')}
</Typography.Paragraph>
</PageHeaderContainer>
<ListContainer>
<DomainsList />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function EntityDropdown(props: Props) {
<MenuItem
onClick={() => {
navigator.clipboard.writeText(pageUrl);
message.info(`${t('copy.copiedUrl')}!`, 1.2);
message.info(t('copy.copiedUrl'), 1.2);
}}
>
<LinkOutlined /> &nbsp; {t('common.copy')} URL
Expand Down Expand Up @@ -238,12 +238,14 @@ function EntityDropdown(props: Props) {
>
<Tooltip
title={
// entity.cantDeleteWithSubDomainEntityWithName & entity.cantDeleteWithChildEntityWithName
shouldDisplayChildDeletionWarning(entityType, entityData, me.platformPrivileges)
? isDomainEntity ? t('entity.cantDeleteWithSubDomainEntityWithName', {
name: entityRegistry.getEntityNameTrans(entityType, t),
}) : t('entity.cantDeleteWithChildEntityWithName', {
name: entityRegistry.getEntityNameTrans(entityType, t),
})
? t(
`entity.cantDeleteWith${
isDomainEntity ? 'SubDomain' : 'Child'
}EntityWithName'`,
{ name: entityRegistry.getEntityNameTrans(entityType, t) },
)
: undefined
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react';
import { Select } from 'antd';
import { EntityType, GlossaryNode, SearchResult } from '../../../../types.generated';
import { useTranslation } from 'react-i18next';
import { useGetSearchResultsLazyQuery } from '../../../../graphql/search.generated';
import { EntityType, GlossaryNode } from '../../../../types.generated';
import { EntityType, GlossaryNode, SearchResult } from '../../../../types.generated';
import { useEntityRegistry } from '../../../useEntityRegistry';
import { useEntityData } from '../EntityContext';
import ClickOutside from '../../../shared/ClickOutside';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const SetDomainModal = ({ urns, onCloseModal, refetch, defaultValue, onOk
showSearch
mode="multiple"
defaultActiveFirstOption={false}
placeholder={t('search;searchForWithName', { name: t('common.domains') })}
placeholder={t('search;searchForWithName', { name: t('common.domains') })}
onSelect={(domainUrn: any) => onSelectDomain(domainUrn)}
onDeselect={onDeselectDomain}
onSearch={(value: string) => {
Expand Down
18 changes: 10 additions & 8 deletions datahub-web-react/src/app/identity/user/AssignRoleConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ export default function AssignRoleConfirmation({
})
: t('user.removeRoleTitle', { username });

return <Popconfirm
title={assignRoleText}
visible={visible}
onConfirm={batchAssignRole}
onCancel={onClose}
okText={t('common.ok')}
cancelText={t('common.cancel')}
/>;
return (
<Popconfirm
title={assignRoleText}
visible={visible}
onConfirm={batchAssignRole}
onCancel={onClose}
okText={t('common.ok')}
cancelText={t('common.cancel')}
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const IngestionSourceBuilderModal = ({ initialState, visible, onSubmit, o
const { t } = useTranslation();
const isEditing = initialState !== undefined;
const titleText = isEditing
? t('crud.editWithName', { name: t('ingest.ingestionSource') })
: t('crud.createWithName', { name: t('ingest.ingestionSource') });
? t('crud.editWithName', { name: t('ingest.ingestionSource') })
: t('crud.createWithName', { name: t('ingest.ingestionSource') });
const initialStep = isEditing
? IngestionSourceBuilderStep.DEFINE_RECIPE
: IngestionSourceBuilderStep.SELECT_TEMPLATE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,19 @@ export default function PolicyPrivilegeForm({
</Form.Item>
)}
{showResourceFilterInput && (
<Form.Item label={<Typography.Text strong>{t('crud.selectWithName', { name: t('common.domain') })}</Typography.Text>}>
<Form.Item
label={
<Typography.Text strong>
{t('crud.selectWithName', { name: t('common.domain') })}
</Typography.Text>
}
>
<Typography.Paragraph>
<Trans
{...{
i18nKey: 'permissions.domainDescription',
components: { bold: <b /> },
}}
{...{
i18nKey: 'permissions.domainDescription',
components: { bold: <b /> },
}}
/>
</Typography.Paragraph>
<ClickOutside onClickOutside={handleCLickOutside}>
Expand Down
6 changes: 4 additions & 2 deletions datahub-web-react/src/app/search/filters/AdvancedFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { FacetFilterInput, FacetMetadata } from '../../../types.generated';
import { useUserContext } from '../../context/useUserContext';
import { ANTD_GRAY } from '../../entity/shared/constants';
Expand Down Expand Up @@ -45,6 +46,7 @@ export default function AdvancedFilters({
const { filterField, setFilterField, onFilterFieldSelect, onSelectValueFromModal } = useAdvancedSearchSelectFilters(
{ selectedFilters: activeFilters, onFilterSelect: onChangeFilters },
);
const { t } = useTranslation();
const userContext = useUserContext();
const selectedViewUrn = userContext?.localState?.selectedViewUrn;
const showSaveViewButton = activeFilters?.length > 0 && selectedViewUrn === undefined;
Expand All @@ -54,7 +56,7 @@ export default function AdvancedFilters({
<>
{activeFilters?.length >= 2 && (
<AnyAllToggle>
Show results that match{' '}
{`${t('filter.showResultsThatMatch')} `}
<AdvancedSearchFilterOverallUnionTypeSelect
unionType={unionType}
onUpdate={(newValue) => onChangeUnionType(newValue)}
Expand Down Expand Up @@ -97,7 +99,7 @@ export default function AdvancedFilters({
<FilterButtonsWrapper>
{showSaveViewButton && <SaveViewButton activeFilters={activeFilters} unionType={unionType} />}
<TextButton disabled={onlyShowAdvancedFilters} type="text" onClick={showBasicFilters} marginTop={0}>
Basic Filters
{t('filter.basicFilters')}
</TextButton>
</FilterButtonsWrapper>
</FlexSpacer>
Expand Down
6 changes: 4 additions & 2 deletions datahub-web-react/src/app/search/filters/BasicFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Divider } from 'antd';
import React from 'react';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { FacetFilterInput, FacetMetadata } from '../../../types.generated';
import { useUserContext } from '../../context/useUserContext';
import {
Expand Down Expand Up @@ -70,6 +71,7 @@ export default function BasicFilters({
onClearFilters,
showAdvancedFilters,
}: Props) {
const { t } = useTranslation();
const userContext = useUserContext();
const selectedViewUrn = userContext?.localState?.selectedViewUrn;
const showSaveViewButton = activeFilters?.length > 0 && selectedViewUrn === undefined;
Expand Down Expand Up @@ -121,7 +123,7 @@ export default function BasicFilters({
onClick={showAdvancedFilters}
marginTop={0}
>
Advanced Filters
{t('common.advancedFilters')}
</TextButton>
</FilterButtonsWrapper>
</FlexSpacer>
Expand All @@ -141,7 +143,7 @@ export default function BasicFilters({
))}
</FlexWrapper>
<TextButton type="text" onClick={onClearFilters} height={14} data-testid="clear-all-filters">
clear all
{t('common.clearAll')}
</TextButton>
</FlexSpacer>
</>
Expand Down
6 changes: 5 additions & 1 deletion datahub-web-react/src/conf/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"onAContainedChart": "on a contained Chart"
},
"common": {
"clearAll": "Clear All",
"phone": "Phone",
"team": "Team",
"about": "About",
Expand All @@ -101,6 +102,7 @@
"actual": "Actual",
"add": "Add",
"advanced": "Advanced",
"advancedOptions": "Advanced Options",
"all": "All",
"analytics": "Analytics",
"announcement": "Announcement",
Expand Down Expand Up @@ -494,6 +496,7 @@
"allDataInputsAreHealthy": "All data inputs are healthy",
"authorNameWithLink_component": "Added {{timestamp}} by <linkComponent>{{authorName}}</linkComponent>",
"cantDeleteWithChildEntityWithName": "Can't delete {{name}} with child entities.",
"cantDeleteWithSubDomainEntityWithName": "Can't delete {{name}} with sub-domain entities.",
"cantFindEntityPageContent": "Sorry, we are unable to find this entity in DataHub",
"deleteAssetMessageConfirmation": "Are you sure you want to mark these assets as deleted? This will hide the assets from future DataHub searches. If the assets are re-ingested from an external data platform, they will be restored.",
"editor": {
Expand Down Expand Up @@ -590,6 +593,8 @@
"unsupportedTestResultType": "Unsupported Test Result Type {{result}} provided."
},
"filter": {
"basicFilters": "Basic Filters",
"advancedFilters": "Advanced Filters",
"allFilters": "All filters",
"anyFilter": "Any filter",
"contains": {
Expand Down Expand Up @@ -661,7 +666,6 @@
"fillInYourName": "Please fill in your name",
"fillInYourPassword": "Please fill in your password",
"fillInYourTitle": "Please fill in your title",
"giveYourNewDomainAName": "Give your new Domain a name",
"labelRequired": "A URL is required.",
"ownershipTypeNameRequired": "Please input a name for the ownership type",
"passwordIsFewerThan8Characters": "Your password is fewer than 8 characters",
Expand Down
6 changes: 5 additions & 1 deletion datahub-web-react/src/conf/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"onAContainedChart": "sur un graphique contenu"
},
"common": {
"clearAll": "Enlever Tout",
"phone": "Téléphone",
"team": "Equipe",
"about": "A propos",
Expand All @@ -101,6 +102,7 @@
"actual": "Actuel",
"add": "Ajouter",
"advanced": "Avancé",
"advancedOptions": "Options Avancées",
"all": "Tout",
"analytics": "Analytique",
"announcement": "Annonce",
Expand Down Expand Up @@ -494,6 +496,7 @@
"allDataInputsAreHealthy": "Tout les inputs de donnée sont sains",
"authorNameWithLink_component": "Ajouté le {{timestamp}} par <linkComponent>{{authorName}}</linkComponent>",
"cantDeleteWithChildEntityWithName": "Impossible de supprimer {{name}} qui a des entités enfants.",
"cantDeleteWithSubDomainEntityWithName": "Impossible de supprimer {{name}} qui a des entités sous-domaine.",
"cantFindEntityPageContent": "Désolé, impossible de trouver cette entité dans le DataHub",
"deleteAssetMessageConfirmation": "Etes-vous sûr(e) de vouloir marquer ces assets comme supprimées ? Elles seront cachées dans les futures recherches sur DataHub. Si l'asset est ingéré de nouveau depuis une plateforme extérieure, elle sera restorée.",
"editor": {
Expand Down Expand Up @@ -590,6 +593,8 @@
"unsupportedTestResultType": "Type de résultat de test {{result}} inconnu."
},
"filter": {
"basicFilters": "Basic Filters",
"advancedFilters": "Filtres Avancés",
"allFilters": "Tous les filtres",
"anyFilter": "N'importe quel filtre",
"contains": {
Expand Down Expand Up @@ -661,7 +666,6 @@
"fillInYourName": "Veuillez remplir votre nom.",
"fillInYourPassword": "Veuillez remplir votre mot de passe.",
"fillInYourTitle": "Veuillez remplir votre titre.",
"giveYourNewDomainAName": "Donnez un nom à votre nouveau Domaine.",
"labelRequired": "Un libellé est requis.",
"ownershipTypeNameRequired": "Veuillez saisir un nom pour le type de propriété.",
"passwordIsFewerThan8Characters": "Votre mot de passe comporte moins de 8 caractères.",
Expand Down
12 changes: 0 additions & 12 deletions datahub-web-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18111,18 +18111,6 @@ string.prototype.matchall@^4.0.7:
regexp.prototype.flags "^1.4.3"
side-channel "^1.0.4"

string.prototype.replaceall@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/string.prototype.replaceall/-/string.prototype.replaceall-1.0.7.tgz#6cf36b20bcb12d55653e1119ddf5bc1d6363103d"
integrity sha512-xB2WV2GlSCSJT5dMGdhdH1noMPiAB91guiepwTYyWY9/0Vq/TZ7RPmnOSUGAEvry08QIK7EMr28aAii+9jC6kw==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.4"
es-abstract "^1.20.4"
get-intrinsic "^1.1.3"
has-symbols "^1.0.3"
is-regex "^1.1.4"

string.prototype.trimend@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80"
Expand Down

0 comments on commit 5469077

Please sign in to comment.