From fb27fbf3b1c6a6930bcf5185ca46cbdfee0f0550 Mon Sep 17 00:00:00 2001 From: kyy Date: Mon, 16 Mar 2026 16:43:25 +0900 Subject: [PATCH] =?UTF-8?q?i18n=20=EB=88=84=EB=9D=BD=20=ED=82=A4=20?= =?UTF-8?q?=EB=B3=B4=EC=99=84=20=EB=B0=8F=20biome=20=ED=8F=AC=EB=A7=B7=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devfront/src/components/layout/AppLayout.tsx | 16 ++++++--- devfront/src/features/profile/ProfilePage.tsx | 33 ++++++++++++++----- devfront/src/lib/role.ts | 4 ++- .../tests/devfront-role-switch-report.spec.ts | 16 ++++++--- locales/en.toml | 25 ++++++++++++++ locales/ko.toml | 25 ++++++++++++++ locales/template.toml | 25 ++++++++++++++ 7 files changed, 126 insertions(+), 18 deletions(-) diff --git a/devfront/src/components/layout/AppLayout.tsx b/devfront/src/components/layout/AppLayout.tsx index cdb98dcb..64ed2759 100644 --- a/devfront/src/components/layout/AppLayout.tsx +++ b/devfront/src/components/layout/AppLayout.tsx @@ -111,7 +111,7 @@ function AppLayout() { const currentRole = resolveProfileRole( auth.user?.profile as Record | undefined, ); - + // Use profile.role from API if available, otherwise fallback to local role const displayRoleKey = profile?.role || currentRole; @@ -331,12 +331,18 @@ function AppLayout() {
{t("ui.dev.profile.org.tenant", "테넌트")}
- {displayTenant} -
{displayTenant}
@@ -178,7 +192,10 @@ function ProfilePage() { {t("ui.dev.profile.role.current", "Current Role")}
- {t(`ui.common.role.${profile.role}`, profile.role.toUpperCase())} + {t( + `ui.common.role.${profile.role}`, + profile.role.toUpperCase(), + )}
{t( diff --git a/devfront/src/lib/role.ts b/devfront/src/lib/role.ts index f4400c72..9a5a2dc8 100644 --- a/devfront/src/lib/role.ts +++ b/devfront/src/lib/role.ts @@ -9,7 +9,9 @@ export function normalizeRole(rawRole: unknown): string { return role; } -export function resolveProfileRole(profile: Record | undefined) { +export function resolveProfileRole( + profile: Record | undefined, +) { if (!profile) return ""; const candidates = [ profile.role, diff --git a/devfront/tests/devfront-role-switch-report.spec.ts b/devfront/tests/devfront-role-switch-report.spec.ts index 6fcf659d..6faedf92 100644 --- a/devfront/tests/devfront-role-switch-report.spec.ts +++ b/devfront/tests/devfront-role-switch-report.spec.ts @@ -93,8 +93,12 @@ test.describe("DevFront role report", () => { await page .getByPlaceholder("My Awesome Application") .fill("Tenant A CRM Updated"); - - const updatePromise = page.waitForResponse(r => r.url().includes('/api/v1/dev/clients') && r.request().method() === 'PUT'); + + const updatePromise = page.waitForResponse( + (r) => + r.url().includes("/api/v1/dev/clients") && + r.request().method() === "PUT", + ); await page.getByRole("button", { name: /^저장$|^Save$/i }).click(); await updatePromise; @@ -133,8 +137,12 @@ test.describe("DevFront role report", () => { await page .getByPlaceholder(/https:\/\/app\.example\.com\/callback/i) .fill("https://super-admin.example.com/callback"); - - const createPromise = page.waitForResponse(r => r.url().includes('/api/v1/dev/clients') && r.request().method() === 'POST'); + + const createPromise = page.waitForResponse( + (r) => + r.url().includes("/api/v1/dev/clients") && + r.request().method() === "POST", + ); await page.getByRole("button", { name: /앱 생성|Create/i }).click(); await createPromise; diff --git a/locales/en.toml b/locales/en.toml index aebc6602..321bf730 100644 --- a/locales/en.toml +++ b/locales/en.toml @@ -1160,6 +1160,31 @@ menu_aria = "Open account menu" menu_title = "Account" unknown_email = "unknown@example.com" unknown_name = "Unknown User" +title = "My Profile" +subtitle = "View user details and assigned roles." +loading = "Loading profile..." +error = "Failed to load profile." + +[ui.dev.profile.tab] +basic = "Basic Info" +role = "Roles & Permissions" + +[ui.dev.profile.basic] +title = "User Info" +id = "User ID" +name = "Name" +email = "Email" +phone = "Phone Number" + +[ui.dev.profile.org] +title = "Organization Info" +tenant = "Tenant" +company_code = "Company Code" + +[ui.dev.profile.role] +title = "System Role" +description = "The permission level granted to this account." +current = "Current Role" [ui.dev.clients] copy_client_id = "Copy client id" diff --git a/locales/ko.toml b/locales/ko.toml index b97c29a6..4fda16f5 100644 --- a/locales/ko.toml +++ b/locales/ko.toml @@ -1160,6 +1160,31 @@ menu_aria = "계정 메뉴 열기" menu_title = "계정" unknown_email = "unknown@example.com" unknown_name = "Unknown User" +title = "내 정보" +subtitle = "사용자 상세 정보 및 할당된 역할(Role)을 확인합니다." +loading = "프로필 정보를 불러오는 중..." +error = "프로필 정보를 불러오지 못했습니다." + +[ui.dev.profile.tab] +basic = "기본 정보" +role = "권한 및 역할" + +[ui.dev.profile.basic] +title = "사용자 정보" +id = "사용자 ID" +name = "이름" +email = "이메일" +phone = "전화번호" + +[ui.dev.profile.org] +title = "조직 정보" +tenant = "테넌트" +company_code = "회사 코드" + +[ui.dev.profile.role] +title = "시스템 역할" +description = "현재 계정에 부여된 권한 등급입니다." +current = "현재 역할" [ui.dev.clients] copy_client_id = "Copy client id" diff --git a/locales/template.toml b/locales/template.toml index 77613d27..0cfb9081 100644 --- a/locales/template.toml +++ b/locales/template.toml @@ -1025,6 +1025,31 @@ menu_aria = "" menu_title = "" unknown_email = "" unknown_name = "" +title = "" +subtitle = "" +loading = "" +error = "" + +[ui.dev.profile.tab] +basic = "" +role = "" + +[ui.dev.profile.basic] +title = "" +id = "" +name = "" +email = "" +phone = "" + +[ui.dev.profile.org] +title = "" +tenant = "" +company_code = "" + +[ui.dev.profile.role] +title = "" +description = "" +current = "" [ui.dev.clients] new = ""