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/FlatpaksModal.tsx | 91 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 45 deletions(-) (limited to 'src/components/FlatpaksModal.tsx') diff --git a/src/components/FlatpaksModal.tsx b/src/components/FlatpaksModal.tsx index a80fff0..16d0369 100644 --- a/src/components/FlatpaksModal.tsx +++ b/src/components/FlatpaksModal.tsx @@ -27,6 +27,7 @@ import { FlatpakApp, FlatpakAppInfo } from '../api/lsfgApi'; +import t from '../i18n/i18n'; interface FlatpaksModalProps { closeModal?: () => void; @@ -116,7 +117,7 @@ export const FlatpaksModal: FC = ({ closeModal }) => { if (loading) { return ( - Flatpak Extensions + {t('FLATPAK_MODAL_TITLE', 'Flatpak Extensions')}
@@ -129,17 +130,17 @@ export const FlatpaksModal: FC = ({ closeModal }) => { const instructionSteps = [ { id: 'try-first', - title: 'Try first:', + title: t('FLATPAK_STEP_TRY_FIRST', 'Try first:'), command: '~/lsfg' }, { id: 'try-full-path', - title: "If that doesn't work, try full path:", + title: t('FLATPAK_STEP_TRY_FULL_PATH', "If that doesn't work, try full path:"), command: '/home/(username)/lsfg' }, { id: 'final-result', - title: 'Final result should look like:', + title: t('FLATPAK_STEP_FINAL', 'Final result should look like:'), command: '~/lsfg "usr/bin/flatpak"' } ]; @@ -162,20 +163,20 @@ export const FlatpaksModal: FC = ({ closeModal }) => { return ( - Flatpak Extensions + {t('FLATPAK_MODAL_TITLE', 'Flatpak Extensions')} {/* Extension Status Section */} - Runtime Extension Installer + {t('FLATPAK_RUNTIME_INSTALLER', 'Runtime Extension Installer')} {extensionStatus && extensionStatus.success ? ( <> {/* 23.08 Runtime */} - : } > = ({ closeModal }) => { if (operation === 'uninstall') { confirmOperation( action, - 'Uninstall Runtime Extension', - 'Are you sure you want to uninstall the 23.08 runtime extension?' + t('FLATPAK_UNINSTALL_TITLE', 'Uninstall Runtime Extension'), + `${t('FLATPAK_UNINSTALL_CONFIRM_PREFIX', 'Are you sure you want to uninstall the')} 23.08 ${t('FLATPAK_UNINSTALL_CONFIRM_SUFFIX', 'runtime extension?')}` ); } else { action(); @@ -200,11 +201,11 @@ export const FlatpaksModal: FC = ({ closeModal }) => { ) : extensionStatus.installed_23_08 ? ( <> - Uninstall + {t('FLATPAK_UNINSTALL_BTN', 'Uninstall')} ) : ( <> - Install + {t('FLATPAK_INSTALL_BTN', 'Install')} )} @@ -213,9 +214,9 @@ export const FlatpaksModal: FC = ({ closeModal }) => { {/* 24.08 Runtime */} - : } > = ({ closeModal }) => { if (operation === 'uninstall') { confirmOperation( action, - 'Uninstall Runtime Extension', - 'Are you sure you want to uninstall the 24.08 runtime extension?' + t('FLATPAK_UNINSTALL_TITLE', 'Uninstall Runtime Extension'), + `${t('FLATPAK_UNINSTALL_CONFIRM_PREFIX', 'Are you sure you want to uninstall the')} 24.08 ${t('FLATPAK_UNINSTALL_CONFIRM_SUFFIX', 'runtime extension?')}` ); } else { action(); @@ -240,11 +241,11 @@ export const FlatpaksModal: FC = ({ closeModal }) => { ) : extensionStatus.installed_24_08 ? ( <> - Uninstall + {t('FLATPAK_UNINSTALL_BTN', 'Uninstall')} ) : ( <> - Install + {t('FLATPAK_INSTALL_BTN', 'Install')} )} @@ -253,9 +254,9 @@ export const FlatpaksModal: FC = ({ closeModal }) => { {/* 25.08 Runtime */} - : } > = ({ closeModal }) => { if (operation === 'uninstall') { confirmOperation( action, - 'Uninstall Runtime Extension', - 'Are you sure you want to uninstall the 25.08 runtime extension?' + t('FLATPAK_UNINSTALL_TITLE', 'Uninstall Runtime Extension'), + `${t('FLATPAK_UNINSTALL_CONFIRM_PREFIX', 'Are you sure you want to uninstall the')} 25.08 ${t('FLATPAK_UNINSTALL_CONFIRM_SUFFIX', 'runtime extension?')}` ); } else { action(); @@ -280,11 +281,11 @@ export const FlatpaksModal: FC = ({ closeModal }) => { ) : extensionStatus.installed_25_08 ? ( <> - Uninstall + {t('FLATPAK_UNINSTALL_BTN', 'Uninstall')} ) : ( <> - Install + {t('FLATPAK_INSTALL_BTN', 'Install')} )} @@ -293,9 +294,9 @@ export const FlatpaksModal: FC = ({ closeModal }) => { ) : ( - } /> @@ -304,7 +305,7 @@ export const FlatpaksModal: FC = ({ closeModal }) => { {/* Flatpak Apps Section */} - Flatpak Applications + {t('FLATPAK_APPS_TITLE', 'Flatpak Applications')} {flatpakApps && flatpakApps.success ? ( flatpakApps.apps.length > 0 ? ( @@ -313,14 +314,14 @@ export const FlatpaksModal: FC = ({ closeModal }) => { const partialOverrides = app.has_filesystem_override || app.has_env_override; let statusColor = 'red'; - let statusText = 'No overrides'; + let statusText = t('FLATPAK_STATUS_NO_OVERRIDES', 'No overrides'); if (hasOverrides) { statusColor = 'green'; - statusText = 'Configured'; + statusText = t('FLATPAK_STATUS_CONFIGURED', 'Configured'); } else if (partialOverrides) { statusColor = 'orange'; - statusText = 'Partial'; + statusText = t('FLATPAK_STATUS_PARTIAL', 'Partial'); } return ( @@ -341,17 +342,17 @@ export const FlatpaksModal: FC = ({ closeModal }) => { }) ) : ( - ) ) : ( - } /> @@ -360,7 +361,7 @@ export const FlatpaksModal: FC = ({ closeModal }) => { {/* Steam Configuration Instructions */} - Steam Configuration + {t('FLATPAK_STEAM_CONFIG_TITLE', 'Steam Configuration')}
= ({ closeModal }) => { }} >
- Configure Steam Flatpak Shortcuts + {t('FLATPAK_STEAM_CONFIG_HEADER', 'Configure Steam Flatpak Shortcuts')}
- In Steam, open your flatpak game and click the cog wheel. + {t('FLATPAK_STEAM_CONFIG_DESC', 'In Steam, open your flatpak game and click the cog wheel.')}
- IMPORTANT: Set this in TARGET (NOT LAUNCH OPTIONS) + IMPORTANT: {t('FLATPAK_STEAM_CONFIG_IMPORTANT', 'Set this in TARGET (NOT LAUNCH OPTIONS)')}
{instructionSteps.map((step) => ( @@ -421,7 +422,7 @@ export const FlatpaksModal: FC = ({ closeModal }) => { layout="below" onClick={closeModal} > - Close + {t('FLATPAK_CLOSE', 'Close')} -- cgit v1.2.3