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...",
"update": "Update",
"progress": "Progress",
"refresh": "Refresh",
"id": "ID",
"title": "Title",
"please_enter": "Please enter run name",

View File

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

View File

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

View File

@@ -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({

View File

@@ -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"),

View File

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