Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1973572: Hardcode strings in Home->Overview page #9322

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/packages/console-app/locales/en/console-app.json
Expand Up @@ -25,5 +25,7 @@
"API version": "API version",
"Restore": "Restore",
"Administrator": "Administrator",
"Cluster": "Cluster",
"Control Plane": "Control Plane",
"VolumeSnapshotContents": "VolumeSnapshotContents"
}
4 changes: 3 additions & 1 deletion frontend/packages/console-app/locales/ja/console-app.json
Expand Up @@ -24,5 +24,7 @@
"Status": "ステータス",
"API version": "API バージョン",
"Restore": "復元",
"Administrator": "管理者"
"Administrator": "管理者",
"Cluster": "クラスター",
"Control Plane": "コントロールプレーン"
}
4 changes: 3 additions & 1 deletion frontend/packages/console-app/locales/zh/console-app.json
Expand Up @@ -24,5 +24,7 @@
"Status": "状态",
"API version": "API 版本",
"Restore": "恢复",
"Administrator": "管理员"
"Administrator": "管理员",
"Cluster": "集群",
"Control Plane": "Control Plane"
}
6 changes: 4 additions & 2 deletions frontend/packages/console-app/src/plugin.tsx
Expand Up @@ -114,7 +114,8 @@ const plugin: Plugin<ConsumedExtensions> = [
{
type: 'Dashboards/Overview/Health/URL',
properties: {
title: 'Cluster',
// t('console-app~Cluster')
title: '%console-app~Cluster%',
url: 'healthz',
fetch: fetchK8sHealth,
healthHandler: getK8sHealthState,
Expand All @@ -131,7 +132,8 @@ const plugin: Plugin<ConsumedExtensions> = [
{
type: 'Dashboards/Overview/Health/Prometheus',
properties: {
title: 'Control Plane',
// t('console-app~Control Plane')
title: '%console-app~Control Plane%',
queries: [API_SERVERS_UP, CONTROLLER_MANAGERS_UP, SCHEDULERS_UP, API_SERVER_REQUESTS_SUCCESS],
healthHandler: getControlPlaneHealth,
popupComponent: () =>
Expand Down
@@ -0,0 +1,3 @@
{
"Not available": "Not available"
}
@@ -0,0 +1,3 @@
{
"Not available": "利用不可"
}
@@ -0,0 +1,3 @@
{
"Not available": "사용할 수 없음"
}
@@ -0,0 +1,3 @@
{
"Not available": "不可用"
}
@@ -1,5 +1,7 @@
import * as _ from 'lodash';
import { PrometheusHealthHandler, SubsystemHealth } from '@console/plugin-sdk';
import i18next from 'i18next';

import { HealthState } from '@console/shared/src/components/dashboard/status-card/states';
import { PrometheusResponse } from '@console/internal/components/graphs';
import { mapMetrics, isError, isWaitingOrDisabled } from './mappers';
Expand All @@ -11,7 +13,7 @@ export const getClusterInsightsComponentStatus = (
if (error) {
return {
state: HealthState.NOT_AVAILABLE,
message: 'Not available',
message: i18next.t('insights-plugin~Not available'),
};
}
if (!response) {
Expand All @@ -20,11 +22,11 @@ export const getClusterInsightsComponentStatus = (
const values = mapMetrics(response);

if (isError(values)) {
return { state: HealthState.ERROR, message: 'Not available' };
return { state: HealthState.ERROR, message: i18next.t('insights-plugin~Not available') };
}

if (!isError(values) && isWaitingOrDisabled(values)) {
return { state: HealthState.UNKNOWN, message: 'Not available' };
return { state: HealthState.UNKNOWN, message: i18next.t('insights-plugin~Not available') };
}

// Insights Operator has sent rules results
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/components/notification-drawer.tsx
Expand Up @@ -88,7 +88,7 @@ const AlertEmptyState: React.FC<AlertEmptyProps> = ({ drawerToggle }) => {

export const getAlertActions = (actionsExtensions: AlertAction[]) => {
const alertActions = new Map().set('AlertmanagerReceiversNotConfigured', {
text: i18next.t('notification-drawer~Configure'),
text: i18next.t('public~Configure'),
path: '/monitoring/alertmanagerconfig',
});
actionsExtensions.forEach(({ properties }) =>
Expand Down
1 change: 1 addition & 0 deletions frontend/public/i18n.js
Expand Up @@ -76,6 +76,7 @@ i18n
'idp-name-input',
'image-stream',
'ingress',
'insights-plugin',
'k8s',
'keystone-idp-form',
'knative-plugin',
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/en/notification-drawer.json
Expand Up @@ -3,7 +3,6 @@
"No critical alerts": "No critical alerts",
"There are currently no critical alerts firing. There may be firing alerts of other severities or silenced critical alerts however.": "There are currently no critical alerts firing. There may be firing alerts of other severities or silenced critical alerts however.",
"View all alerts": "View all alerts",
"Configure": "Configure",
"Update cluster": "Update cluster",
"Unknown": "Unknown",
"Cluster update available": "Cluster update available",
Expand Down
1 change: 1 addition & 0 deletions frontend/webpack.config.ts
Expand Up @@ -223,6 +223,7 @@ const config: Configuration = {
new CopyWebpackPlugin([{ from: './packages/ceph-storage-plugin/locales', to: 'locales' }]),
new CopyWebpackPlugin([{ from: './packages/noobaa-storage-plugin/locales', to: 'locales' }]),
new CopyWebpackPlugin([{ from: './packages/metal3-plugin/locales', to: 'locales' }]),
new CopyWebpackPlugin([{ from: './packages/insights-plugin/locales', to: 'locales' }]),
new CopyWebpackPlugin([
{ from: './packages/local-storage-operator-plugin/locales', to: 'locales' },
]),
Expand Down