Skip to content

Commit

Permalink
kubevirt i18n pages
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Nov 22, 2020
1 parent bd88c9b commit 0755af8
Show file tree
Hide file tree
Showing 19 changed files with 310 additions and 200 deletions.
86 changes: 75 additions & 11 deletions frontend/packages/kubevirt-plugin/locales/en/kubevirt-plugin.json
@@ -1,4 +1,31 @@
{
"Network Interfaces": "Network Interfaces",
"Add Network Interface": "Add Network Interface",
"No network interface added": "No network interface added",
"Disks": "Disks",
"Add Disk": "Add Disk",
"No disks attached": "No disks attached",
"Events": "Events",
"View all": "View all",
"Details": "Details",
"Name": "Name",
"Namespace": "Namespace",
"Created": "Created",
"Hostname": "Hostname",
"Node": "Node",
"IP Address": "IP Address",
"Operating System": "Operating System",
"Time Zone": "Time Zone",
"Active Users": "Active Users",
"Inventory": "Inventory",
"NIC": "NIC",
"Snapshot": "Snapshot",
"Status": "Status",
"Utilization": "Utilization",
"CPU": "CPU",
"Memory": "Memory",
"Filesystem": "Filesystem",
"Network Transfer": "Network Transfer",
"Affinity Rules": "Affinity Rules",
"New Affinity": "New Affinity",
"Edit Affinity": "Edit Affinity",
Expand Down Expand Up @@ -27,7 +54,36 @@
"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",
"Restore Snapshot": "Restore Snapshot",
"Are you sure you want to restore <1>{snapshotName}</1> snapshot?": "Are you sure you want to restore <1>{snapshotName}</1> snapshot?",
"{Restore}": "{Restore}",
"File System Type": "File System Type",
"Mount Point": "Mount Point",
"Total Bytes": "Total Bytes",
"Used Bytes": "Used Bytes",
"FileSystems": "FileSystems",
"No File Systems Found": "No File Systems Found",
"File Systems": "File Systems",
"The following information regarding how the disks are partitioned is provided by the guest agent.": "The following information regarding how the disks are partitioned is provided by the guest agent.",
"Source": "Source",
"Size": "Size",
"Drive": "Drive",
"Interface": "Interface",
"Storage Class": "Storage Class",
"Disks description": "Disks description",
"The following information is provided by the OpenShift Virtualization operator.": "The following information is provided by the OpenShift Virtualization operator.",
"VM Disks List": "VM Disks List",
"VM Nics List": "VM Nics List",
"Name,": "Name,",
"Model": "Model",
"Network": "Network",
"Type": "Type",
"MAC Address": "MAC Address",
"Not available": "Not available",
"VM Snapshots List": "VM Snapshots List",
"Snapshots": "Snapshots",
"Last restored": "Last restored",
"Take Snapshot": "Take Snapshot",
"Virtualization": "Virtualization",
"Virtual Machines Templates": "Virtual Machines Templates",
"{{name}} Details": "{{name}} Details",
Expand All @@ -38,7 +94,6 @@
"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",
Expand All @@ -48,26 +103,30 @@
"Flavor": "Flavor",
"Workload scheduled with dedicated resources (guaranteed policy)": "Workload scheduled with dedicated resources (guaranteed policy)",
"No Dedicated resources applied": "No Dedicated resources applied",
"Open Console in new Window": "Open Console in new Window",
"Guest login credentials": "Guest login credentials",
"The following credentials for this operating system were created via <2>Cloud-init</2>. If unsuccessful cloud-init could be improperly configured. Please contact the image provider for more information.": "The following credentials for this operating system were created via <2>Cloud-init</2>. If unsuccessful cloud-init could be improperly configured. Please contact the image provider for more information.",
"User name:": "User name:",
"Password:": "Password:",
"Hide password": "Hide password",
"Show password": "Show password",
"`Selected type {{typeName}} is unsupported, falling back to a supported type`": "`Selected type {{typeName}} is unsupported, falling back to a supported type`",
"Virtual Machines": "Virtual Machines",
"Overview": "Overview",
"Details": "Details",
"Console": "Console",
"Network Interfaces": "Network Interfaces",
"Disks": "Disks",
"Environment": "Environment",
"Snapshots": "Snapshots",
"Operating system mismatch": "Operating system mismatch",
"The operating system defined for this virtual machine does not match what is being reported by the Guest Agent. In order to correct this, you need to re-create the virtual machine with the correct VM selection. The disks of this virtual machine can be attached to the newly created one.": "The operating system defined for this virtual machine does not match what is being reported by the Guest Agent. In order to correct this, you need to re-create the virtual machine with the correct VM selection. The disks of this virtual machine can be attached to the newly created one.",
"Services": "Services",
"Active Users": "Active Users",
"Select a resource": "Select a resource",
"Include all values from existing config maps, secrets or service accounts (as Disk)": "Include all values from existing config maps, secrets or service accounts (as Disk)",
"Add new values by referencing an existing config map, secret or service account. Using these values requires mounting them manually to the VM.": "Add new values by referencing an existing config map, secret or service account. Using these values requires mounting them manually to the VM.",
"config map / secret / service account": "config map / secret / service account",
"Serial Number": "Serial Number",
"Add Config Map, Secret or Service Account": "Add Config Map, Secret or Service Account",
"View Pending Changes": "View Pending Changes",
"Template": "Template",
"Status": "Status",
"Pod": "Pod",
"IP Address": "IP Address",
"Hostname": "Hostname",
"Time Zone": "Time Zone",
"Node": "Node",
"No Toleration rules": "No Toleration rules",
"No Affinity rules": "No Affinity rules",
"User Name": "User Name",
Expand All @@ -76,6 +135,11 @@
"Elapsed time since login": "Elapsed time since login",
"Users": "Users",
"No Active Users": "No Active Users",
"Pending changes": "Pending changes",
"No virtual machines found": "No virtual machines found",
"See the <1>templates tab</1> to quickly create a virtual machine from the available templates.": "See the <1>templates tab</1> to quickly create a virtual machine from the available templates.",
"Create virtual machine": "Create virtual machine",
"Create Virtual Machine": "Create Virtual Machine",
"`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",
Expand Down
@@ -1,4 +1,5 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import {
Bullseye,
Expand Down Expand Up @@ -31,7 +32,6 @@ import { vmWizardNicModalEnhanced } from './vm-wizard-nic-modal-enhanced';
import { VMWizardNicRow } from './vm-wizard-nic-row';
import { VMWizardNetworkBundle } from './types';
import { NetworkBootSource } from './network-boot-source';
import { ADD_NETWORK_INTERFACE } from '../../../../utils/strings';
import { NetworkWrapper } from '../../../../k8s/wrapper/vm/network-wrapper';
import { NetworkInterfaceWrapper } from '../../../../k8s/wrapper/vm/network-interface-wrapper';

Expand Down Expand Up @@ -64,6 +64,7 @@ const NetworkingTabComponent: React.FC<NetworkingTabComponentProps> = ({
isUpdateDisabled,
isDeleteDisabled,
}) => {
const { t } = useTranslation();
const showNetworks = networks.length > 0 || isBootNICRequired;

const withProgress = wrapWithProgress(setTabLocked);
Expand All @@ -85,13 +86,13 @@ const NetworkingTabComponent: React.FC<NetworkingTabComponentProps> = ({
<Split>
<SplitItem isFilled>
<Title headingLevel="h5" size="lg">
Network Interfaces
{t('kubevirt-plugin~Network Interfaces')}
</Title>
</SplitItem>
{showNetworks && !isCreateDisabled && (
<SplitItem>
<Button {...addButtonProps} variant={ButtonVariant.secondary}>
{ADD_NETWORK_INTERFACE}
{t('kubevirt-plugin~Add Network Interface')}
</Button>
</SplitItem>
)}
Expand Down Expand Up @@ -125,11 +126,11 @@ const NetworkingTabComponent: React.FC<NetworkingTabComponentProps> = ({
<Bullseye>
<EmptyState variant={EmptyStateVariant.full}>
<Title headingLevel="h5" size="lg">
No network interface added
{t('kubevirt-plugin~No network interface added')}
</Title>
{!isCreateDisabled && (
<Button {...addButtonProps} icon={<PlusCircleIcon />} variant={ButtonVariant.link}>
{ADD_NETWORK_INTERFACE}
{t('kubevirt-plugin~Add Network Interface')}
</Button>
)}
</EmptyState>
Expand Down
@@ -1,4 +1,5 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { connect } from 'react-redux';
import {
Bullseye,
Expand Down Expand Up @@ -37,7 +38,6 @@ import { VmWizardStorageRow } from './vm-wizard-storage-row';
import { VMWizardStorageBundle } from './types';
import { vmWizardStorageModalEnhanced } from './vm-wizard-storage-modal-enhanced';
import { StorageBootSource } from './storage-boot-source';
import { ADD_DISK } from '../../../../utils/strings';
import { VolumeWrapper } from '../../../../k8s/wrapper/vm/volume-wrapper';

import './storage-tab.scss';
Expand Down Expand Up @@ -88,6 +88,7 @@ const StorageTabFirehose: React.FC<StorageTabFirehoseProps> = ({
isUpdateDisabled,
isDeleteDisabled,
}) => {
const { t } = useTranslation();
const showStorages = storages.length > 0 || isBootDiskRequired;

const withProgress = wrapWithProgress(setTabLocked);
Expand All @@ -109,13 +110,13 @@ const StorageTabFirehose: React.FC<StorageTabFirehoseProps> = ({
<Split>
<SplitItem isFilled>
<Title headingLevel="h5" size="lg">
Disks
{t('kubevirt-plugin~Disks')}
</Title>
</SplitItem>
{showStorages && !isCreateDisabled && (
<SplitItem>
<Button {...addButtonProps} variant={ButtonVariant.secondary}>
{ADD_DISK}
{t('kubevirt-plugin~Add Disk')}
</Button>
</SplitItem>
)}
Expand Down Expand Up @@ -150,11 +151,11 @@ const StorageTabFirehose: React.FC<StorageTabFirehoseProps> = ({
<Bullseye>
<EmptyState variant={EmptyStateVariant.full}>
<Title headingLevel="h5" size="lg">
No disks attached
{t('kubevirt-plugin~No disks attached')}
</Title>
{!isCreateDisabled && (
<Button {...addButtonProps} icon={<PlusCircleIcon />} variant={ButtonVariant.link}>
{ADD_DISK}
{t('kubevirt-plugin~Add Disk')}
</Button>
)}
</EmptyState>
Expand Down
@@ -1,4 +1,5 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { CardActions } from '@patternfly/react-core';
import DashboardCard from '@console/shared/src/components/dashboard/dashboard-card/DashboardCard';
import DashboardCardBody from '@console/shared/src/components/dashboard/dashboard-card/DashboardCardBody';
Expand Down Expand Up @@ -58,6 +59,7 @@ const RecentEvent = withDashboardResources<RecentEventProps>(
);

export const VMActivityCard: React.FC = () => {
const { t } = useTranslation();
const { vm, vmi } = React.useContext(VMDashboardContext);
const vmiLike = vm || vmi;

Expand All @@ -75,9 +77,9 @@ export const VMActivityCard: React.FC = () => {
return (
<DashboardCard gradient>
<DashboardCardHeader>
<DashboardCardTitle>Events</DashboardCardTitle>
<DashboardCardTitle>{t('kubevirt-plugin~Events')}</DashboardCardTitle>
<CardActions className="kubevirt-activity-card__actions">
<DashboardCardLink to={viewEventsLink}>View all</DashboardCardLink>
<DashboardCardLink to={viewEventsLink}>{t('kubevirt-plugin~View all')}</DashboardCardLink>
<PauseButton paused={paused} togglePause={togglePause} />
</CardActions>
</DashboardCardHeader>
Expand Down
Expand Up @@ -70,67 +70,71 @@ export const VMDetailsCard: React.FC<VMDetailsCardProps> = () => {
return (
<DashboardCard>
<DashboardCardHeader>
<DashboardCardTitle>Details</DashboardCardTitle>
<DashboardCardTitle>{t('kubevirt-plugin~Details')}</DashboardCardTitle>
<DashboardCardLink to={viewAllLink}>View all</DashboardCardLink>
</DashboardCardHeader>
<DashboardCardBody isLoading={false}>
<DetailsBody>
<DetailItem
title="Name"
title={t('kubevirt-plugin~Name')}
error={false}
isLoading={!vmiLike}
valueClassName="co-select-to-copy"
>
{name}
</DetailItem>
<DetailItem title="Namespace" error={false} isLoading={!vmiLike}>
<DetailItem title={t('kubevirt-plugin~Namespace')} error={false} isLoading={!vmiLike}>
<ResourceLink
kind="Namespace"
name={namespace}
title={getUID(vmiLike)}
namespace={null}
/>
</DetailItem>
<DetailItem title="Created" error={false} isLoading={!vmiLike}>
<DetailItem title={t('kubevirt-plugin~Created')} error={false} isLoading={!vmiLike}>
<Timestamp timestamp={getCreationTimestamp(vmiLike)} />
</DetailItem>
<DetailItem
title="Hostname"
title={t('kubevirt-plugin~Hostname')}
error={!hostname}
isLoading={!vmiLike}
errorMessage={guestAgentFieldNotAvailMsg}
>
{hostname}
</DetailItem>
<DetailItem title="Node" error={!launcherPod || !nodeName} isLoading={!vmiLike}>
<DetailItem
title={t('kubevirt-plugin~Node')}
error={!launcherPod || !nodeName}
isLoading={!vmiLike}
>
{launcherPod && nodeName && <NodeLink name={nodeName} />}
</DetailItem>
<DetailItem
title="IP Address"
title={t('kubevirt-plugin~IP Address')}
error={!launcherPod || !ipAddrs}
isLoading={!vmiLike}
valueClassName="co-select-to-copy"
>
{launcherPod && ipAddrs}
</DetailItem>
<DetailItem
title="Operating System"
title={t('kubevirt-plugin~Operating System')}
error={!(operatingSystem || os)}
isLoading={!vmiLike}
errorMessage={guestAgentFieldNotAvailMsg}
>
{operatingSystem || os}
</DetailItem>
<DetailItem
title="Time Zone"
title={t('kubevirt-plugin~Time Zone')}
error={!timeZone}
isLoading={!vmiLike}
errorMessage={guestAgentFieldNotAvailMsg}
>
{timeZone}
</DetailItem>
<DetailItem
title="Active Users"
title={t('kubevirt-plugin~Active Users')}
error={numLoggedInUsers == null}
isLoading={!vmiLike}
errorMessage={guestAgentFieldNotAvailMsg}
Expand Down
@@ -1,4 +1,5 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { DashboardItemProps } from '@console/internal/components/dashboard/with-dashboard-resources';
import DashboardCard from '@console/shared/src/components/dashboard/dashboard-card/DashboardCard';
Expand Down Expand Up @@ -27,6 +28,7 @@ import { VMSnapshot } from '../../../types';
import { getVmSnapshotVmName } from '../../../selectors/snapshot/snapshot';

export const VMInventoryCard: React.FC<VMInventoryCardProps> = () => {
const { t } = useTranslation();
const vmDashboardContext = React.useContext(VMDashboardContext);
const { vm, vmi } = vmDashboardContext;
const vmiLike = vm || vmi;
Expand Down Expand Up @@ -99,13 +101,13 @@ export const VMInventoryCard: React.FC<VMInventoryCardProps> = () => {
return (
<DashboardCard>
<DashboardCardHeader>
<DashboardCardTitle>Inventory</DashboardCardTitle>
<DashboardCardTitle>{t('kubevirt-plugin~Inventory')}</DashboardCardTitle>
</DashboardCardHeader>
<DashboardCardBody isLoading={isLoading}>
{nicCount > 0 && (
<InventoryItem
isLoading={isLoading}
title="NIC"
title={t('kubevirt-plugin~NIC')}
count={nicCount}
TitleComponent={NicsTitle}
key="nic-inventory-item"
Expand Down Expand Up @@ -142,7 +144,7 @@ export const VMInventoryCard: React.FC<VMInventoryCardProps> = () => {
<InventoryItem
isLoading={isLoading || !snapshotsLoaded}
error={snapshotsError}
title="Snapshot"
title={t('kubevirt-plugin~Snapshot')}
count={filteredSnapshots.length}
TitleComponent={SnapshotsTitle}
key="snapshots-inventory-item"
Expand Down

0 comments on commit 0755af8

Please sign in to comment.