From ce078bb132d24b2ad664b207249eb9f49d12c5e3 Mon Sep 17 00:00:00 2001 From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com> Date: Sun, 5 May 2024 18:39:05 +0900 Subject: [PATCH] Apply i18n --- frontend/config/selection.ts | 12 +++---- frontend/messages/en.json | 25 +++++++++++++ frontend/messages/ja.json | 25 +++++++++++++ .../projects/[projectId]/runs/RunsPage.tsx | 9 +++-- .../projects/[projectId]/runs/RunsTable.tsx | 24 +++++++------ .../[projectId]/runs/[runId]/RunEditor.tsx | 36 ++++++++++--------- .../[projectId]/runs/[runId]/page.tsx | 16 ++++++++- .../projects/[projectId]/runs/page.tsx | 20 ++++++++++- frontend/types/run.ts | 29 ++++++++++++++- 9 files changed, 157 insertions(+), 39 deletions(-) diff --git a/frontend/config/selection.ts b/frontend/config/selection.ts index 74b794d..d812141 100644 --- a/frontend/config/selection.ts +++ b/frontend/config/selection.ts @@ -31,12 +31,12 @@ const automationStatus = [ const templates = [{ uid: "text" }, { uid: "step" }]; const testRunStatus = [ - { name: "New", uid: "new" }, - { name: "In progress", uid: "in-progress" }, - { name: "Under review", uid: "under-review" }, - { name: "Rejected", uid: "rejected" }, - { name: "Done", uid: "done" }, - { name: "Closed", uid: "closed" }, + { uid: "new" }, + { uid: "inProgress" }, + { uid: "underReview" }, + { uid: "rejected" }, + { uid: "done" }, + { uid: "closed" }, ]; const testRunCaseStatus = [ diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 3444f9b..7777db4 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -100,8 +100,31 @@ "max_file_size": "Max. file size" }, "Runs": { + "runs": "Test Runs", + "id": "ID", + "name": "Name", + "description": "Description", + "last_update": "Last update", + "actions": "Actions", + "new_run": "New Run", + "delete_run": "Delete Run", + "no_runs_found": "No runs found" + }, + "Run": { + "back_to_runs": "Back to test runs", + "updating": "Updating...", + "update": "Update", + "progress": "Progress", "id": "ID", "title": "Title", + "please_enter": "Please enter run name", + "description": "Description", + "new": "New", + "inProgress": "In progress", + "underReview": "Under review", + "rejected": "Rejected", + "done": "Done", + "closed": "Closed", "priority": "Priority", "status": "Status", "actions": "Actions", @@ -114,6 +137,8 @@ "failed": "Failed", "retest": "Retest", "skipped": "Skipped", + "select_test_case": "Select test cases", + "test_case_selection": "Test case selection", "include_in_run": "Include in run", "exclude_from_run": "Exclude from run", "no_cases_found": "No cases found" diff --git a/frontend/messages/ja.json b/frontend/messages/ja.json index ec182b1..89930be 100644 --- a/frontend/messages/ja.json +++ b/frontend/messages/ja.json @@ -100,8 +100,31 @@ "max_file_size": "最大ファイルサイズ" }, "Runs": { + "runs": "テストラン", + "id": "ID", + "name": "名前", + "description": "詳細", + "last_update": "最終更新", + "actions": "アクション", + "new_run": "新規テストラン", + "delete_run": "テストランを削除", + "no_runs_found": "テストランがありません" + }, + "Run": { + "back_to_runs": "テストラン一覧に戻る", + "updating": "更新中...", + "update": "更新", + "progress": "進捗", "id": "ID", "title": "タイトル", + "description": "詳細", + "new": "新規", + "inProgress": "進行中", + "underReview": "レビュー中", + "rejected": "却下", + "done": "完了", + "closed": "クローズ", + "please_enter": "タイトルを入力してください", "priority": "優先度", "status": "ステータス", "actions": "アクション", @@ -114,6 +137,8 @@ "failed": "失敗", "retest": "再テスト", "skipped": "スキップ", + "select_test_case": "テストケースを選択", + "test_case_selection": "テストケース選択", "include_in_run": "テストランに含める", "exclude_from_run": "テストランから除外する", "no_cases_found": "テストケースが見つかりません" diff --git a/frontend/src/app/[locale]/projects/[projectId]/runs/RunsPage.tsx b/frontend/src/app/[locale]/projects/[projectId]/runs/RunsPage.tsx index ca761fe..e49f6a0 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/runs/RunsPage.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/runs/RunsPage.tsx @@ -4,13 +4,15 @@ import { Button } from "@nextui-org/react"; import { Plus } from "lucide-react"; import RunsTable from "./RunsTable"; import { fetchRuns, createRun, deleteRun } from "./runsControl"; +import { RunsMessages } from "@/types/run"; type Props = { projectId: string; locale: string; + messages: RunsMessages; }; -export default function RunsPage({ projectId, locale }: Props) { +export default function RunsPage({ projectId, locale, messages }: Props) { const [runs, setRuns] = useState([]); useEffect(() => { @@ -50,7 +52,7 @@ export default function RunsPage({ projectId, locale }: Props) { return (