Apply i18n

This commit is contained in:
Takeshi Kimata
2024-05-05 20:35:17 +09:00
parent ce078bb132
commit 03560f8d17
6 changed files with 13 additions and 5 deletions

View File

@@ -115,6 +115,7 @@
"updating": "Updating...", "updating": "Updating...",
"update": "Update", "update": "Update",
"progress": "Progress", "progress": "Progress",
"refresh": "Refresh",
"id": "ID", "id": "ID",
"title": "Title", "title": "Title",
"please_enter": "Please enter run name", "please_enter": "Please enter run name",

View File

@@ -115,6 +115,7 @@
"updating": "更新中...", "updating": "更新中...",
"update": "更新", "update": "更新",
"progress": "進捗", "progress": "進捗",
"refresh": "再読み込み",
"id": "ID", "id": "ID",
"title": "タイトル", "title": "タイトル",
"description": "詳細", "description": "詳細",

View File

@@ -258,7 +258,7 @@ export default function RunEditor({
<div className="w-96 h-72"> <div className="w-96 h-72">
<div className="flex items-center"> <div className="flex items-center">
<h4 className="font-bold">{messages.progress}</h4> <h4 className="font-bold">{messages.progress}</h4>
<Tooltip content="Refresh"> <Tooltip content={messages.refresh}>
<Button <Button
isIconOnly isIconOnly
size="sm" size="sm"
@@ -270,7 +270,10 @@ export default function RunEditor({
</Tooltip> </Tooltip>
</div> </div>
<RunProgressChart statusCounts={runStatusCounts} /> <RunProgressChart
statusCounts={runStatusCounts}
messages={messages}
/>
</div> </div>
</div> </div>
<div className="flex-grow"> <div className="flex-grow">

View File

@@ -2,14 +2,15 @@ import React from "react";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import { testRunCaseStatus } from "@/config/selection"; import { testRunCaseStatus } from "@/config/selection";
import { RunStatusCountType } from "@/types/run"; import { RunStatusCountType, RunMessages } from "@/types/run";
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false }); const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
type Props = { type Props = {
statusCounts: RunStatusCountType[]; statusCounts: RunStatusCountType[];
messages: RunMessages;
}; };
export default function RunProgressDounut({ statusCounts }: Props) { export default function RunProgressDounut({ statusCounts, messages }: Props) {
const [chartData, setChartData] = useState({ const [chartData, setChartData] = useState({
series: [], series: [],
options: { options: {
@@ -26,7 +27,7 @@ export default function RunProgressDounut({ statusCounts }: Props) {
return found ? found.count : 0; 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); const colors = testRunCaseStatus.map((entry) => entry.chartColor);
setChartData({ setChartData({

View File

@@ -12,6 +12,7 @@ export default function Page({
updating: t("updating"), updating: t("updating"),
update: t("update"), update: t("update"),
progress: t("progress"), progress: t("progress"),
refresh: t("refresh"),
id: t("id"), id: t("id"),
title: t("title"), title: t("title"),
pleaseEnter: t("please_enter"), pleaseEnter: t("please_enter"),

View File

@@ -43,6 +43,7 @@ type RunMessages = {
updating: string; updating: string;
update: string; update: string;
progress: string, progress: string,
refresh: string,
id: string; id: string;
title: string; title: string;
pleaseEnter: string; pleaseEnter: string;