Skip to content

Commit c4538fe

Browse files
committed
Added i18n support for conditional settings
1 parent cb56033 commit c4538fe

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

src/components/settings-components/SettingsView.vue

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -324,26 +324,26 @@ onMounted(async () => {
324324
if ([Platform.STEAM, Platform.STEAM_DIRECT].includes(activeGame.value.activePlatform.storePlatform)) {
325325
settingsList.push(
326326
new SettingsRow(
327-
'Locations',
328-
'Change Steam folder',
329-
`Change the location of the Steam folder that ${appName.value} uses.`,
327+
'locations',
328+
t('translations.pages.settings.locations.changeSteamFolder.title'),
329+
t('translations.pages.settings.locations.changeSteamFolder.description', { appName: appName.value }),
330330
async () => {
331331
if (settings.value.getContext().global.steamDirectory !== null) {
332332
const directory = await GameDirectoryResolverProvider.instance.getSteamDirectory();
333333
if (!(directory instanceof R2Error)) {
334334
return directory;
335335
}
336336
}
337-
return 'Please set manually';
337+
return t('translations.pages.settings.locations.changeSteamFolder.state.setManually');
338338
},
339339
'fa-folder-open',
340340
() => emitInvoke('ChangeSteamDirectory')
341341
),
342342
new SettingsRow(
343-
'Debugging',
344-
`Reset ${activeGame.value.displayName} installation`,
345-
'Fix problems caused by corrupted files or files left over from manual modding attempts.',
346-
async () => `This will delete all contents of the ${activeGame.value.steamFolderName} folder, and verify the files through Steam`,
343+
'debugging',
344+
t('translations.pages.settings.debugging.resetGameInstallation.title', { gameName: activeGame.value.displayName }),
345+
t('translations.pages.settings.debugging.resetGameInstallation.description'),
346+
async () => t('translations.pages.settings.debugging.resetGameInstallation.value', { folderName: activeGame.value.steamFolderName }),
347347
'fa-wrench',
348348
() => emitInvoke('ValidateSteamInstallation')
349349
)
@@ -353,13 +353,10 @@ onMounted(async () => {
353353
if (['linux', 'darwin'].includes(process.platform) && activeGame.value.activePlatform.storePlatform === Platform.STEAM) {
354354
settingsList.push(
355355
new SettingsRow(
356-
'Debugging',
357-
'Change launch behaviour',
358-
'Select specific launch behaviour such as forcing Steam to launch with Proton',
359-
async () => {
360-
const launchType = await getLaunchType(activeGame.value);
361-
return `The current launch behaviour is set to: ${launchType}`;
362-
},
356+
'debugging',
357+
t('translations.pages.settings.debugging.changeLaunchBehaviour.title'),
358+
t('translations.pages.settings.debugging.changeLaunchBehaviour.description'),
359+
async () => t('translations.pages.settings.debugging.changeLaunchBehaviour.value', { launchType: await getLaunchType(activeGame.value) }),
363360
'fa-gamepad',
364361
() => {
365362
LaunchTypeModalOpen.value = true;

src/i18n/en/pages/SettingsTranslation.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export const SettingsTranslation: SettingsMessageFormat = {
2222
changeDataFolder: {
2323
title: 'Change data folder',
2424
description: 'Change the folder where mods are stored for all games and profiles. The folder will not be deleted, and existing profiles will not carry across.',
25+
},
26+
changeSteamFolder: {
27+
title: `Change {''}@:translations.platforms.STEAM{''} folder`,
28+
description: `Change the location of the @:translations.platforms.STEAM folder that {appName} uses.`,
29+
state: {
30+
setManually: 'You must click this setting and locate the folder manually'
31+
}
2532
}
2633
},
2734
debugging: {
@@ -67,6 +74,16 @@ export const SettingsTranslation: SettingsMessageFormat = {
6774
title: 'Toggle preferred Thunderstore CDN',
6875
description: 'Switch the CDN until app is restarted. This might bypass issues with downloading mods.',
6976
current: 'Current: {label} ({url})'
77+
},
78+
resetGameInstallation: {
79+
title: 'Reset {gameName} installation',
80+
description: 'Fix problems caused by corrupted files or files left over from manual modding attempts.',
81+
value: `This will delete all contents of the "{folderName}" folder and will verify files using @:translations.platforms.STEAM`
82+
},
83+
changeLaunchBehaviour: {
84+
title: 'Change launch behaviour',
85+
description: 'Select a specific launch behaviour such as forcing Steam to launch with Proton',
86+
value: `The current launch behaviour is set to: @:translations.enums.launchType.{launchType}`
7087
}
7188
},
7289
profile: {

0 commit comments

Comments
 (0)