From 03560f8d17cd762babf35f12587e58b27dc5abba Mon Sep 17 00:00:00 2001
From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com>
Date: Sun, 5 May 2024 20:35:17 +0900
Subject: [PATCH] Apply i18n
---
frontend/messages/en.json | 1 +
frontend/messages/ja.json | 1 +
.../projects/[projectId]/runs/[runId]/RunEditor.tsx | 7 +++++--
.../[projectId]/runs/[runId]/RunPregressDonutChart.tsx | 7 ++++---
.../[locale]/projects/[projectId]/runs/[runId]/page.tsx | 1 +
frontend/types/run.ts | 1 +
6 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 7777db4..cb2d0c6 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -115,6 +115,7 @@
"updating": "Updating...",
"update": "Update",
"progress": "Progress",
+ "refresh": "Refresh",
"id": "ID",
"title": "Title",
"please_enter": "Please enter run name",
diff --git a/frontend/messages/ja.json b/frontend/messages/ja.json
index 89930be..3be6e95 100644
--- a/frontend/messages/ja.json
+++ b/frontend/messages/ja.json
@@ -115,6 +115,7 @@
"updating": "更新中...",
"update": "更新",
"progress": "進捗",
+ "refresh": "再読み込み",
"id": "ID",
"title": "タイトル",
"description": "詳細",
diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunEditor.tsx b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunEditor.tsx
index a921f0f..3dd08af 100644
--- a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunEditor.tsx
+++ b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunEditor.tsx
@@ -258,7 +258,7 @@ export default function RunEditor({
{messages.progress}
-
+
-
+
diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunPregressDonutChart.tsx b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunPregressDonutChart.tsx
index d7fa6de..43620a5 100644
--- a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunPregressDonutChart.tsx
+++ b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/RunPregressDonutChart.tsx
@@ -2,14 +2,15 @@ import React from "react";
import { useState, useEffect } from "react";
import dynamic from "next/dynamic";
import { testRunCaseStatus } from "@/config/selection";
-import { RunStatusCountType } from "@/types/run";
+import { RunStatusCountType, RunMessages } from "@/types/run";
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
type Props = {
statusCounts: RunStatusCountType[];
+ messages: RunMessages;
};
-export default function RunProgressDounut({ statusCounts }: Props) {
+export default function RunProgressDounut({ statusCounts, messages }: Props) {
const [chartData, setChartData] = useState({
series: [],
options: {
@@ -26,7 +27,7 @@ export default function RunProgressDounut({ statusCounts }: Props) {
return found ? found.count : 0;
});
- const labels = testRunCaseStatus.map((entry) => entry.name);
+ const labels = testRunCaseStatus.map((entry) => messages[entry.uid]);
const colors = testRunCaseStatus.map((entry) => entry.chartColor);
setChartData({
diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
index ddaf94a..b54e4ec 100644
--- a/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
+++ b/frontend/src/app/[locale]/projects/[projectId]/runs/[runId]/page.tsx
@@ -12,6 +12,7 @@ export default function Page({
updating: t("updating"),
update: t("update"),
progress: t("progress"),
+ refresh: t("refresh"),
id: t("id"),
title: t("title"),
pleaseEnter: t("please_enter"),
diff --git a/frontend/types/run.ts b/frontend/types/run.ts
index d39aada..3b208df 100644
--- a/frontend/types/run.ts
+++ b/frontend/types/run.ts
@@ -43,6 +43,7 @@ type RunMessages = {
updating: string;
update: string;
progress: string,
+ refresh: string,
id: string;
title: string;
pleaseEnter: string;