diff --git a/frontend/packages/kubevirt-plugin/locales/en/kubevirt-plugin.json b/frontend/packages/kubevirt-plugin/locales/en/kubevirt-plugin.json index 0014f9d6067..0f0cf04e532 100644 --- a/frontend/packages/kubevirt-plugin/locales/en/kubevirt-plugin.json +++ b/frontend/packages/kubevirt-plugin/locales/en/kubevirt-plugin.json @@ -1,4 +1,32 @@ { + "Affinity Rules": "Affinity Rules", + "New Affinity": "New Affinity", + "Edit Affinity": "Edit Affinity", + "Add Affinity rule": "Add Affinity rule", + "Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.": "Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.", + "Rules with 'Preferred' condition will stack with an 'AND' relation between them.": "Rules with 'Preferred' condition will stack with an 'AND' relation between them.", + "Rules with 'Required' condition will stack with an 'OR' relation between them.": "Rules with 'Required' condition will stack with an 'OR' relation between them.", + "No Affinity rules found": "No Affinity rules found", + "Save": "Save", + "Affinity has been updated outside this flow.": "Affinity has been updated outside this flow.", + "Saving these changes will override any Affinity previously saved.": "Saving these changes will override any Affinity previously saved.", + "Reload Affinity": "Reload Affinity", + "Dedicated Resources": "Dedicated Resources", + "Schedule this workload with dedicated resources (guaranteed policy)": "Schedule this workload with dedicated resources (guaranteed policy)", + "Available only on Nodes with labels": "Available only on Nodes with labels", + "Policy has been updated outside this flow.": "Policy has been updated outside this flow.", + "Saving these changes will override any policy previously saved.": "Saving these changes will override any policy previously saved.", + "Reload Policy": "Reload Policy", + "Node Selector": "Node Selector", + "Tolerations": "Tolerations", + "Tolerations are applied to VMs, and allow (but do not require) the VMs to schedule onto nodes with matching taints.": "Tolerations are applied to VMs, and allow (but do not require) the VMs to schedule onto nodes with matching taints.", + "Add tolerations to allow a VM to schedule onto nodes with matching taints.": "Add tolerations to allow a VM to schedule onto nodes with matching taints.", + "Taints and Tolerations documentation": "Taints and Tolerations documentation", + "Add Toleration": "Add Toleration", + "Add Toleration to specify qualifying nodes": "Add Toleration to specify qualifying nodes", + "Tolerations has been updated outside this flow.": "Tolerations has been updated outside this flow.", + "Saving these changes will override any Tolerations previously saved.": "Saving these changes will override any Tolerations previously saved.", + "Reload Tolerations": "Reload Tolerations", "Not available": "Not available", "Virtualization": "Virtualization", "Virtual Machines Templates": "Virtual Machines Templates", @@ -7,6 +35,17 @@ "Disks": "Disks", "VM Template Details": "VM Template Details", "Scheduling and resources requirements": "Scheduling and resources requirements", + "Description": "Description", + "Operating System": "Operating System", + "Workload Profile": "Workload Profile", + "Base Template": "Base Template", + "Boot Order": "Boot Order", + "Provision Source": "Provision Source", + "{{count}} Affinity rule": "{{count}} Affinity rule", + "{{count}} Affinity rule_plural": "{{count}} Affinity rules", + "Flavor": "Flavor", + "Workload scheduled with dedicated resources (guaranteed policy)": "Workload scheduled with dedicated resources (guaranteed policy)", + "No Dedicated resources applied": "No Dedicated resources applied", "Virtual Machines": "Virtual Machines", "Overview": "Overview", "Details": "Details", @@ -18,17 +57,21 @@ "Services": "Services", "Active Users": "Active Users", "View Pending Changes": "View Pending Changes", - "Description": "Description", - "Operating System": "Operating System", "Template": "Template", "Status": "Status", "Pod": "Pod", - "Boot Order": "Boot Order", "IP Address": "IP Address", "Hostname": "Hostname", "Time Zone": "Time Zone", "Node": "Node", - "Workload Profile": "Workload Profile", + "No Toleration rules": "No Toleration rules", + "No Affinity rules": "No Affinity rules", + "User Name": "User Name", + "Domain": "Domain", + "Time of login": "Time of login", + "Elapsed time since login": "Elapsed time since login", + "Users": "Users", + "No Active Users": "No Active Users", "`Virtual Machine Instance {{name}}`": "`Virtual Machine Instance {{name}}`", "Consider using a Virtual Machine that will provide additional management capabilities to a VirtualMachineInstance inside the cluster.": "Consider using a Virtual Machine that will provide additional management capabilities to a VirtualMachineInstance inside the cluster.", "Learn more": "Learn more", diff --git a/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/affinity-modal/affinity-modal.tsx b/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/affinity-modal/affinity-modal.tsx index f8bb9d9aaf6..75e2fee7713 100644 --- a/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/affinity-modal/affinity-modal.tsx +++ b/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/affinity-modal/affinity-modal.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { useTranslation } from 'react-i18next'; import * as _ from 'lodash'; import { withHandlePromise, @@ -29,7 +30,6 @@ import { getVMLikeAffinity } from '../../../../selectors/vm-like/selectors'; import { getLoadedData, isLoaded, getLoadError } from '../../../../utils'; import { useCollisionChecker } from '../../../../hooks/use-collision-checker'; import { ModalFooter } from '../../modal/modal-footer'; -import { AFFINITY_MODAL_TITLE, AFFINITY_CREATE, AFFINITY_EDITING } from '../shared/consts'; import { AffinityTable } from './components/affinity-table/affinity-table'; import { AffinityRow } from './components/affinity-table/affinity-row'; import { AffinityEdit } from './components/affinity-edit/affinity-edit'; @@ -56,6 +56,7 @@ export const AffinityModal = withHandlePromise( inProgress, errorMessage, }) => { + const { t } = useTranslation(); const vmLikeFinal = getLoadedData(vmLikeEntityLoading, vmLikeEntity); const loadError = getLoadError(nodes, NodeModel); const currentAffinity = getVMLikeAffinity(vmLikeFinal); @@ -177,10 +178,10 @@ export const AffinityModal = withHandlePromise( }; const modalTitle = !isEditing - ? AFFINITY_MODAL_TITLE + ? t('kubevirt-plugin~Affinity Rules') : isCreating - ? AFFINITY_CREATE - : AFFINITY_EDITING; + ? t('kubevirt-plugin~New Affinity') + : t('kubevirt-plugin~Edit Affinity'); return (
@@ -192,7 +193,7 @@ export const AffinityModal = withHandlePromise( {!isEditing && affinities.length > 0 && ( )} @@ -210,20 +211,20 @@ export const AffinityModal = withHandlePromise( {affinities.length > 0 && (
- { - 'Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.' - } + {t( + 'kubevirt-plugin~Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.', + )} - { - "Rules with 'Preferred' condition will stack with an 'AND' relation between them." - } + {t( + "kubevirt-plugin~Rules with 'Preferred' condition will stack with an 'AND' relation between them.", + )} - { - "Rules with 'Required' condition will stack with an 'OR' relation between them." - } + {t( + "kubevirt-plugin~Rules with 'Required' condition will stack with an 'OR' relation between them.", + )}
)} @@ -254,30 +255,30 @@ export const AffinityModal = withHandlePromise( ) : ( - No Affinity rules found + {t('kubevirt-plugin~No Affinity rules found')}
- { - 'Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.' - } + {t( + 'kubevirt-plugin~Set scheduling requirements and affect the ranking of the nodes candidate for scheduling.', + )} - { - "Rules with 'Preferred' condition will stack with an 'AND' relation between them." - } + {t( + "kubevirt-plugin~Rules with 'Preferred' condition will stack with an 'AND' relation between them.", + )} - { - "Rules with 'Required' condition will stack with an 'OR' relation between them." - } + {t( + "kubevirt-plugin~Rules with 'Required' condition will stack with an 'OR' relation between them.", + )}
)} @@ -290,14 +291,19 @@ export const AffinityModal = withHandlePromise( isSimpleError={!!loadError} onSubmit={submit} onCancel={onCancel} - submitButtonText={'Save'} - infoTitle={showCollisionAlert && 'Affinity has been updated outside this flow.'} + submitButtonText={t('kubevirt-plugin~Save')} + infoTitle={ + showCollisionAlert && + t('kubevirt-plugin~Affinity has been updated outside this flow.') + } infoMessage={ <> - Saving these changes will override any Affinity previously saved. + {t( + 'kubevirt-plugin~Saving these changes will override any Affinity previously saved.', + )}
. diff --git a/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/dedicated-resources-modal/dedicated-resources-modal.tsx b/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/dedicated-resources-modal/dedicated-resources-modal.tsx index 4efcb091225..6012990fc46 100644 --- a/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/dedicated-resources-modal/dedicated-resources-modal.tsx +++ b/frontend/packages/kubevirt-plugin/src/components/modals/scheduling-modals/dedicated-resources-modal/dedicated-resources-modal.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { useTranslation } from 'react-i18next'; import { Button, ButtonVariant, Checkbox, Text, TextVariants } from '@patternfly/react-core'; import { ModalTitle, ModalBody, ModalComponentProps } from '@console/internal/components/factory'; import { NodeModel } from '@console/internal/models'; @@ -17,7 +18,7 @@ import { useCollisionChecker } from '../../../../hooks/use-collision-checker'; import { useNodeQualifier } from '../shared/hooks'; import { ModalFooter } from '../../modal/modal-footer'; import { NodeChecker } from '../shared/NodeChecker/node-checker'; -import { DEDICATED_RESOURCES_MODAL_TITLE, DEDICATED_RESOURCES_LABELS } from '../shared/consts'; +import { DEDICATED_RESOURCES_LABELS } from '../shared/consts'; import './dedicated-resources-modal.scss'; export const DedicatedResourcesModal = withHandlePromise( @@ -30,6 +31,7 @@ export const DedicatedResourcesModal = withHandlePromise { + const { t } = useTranslation(); const vmLikeFinal = getLoadedData(vmLikeEntityLoading, vmLikeEntity); const loadError = getLoadError(nodes, NodeModel); const isCurrentCPUPinned = isDedicatedCPUPlacement(asVM(vmLikeFinal)); @@ -66,11 +68,13 @@ export const DedicatedResourcesModal = withHandlePromise - {DEDICATED_RESOURCES_MODAL_TITLE} + {t('kubevirt-plugin~Dedicated Resources')} setIsPinned(flag)} @@ -80,7 +84,7 @@ export const DedicatedResourcesModal = withHandlePromise - Available only on Nodes with labels{' '} + {t('kubevirt-plugin~Available only on Nodes with labels')}{' '}