Skip to content

Commit

Permalink
i8n strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan committed Sep 5, 2024
1 parent 57a3d7f commit f1b0190
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
10 changes: 9 additions & 1 deletion locales/en/plugin__console-plugin-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@
"Address": "Address",
"Dashboard": "Dashboard",
"Policies": "Policies",
"Policy Topology": "Policy Topology"
"Policy Topology": "Policy Topology",
"TLS": "TLS",
"Are you sure you want to delete the policy": "Are you sure you want to delete the policy",
"All Policies": "All Policies",
"DNS": "DNS",
"Auth": "Auth",
"RateLimit": "RateLimit",
"Edit": "Edit",
"Delete": "Delete"
}
17 changes: 9 additions & 8 deletions src/components/KuadrantPoliciesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ const AllPoliciesTable: React.FC<AllPoliciesTableProps> = ({ data, unfilteredDat
};

const DropdownWithKebab: React.FC<DropdownWithKebabProps> = ({ obj }) => {
const { t } = useTranslation('plugin__console-plugin-template');
const [isOpen, setIsOpen] = React.useState(false);
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState(false);

Expand Down Expand Up @@ -242,10 +243,10 @@ const DropdownWithKebab: React.FC<DropdownWithKebabProps> = ({ obj }) => {
>
<DropdownList>
<DropdownItem value="edit" key="edit">
Edit
{t('Edit')}
</DropdownItem>
<DropdownItem value="delete" key="delete">
Delete
{t('Delete')}
</DropdownItem>
</DropdownList>
</Dropdown>
Expand All @@ -259,7 +260,7 @@ const DropdownWithKebab: React.FC<DropdownWithKebabProps> = ({ obj }) => {
>
<ModalHeader title="Confirm Delete" />
<ModalBody>
Are you sure you want to delete the resource {obj.metadata.name}?
{t("Are you sure you want to delete the policy")}: <b>{obj.metadata.name}</b>?
</ModalBody>
<ModalFooter>
<Button key="confirm" variant={ButtonVariant.danger} onClick={onDeleteConfirm}>
Expand Down Expand Up @@ -426,7 +427,7 @@ const KuadrantPoliciesPage: React.FC = () => {
let pages = [
{
href: '',
name: 'All Policies',
name: t('All Policies'),
component: All
}
];
Expand All @@ -439,12 +440,12 @@ const KuadrantPoliciesPage: React.FC = () => {
...pages,
{
href: 'dns',
name: 'DNS',
name: t('DNS'),
component: DNS
},
{
href: 'tls',
name: 'TLS',
name: t('TLS'),
component: TLS
}
];
Expand All @@ -453,12 +454,12 @@ const KuadrantPoliciesPage: React.FC = () => {
...pages,
{
href: 'auth',
name: 'Auth',
name: t('Auth'),
component: Auth
},
{
href: 'ratelimit',
name: 'RateLimit',
name: t('RateLimit'),
component: RateLimit
}
];
Expand Down

0 comments on commit f1b0190

Please sign in to comment.