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/NerdStuffModal.tsx | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/components/NerdStuffModal.tsx') diff --git a/src/components/NerdStuffModal.tsx b/src/components/NerdStuffModal.tsx index b4a79a2..8a79b67 100644 --- a/src/components/NerdStuffModal.tsx +++ b/src/components/NerdStuffModal.tsx @@ -8,6 +8,7 @@ import { ButtonItem } from "@decky/ui"; import { getDllStats, DllStatsResult, getConfigFileContent, getLaunchScriptContent, FileContentResult } from "../api/lsfgApi"; +import t from '../i18n/i18n'; interface NerdStuffModalProps { closeModal?: () => void; @@ -63,7 +64,7 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { return ( {loading && ( -
Loading information...
+
{t('NERD_LOADING', 'Loading information...')}
)} {error && ( @@ -79,26 +80,26 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) {
{dllStats.error || "Failed to get DLL stats"}
) : (
- + dllStats.dll_path && copyToClipboard(dllStats.dll_path)} onActivate={() => dllStats.dll_path && copyToClipboard(dllStats.dll_path)} > - {dllStats.dll_path || "Not available"} + {dllStats.dll_path || t('NERD_NOT_AVAILABLE', 'Not available')} - + dllStats.dll_sha256 && copyToClipboard(dllStats.dll_sha256)} onActivate={() => dllStats.dll_sha256 && copyToClipboard(dllStats.dll_sha256)} > - {dllStats.dll_sha256 ? formatSHA256(dllStats.dll_sha256) : "Not available"} + {dllStats.dll_sha256 ? formatSHA256(dllStats.dll_sha256) : t('NERD_NOT_AVAILABLE', 'Not available')} {dllStats.dll_source && ( - +
{dllStats.dll_source}
)} @@ -109,13 +110,13 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { {/* Launch Script Section */} {scriptContent && ( - + {!scriptContent.success ? ( -
Script not found: {scriptContent.error}
+
{t('NERD_SCRIPT_NOT_FOUND_PREFIX', 'Script not found:')} {scriptContent.error}
) : (
- Path: {scriptContent.path} + {t('NERD_PATH_PREFIX', 'Path:')} {scriptContent.path}
scriptContent.content && copyToClipboard(scriptContent.content)} @@ -130,7 +131,7 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { overflow: "auto", maxHeight: "150px" }}> - {scriptContent.content || "No content"} + {scriptContent.content || t('NERD_NO_CONTENT', 'No content')}
@@ -140,13 +141,13 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { {/* Config File Section */} {configContent && ( - + {!configContent.success ? ( -
Config not found: {configContent.error}
+
{t('NERD_CONFIG_NOT_FOUND_PREFIX', 'Config not found:')} {configContent.error}
) : (
- Path: {configContent.path} + {t('NERD_PATH_PREFIX', 'Path:')} {configContent.path}
configContent.content && copyToClipboard(configContent.content)} @@ -160,7 +161,7 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { whiteSpace: "pre-wrap", overflow: "auto" }}> - {configContent.content || "No content"} + {configContent.content || t('NERD_NO_CONTENT', 'No content')}
@@ -175,7 +176,7 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) { layout="below" onClick={closeModal} > - Close + {t('NERD_CLOSE', 'Close')} -- cgit v1.2.3