ui: refactor localization file (#10411)

* ui: refactor localization file

* addressing comments

* fixed failing unit test
This commit is contained in:
Shailesh Parmar 2023-03-03 16:14:55 +05:30 committed by GitHub
parent ddf39d8d6a
commit 50c54d944d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 75 additions and 49 deletions

View File

@ -213,7 +213,9 @@ const DashboardVersion: FC<DashboardVersionProp> = ({
const tableColumn: ColumnsType<EntityReference> = useMemo(
() => [
{
title: t('label.chart-name'),
title: t('label.chart-entity', {
entity: t('label.name'),
}),
dataIndex: 'name',
key: 'name',
render: (text, record) => (
@ -231,7 +233,9 @@ const DashboardVersion: FC<DashboardVersionProp> = ({
),
},
{
title: t('label.chart-type'),
title: t('label.chart-entity', {
entity: t('label.type'),
}),
dataIndex: 'type',
key: 'type',
},

View File

@ -296,7 +296,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
position: 7,
},
{
name: t('label.dbt-uppercase'),
name: t('label.dbt-lowercase'),
icon: {
alt: 'dbt-model',
name: 'dbtmodel-light-grey',

View File

@ -108,7 +108,7 @@ const MlModelVersion: FC<MlModelVersionProp> = ({
{
key: 'Target',
value: target
? t('label.entity-with-value', {
? t('label.entity-hyphen-value', {
entity: t('label.target'),
value: target,
})
@ -119,7 +119,7 @@ const MlModelVersion: FC<MlModelVersionProp> = ({
{
key: 'Server',
value: server
? t('label.entity-with-value', {
? t('label.entity-hyphen-value', {
entity: t('label.server'),
value: server,
})
@ -130,7 +130,7 @@ const MlModelVersion: FC<MlModelVersionProp> = ({
{
key: 'Dashboard',
value: dashboard
? t('label.entity-with-value', {
? t('label.entity-hyphen-value', {
entity: t('label.dashboard'),
value: dashboard,
})

View File

@ -142,9 +142,7 @@ describe('Test ProfilerDashboardPage component', () => {
const EntityPageInfo = await screen.findByText('EntityPageInfo component');
const ProfilerTab = screen.queryByText('ProfilerTab component');
const DataQualityTab = await screen.findByText('DataQualityTab component');
const deletedTestSwitch = await screen.findByText(
'label.deleted-test-plural'
);
const deletedTestSwitch = await screen.findByText('label.deleted-entity');
const statusDropdown = await screen.findByText('label.status');
expect(profilerSwitch).toBeInTheDocument();

View File

@ -515,7 +515,9 @@ const ProfilerDashboard: React.FC<ProfilerDashboardProps> = ({
<>
<Form.Item
className="m-0 "
label={t('label.deleted-test-plural')}>
label={t('label.deleted-entity', {
entity: t('label.test-plural'),
})}>
<Switch
checked={showDeletedTest}
onClick={handleDeletedTestCaseClick}

View File

@ -164,7 +164,9 @@ const SearchDropdown: FC<SearchDropdownProps> = ({
data-testid="clear-button"
type="link"
onClick={handleClear}>
{t('label.clear-all')}
{t('label.clear-entity', {
entity: t('label.all'),
})}
</Button>
</>
)}

View File

@ -665,9 +665,11 @@ const TeamDetailsV1 = ({
<Typography.Text
className="font-medium"
data-testid="deleted-menu-item-label">
{t('label.deleted-team-action', {
action: showDeletedTeam ? t('label.hide') : t('label.show'),
})}
{t(
showDeletedTeam
? 'label.hide-deleted-team'
: 'label.show-deleted-team'
)}
</Typography.Text>
</Col>

View File

@ -73,7 +73,11 @@ const TestCasesTab = ({
testCasePageHandler={testCasePageHandler}>
<>
<Col className="flex justify-end items-center" span={24}>
<span className="m-r-xs">{t('label.deleted-test-plural')}</span>
<span className="m-r-xs">
{t('label.deleted-entity', {
entity: t('label.test-plural'),
})}
</span>
<Switch checked={deleted} onClick={handleDeletedTestCaseClick} />
</Col>
<Col span={24}>

View File

@ -190,7 +190,11 @@ const UserListV1: FC<UserListV1Props> = ({
size="small"
onClick={onShowDeletedUserChange}
/>
<span className="tw-ml-2">{t('label.deleted-user-plural')}</span>
<span className="tw-ml-2">
{t('label.deleted-entity', {
entity: t('label.user-plural'),
})}
</span>
</span>
</Col>
<Col span={24}>
@ -232,7 +236,11 @@ const UserListV1: FC<UserListV1Props> = ({
checked={showDeletedUser}
onClick={onShowDeletedUserChange}
/>
<span className="tw-ml-2">{t('label.deleted-user-plural')}</span>
<span className="tw-ml-2">
{t('label.deleted-entity', {
entity: t('label.user-plural'),
})}
</span>
</span>
<Tooltip
title={

View File

@ -387,7 +387,7 @@ const Users = ({
<Typography.Text
className="text-primary text-xs cursor-pointer"
onClick={() => setIsChangePassword(true)}>
{t('label.change-password')}
{t('label.change-entity', { entity: t('label.password-lowercase') })}
</Typography.Text>
<ChangePasswordForm

View File

@ -156,7 +156,7 @@ const mockOnChange = jest.fn();
const mockState = {
dbtConfigSource: '',
dbtConfigSourceType: DBT_SOURCES.local,
ingestionName: i18n.t('label.dbt-uppercase'),
ingestionName: i18n.t('label.dbt-lowercase'),
gcsConfigType: GCS_CONFIG.GCSValues,
} as unknown as AddIngestionState;

View File

@ -61,7 +61,7 @@ const ErrorPlaceHolder = ({
<>
<Paragraph style={{ marginBottom: '4px' }}>
{' '}
{t('label.adding-new-entity-is-easy-just-give-it-a-spin', {
{t('message.adding-new-entity-is-easy-just-give-it-a-spin', {
entity: heading,
})}
</Paragraph>
@ -100,7 +100,7 @@ const ErrorPlaceHolder = ({
{t('message.no-data-available')}
</Typography.Text>
<Typography.Text className="tw-text-sm">
{t('label.adding-new-entity-is-easy-just-give-it-a-spin', {
{t('message.adding-new-entity-is-easy-just-give-it-a-spin', {
entity: heading,
})}
</Typography.Text>

View File

@ -108,7 +108,9 @@ const FacetFilter: React.FC<FacetFilterProps> = ({
disabled={isEmpty(filters)}
type="link"
onClick={() => onClearFilter({})}>
{t('label.clear-all')}
{t('label.clear-entity', {
entity: t('label.all'),
})}
</Button>
</div>
<hr className="m-y-xs" />

View File

@ -285,7 +285,12 @@ export const codeMirrorOption = {
export const STEPS_FOR_ADD_TEST_CASE: Array<StepperStepType> = [
{ name: t('label.select-add-test-suite'), step: 1 },
{ name: t('label.configure-test-case'), step: 2 },
{
name: t('label.configure-entity', {
entity: t('label.test-case-lowercase'),
}),
step: 2,
},
];
export const SUPPORTED_PARTITION_TYPE = [

View File

@ -168,7 +168,7 @@ export const addDBTIngestionGuide = [
{
step: 5,
title: i18n.t('label.entity-ingestion-added-successfully', {
entity: i18n.t('label.dbt-uppercase'),
entity: i18n.t('label.dbt-lowercase'),
}),
description: i18n.t(
'message.ingestion-pipeline-name-successfully-deployed-entity',

View File

@ -26,7 +26,6 @@
"added-lowercase": "added",
"added-yet-lowercase": "added yet.",
"adding-new-classification": "Adding New Classification",
"adding-new-entity-is-easy-just-give-it-a-spin": "Adding a new {{entity}} is easy, just give it a spin!",
"adding-new-tag": "Adding new tag on {{categoryName}}",
"address": "Address",
"admin": "Admin",
@ -83,23 +82,19 @@
"bot-lowercase": "bot",
"bot-plural": "Bots",
"broker-plural": "Brokers",
"browse-csv-file": "Browse csv file",
"browse-csv-file": "Browse CSV file",
"ca-certs": "CA Certs",
"cancel": "Cancel",
"change-entity": "Change {{entity}}",
"change-password": "Change password",
"chart": "Chart",
"chart-entity": "Chart {{entity}}",
"chart-name": "Chart Name",
"chart-plural": "Charts",
"chart-type": "Chart Type",
"check-status": "Check status",
"claim-ownership": "Claim Ownership",
"classification": "Classification",
"classification-lowercase": "classification",
"classification-plural": "Classifications",
"clean-up-policy-plural-lowercase": "clean-up policies",
"clear-all": "Clear All",
"clear-entity": "Clear {{entity}}",
"click-here": "Click here",
"client-email": "Client Email",
@ -114,11 +109,8 @@
"cloud-config-source": "Cloud Config Source",
"collapse-all": "Collapse All",
"column": "Column",
"column-details": "Column Details",
"column-entity": "Column {{entity}}",
"column-plural": "Columns",
"column-type": "Column type",
"columns-plural": "Columns",
"comment-lowercase": "comment",
"completed": "Completed",
"completed-entity": "Completed {{entity}}",
@ -127,8 +119,6 @@
"configure-a-service": "Configure a Service",
"configure-dbt-model": "Configure dbt Model",
"configure-entity": "Configure {{entity}}",
"configure-glossary-term": "Configure Glossary Term",
"configure-test-case": "Configure test case",
"confirm": "Confirm",
"confirm-lowercase": "confirm",
"confirm-new-password": "Confirm New Password",
@ -204,13 +194,12 @@
"dbt-cloud-project-id": "dbt Cloud Project Id",
"dbt-cloud-url": "dbt Cloud URL",
"dbt-configuration-source": "dbt Configuration Source",
"dbt-ingestion": "DBT Ingestion",
"dbt-ingestion": "dbt Ingestion",
"dbt-lowercase": "dbt",
"dbt-object-prefix": "dbt Object Prefix",
"dbt-run-result-file-path": "dbt Run Results File Path",
"dbt-run-result-http-path": "dbt Run Results HTTP Path",
"dbt-source": "DBT Source",
"dbt-uppercase": "DBT",
"dbt-source": "dbt Source",
"deactivated": "Deactivated",
"december": "December",
"delete": "Delete",
@ -221,10 +210,6 @@
"deleted": "Deleted",
"deleted-entity": "Deleted {{entity}}",
"deleted-lowercase": "deleted",
"deleted-team-action": "{{action}} Deleted Team",
"deleted-test-plural": "Deleted Tests",
"deleted-tests": "Deleted Tests",
"deleted-user-plural": "Deleted Users",
"deleting-lowercase": "deleting",
"deploy": "Deploy",
"deployed": "Deployed",
@ -279,13 +264,13 @@
"enter-type-password": "Enter {{type}} Password",
"entity-count": "{{entity}} Count",
"entity-does-not-have-followers": "{{entityName}} doesn't have any followers yet",
"entity-hyphen-value": "{{entity}} - {{value}}",
"entity-index": "{{entity}} index",
"entity-ingestion-added-successfully": "{{entity}} Ingestion Added Successfully",
"entity-name": "{{entity}} Name",
"entity-plural": "Entities",
"entity-proportion": "{{entity}} Proportion",
"entity-service": "{{entity}} Service",
"entity-with-value": "{{entity}} - {{value}}",
"event-publisher-plural": "Event Publishers",
"event-type": "Event Type",
"every": "Every",
@ -360,6 +345,7 @@
"has-been-action-type-lowercase": "has been {{actionType}}",
"here-lowercase": "here",
"hide": "Hide",
"hide-deleted-team": "Hide Deleted Team",
"home": "Home",
"hour": "Hour",
"http-config-source": "HTTP Config Source",
@ -692,6 +678,7 @@
"shift": "Shift",
"show": "Show",
"show-deleted": "Show Deleted",
"show-deleted-team": "Show Deleted Team",
"show-or-hide-advanced-config": "{{showAdv}} Advanced Config",
"sign-in-with-sso": "Sign in with {{sso}}",
"slack": "Slack",
@ -754,6 +741,7 @@
"term-plural": "Terms",
"test": "Test",
"test-case": "Test case",
"test-case-lowercase": "test case",
"test-case-plural": "Test Cases",
"test-connection": "Test Connection",
"test-entity": "Test {{entity}}",
@ -863,6 +851,7 @@
"add-policy-message": "Policies are assigned to teams. In OpenMetadata, a policy is a collection of rules, which define access based on certain conditions. We support rich SpEL (Spring Expression Language) based conditions. All the operations supported by an entity are published. Use these fine grained operations to define the conditional rules for each policy. Create well-defined policies based on conditional rules to build rich access control roles.",
"add-role-message": "Roles are assigned to Users. In OpenMetadata, Roles are a collection of Policies. Each Role must have at least one policy attached to it. A Role supports multiple policies with a one to many relationship. Ensure that the necessary policies are created before creating a new role. Build rich access control roles with well-defined policies based on conditional rules.",
"add-service-connection": "Start by adding a service connection to ingest data into OpenMetadata.",
"adding-new-entity-is-easy-just-give-it-a-spin": "Adding a new {{entity}} is easy, just give it a spin!",
"adding-new-tag": "Adding new tag on {{categoryName}}",
"adding-new-user-to-entity": "Adding new users to {{entity}}",
"admin-only-action": "Only an Admin can perform this action.",

View File

@ -115,7 +115,9 @@ const RequestDescription = () => {
return (
<div data-testid="column-details">
<p className="tw-font-semibold">{t('label.column-details')}</p>
<p className="tw-font-semibold">
{t('label.column-entity', { entity: t('label.detail-plural') })}
</p>
<p>
<span className="tw-text-grey-muted">{`${t('label.type')}:`}</span>{' '}
<span>{columnObject.dataTypeDisplay}</span>

View File

@ -107,7 +107,9 @@ const RequestTag = () => {
return (
<div data-testid="column-details">
<p className="tw-font-semibold">{t('label.column-details')}</p>
<p className="tw-font-semibold">
{t('label.column-entity', { entity: t('label.detail-plural') })}
</p>
<p>
<span className="tw-text-grey-muted">{`${t('label.type')}:`}</span>{' '}
<span>{columnObject.dataTypeDisplay}</span>

View File

@ -113,7 +113,9 @@ const UpdateDescription = () => {
if (!isNil(field) && !isNil(value) && field === EntityField.COLUMNS) {
return (
<div data-testid="column-details">
<p className="tw-font-semibold">{t('label.column-details')}</p>
<p className="tw-font-semibold">
{t('label.column-entity', { entity: t('label.detail-plural') })}
</p>
<p>
<span className="tw-text-grey-muted">{`${t('label.type')}:`}</span>{' '}
<span>{columnObject.dataTypeDisplay}</span>

View File

@ -108,7 +108,9 @@ const UpdateTag = () => {
if (!isNil(field) && !isNil(value) && field === EntityField.COLUMNS) {
return (
<div data-testid="column-details">
<p className="tw-font-semibold">{t('label.column-details')}</p>
<p className="tw-font-semibold">
{t('label.column-entity', { entity: t('label.detail-plural') })}
</p>
<p>
<span className="tw-text-grey-muted">{`${t('label.type')}:`}</span>{' '}
<span>{columnObject.dataTypeDisplay}</span>

View File

@ -27,7 +27,9 @@ const ColumnDetail = ({ column }: { column: Column }) => {
<span
className="tw-text-grey-muted tw-flex-none tw-mr-1"
data-testid="column-type">
{`${t('label.column-type')}:`}
{`${t('label.column-entity', {
entity: t('label.type-lowercase'),
})}:`}
</span>
<Typography.Paragraph
className="ant-typography-ellipsis-custom"

View File

@ -52,7 +52,7 @@ export const datasetTableTabs = [
field: TabSpecificField.LINEAGE,
},
{
name: i18next.t('label.dbt-uppercase'),
name: i18next.t('label.dbt-lowercase'),
path: 'dbt',
},
{