From f4e2769d069fcf87da5ec7f39e0d372903bdb810 Mon Sep 17 00:00:00 2001 From: sana2dang Date: Thu, 12 Mar 2026 16:07:04 +0900 Subject: Apply i18n to all UI components with ko/ja translations - Add src/i18n/i18n.ts translation engine (ported from SimpleDeckyTDP) - Add defaults/i18n/{ko,ja,template}.json with 80 translation keys - Add defaults/i18n/language_metadata.json and steam_language_map.json - Add scripts/build_i18n_json.sh to generate languages.json - Apply t() to all 10 components: Content, ConfigurationSection, FlatpaksModal, FpsMultiplierControl, InstallationButton, NerdStuffModal, ProfileManagement, SmartClipboardButton, FgmodClipboardButton, UsageInstructions Co-Authored-By: Claude Sonnet 4.6 --- src/components/ProfileManagement.tsx | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/components/ProfileManagement.tsx') diff --git a/src/components/ProfileManagement.tsx b/src/components/ProfileManagement.tsx index 73a40c7..626d54c 100644 --- a/src/components/ProfileManagement.tsx +++ b/src/components/ProfileManagement.tsx @@ -25,6 +25,7 @@ import { ProfileResult } from "../api/lsfgApi"; import { showSuccessToast, showErrorToast } from "../utils/toastUtils"; +import t from '../i18n/i18n'; const PROFILES_COLLAPSED_KEY = 'lsfg-profiles-collapsed'; @@ -63,8 +64,8 @@ function TextInputModal({

{description}

- @@ -199,10 +200,10 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa const handleCreateProfile = () => { showModal( { if (name.trim()) { createNewProfile(name.trim()); @@ -237,16 +238,16 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa const handleDeleteProfile = () => { if (selectedProfile === "decky-lsfg-vk") { - showErrorToast("Cannot delete default profile", "The default profile cannot be deleted"); + showErrorToast(t('PROFILE_CANNOT_DELETE_TITLE', 'Cannot delete default profile'), t('PROFILE_CANNOT_DELETE_MSG', 'The default profile cannot be deleted')); return; } showModal( deleteSelectedProfile()} /> ); @@ -284,17 +285,17 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa const handleRenameProfile = () => { if (selectedProfile === "decky-lsfg-vk") { - showErrorToast("Cannot rename default profile", "The default profile cannot be renamed"); + showErrorToast(t('PROFILE_CANNOT_RENAME_TITLE', 'Cannot rename default profile'), t('PROFILE_CANNOT_RENAME_MSG', 'The default profile cannot be renamed')); return; } showModal( { if (newName.trim() && newName.trim() !== selectedProfile) { renameSelectedProfile(newName.trim()); @@ -330,11 +331,11 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa const profileOptions: DropdownOption[] = [ ...profiles.map((profile: string) => ({ data: profile, - label: profile === "decky-lsfg-vk" ? "Default" : profile + label: profile === "decky-lsfg-vk" ? t('PROFILE_DEFAULT', 'Default') : profile })), { data: "__NEW_PROFILE__", - label: "New Profile" + label: t('PROFILE_NEW', 'New Profile') } ]; @@ -361,7 +362,7 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa border: "1px solid rgba(0, 255, 0, 0.3)", fontSize: "13px" }}> - {mainRunningApp.display_name} running. Close game to change profile. + {mainRunningApp.display_name} running. {t('PROFILE_CLOSE_GAME', 'Close game to change profile.')}
)} @@ -378,7 +379,7 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa color: "white" }} > - Profile: {selectedProfile === "decky-lsfg-vk" ? "Default" : selectedProfile} + {t('PROFILE_SECTION_TITLE', 'Profile:')} {selectedProfile === "decky-lsfg-vk" ? t('PROFILE_DEFAULT', 'Default') : selectedProfile} -- cgit v1.2.3