Skip to content

Commit 565d1f5

Browse files
committed
Added i18n support for "other" and "modpacks" categories
1 parent 3041270 commit 565d1f5

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

src/components/settings-components/SettingsView.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -235,48 +235,48 @@ let settingsList = [
235235
),
236236
new SettingsRow(
237237
'other',
238-
'Toggle funky mode',
239-
'Enable/disable funky mode.',
238+
t('translations.pages.settings.other.toggleFunkyMode.title'),
239+
t('translations.pages.settings.other.toggleFunkyMode.description'),
240240
async () => {
241241
return settings.value.getContext().global.funkyModeEnabled
242-
? 'Current: enabled'
243-
: 'Current: disabled (default)';
242+
? t('translations.pages.settings.other.toggleFunkyMode.states.enabled')
243+
: t('translations.pages.settings.other.toggleFunkyMode.states.disabled');
244244
},
245245
'fa-exchange-alt',
246246
() => emitInvoke('ToggleFunkyMode')
247247
),
248248
new SettingsRow(
249249
'other',
250-
'Switch theme',
251-
'Switch between light and dark themes.',
250+
t('translations.pages.settings.other.switchTheme.title'),
251+
t('translations.pages.settings.other.switchTheme.description'),
252252
async () => {
253253
return settings.value.getContext().global.darkTheme
254-
? 'Current: dark theme'
255-
: 'Current: light theme (default)';
254+
? t('translations.pages.settings.other.switchTheme.themes.dark')
255+
: t('translations.pages.settings.other.switchTheme.themes.light');
256256
},
257257
'fa-exchange-alt',
258258
() => emitInvoke('SwitchTheme')
259259
),
260260
new SettingsRow(
261261
'other',
262-
'Switch card display type',
263-
'Switch between expanded or collapsed cards.',
262+
t('translations.pages.settings.other.switchCardDisplayType.title'),
263+
t('translations.pages.settings.other.switchCardDisplayType.description'),
264264
async () => {
265265
return settings.value.getContext().global.expandedCards
266-
? 'Current: expanded'
267-
: 'Current: collapsed (default)';
266+
? t('translations.pages.settings.other.switchCardDisplayType.states.expanded')
267+
: t('translations.pages.settings.other.switchCardDisplayType.states.collapsed');
268268
},
269269
'fa-exchange-alt',
270270
() => emitInvoke('SwitchCard')
271271
),
272272
new SettingsRow(
273273
'other',
274-
'Refresh online mod list',
275-
'Check for any new mod releases.',
274+
t('translations.pages.settings.other.refreshOnlineModList.title'),
275+
t('translations.pages.settings.other.refreshOnlineModList.description'),
276276
async () => {
277277
if (store.state.tsMods.isThunderstoreModListUpdateInProgress) {
278278
return store.state.tsMods.thunderstoreModListUpdateStatus
279-
? t(`translations.pages.profileSelection.importProfileModal.states.refresh.refreshStatus.${store.state.tsMods.thunderstoreModListUpdateStatus}`)
279+
? t(`translations.pages.splash.states.${store.state.tsMods.thunderstoreModListUpdateStatus}`)
280280
: t('translations.pages.settings.other.refreshOnlineModList.states.refreshing');
281281
}
282282
if (store.state.tsMods.thunderstoreModListUpdateError) {
@@ -288,15 +288,15 @@ let settingsList = [
288288
if (store.state.tsMods.modsLastUpdated !== undefined) {
289289
return t('translations.pages.settings.other.refreshOnlineModList.states.cacheDate', { formattedDate: d(moment(store.state.tsMods.modsLastUpdated).toDate(), 'long', getLocaleMessages().metadata.locale) });
290290
}
291-
return "No API information available";
291+
return t('translations.pages.settings.other.refreshOnlineModList.states.apiUnavailable');
292292
},
293293
'fa-exchange-alt',
294294
async () => await store.dispatch("tsMods/syncPackageList")
295295
),
296296
new SettingsRow(
297297
'other',
298-
'Change game',
299-
'Change the current game',
298+
t('translations.pages.settings.other.changeGame.title'),
299+
t('translations.pages.settings.other.changeGame.description'),
300300
async () => "",
301301
'fa-gamepad',
302302
async () => {
@@ -305,10 +305,10 @@ let settingsList = [
305305
}
306306
),
307307
new SettingsRow(
308-
'Modpacks',
309-
'Show dependency strings',
310-
'View a list of installed mods with their version strings. Used inside the dependencies array inside the manifest.json file.',
311-
async () => `Show dependency strings for ${localModList.value.length} mod(s)`,
308+
'modpacks',
309+
t('translations.pages.settings.modpacks.showDependencyStrings.title'),
310+
t('translations.pages.settings.modpacks.showDependencyStrings.description'),
311+
async () => t('translations.pages.settings.modpacks.showDependencyStrings.value', localModList.value.length),
312312
'fa-file-alt',
313313
() => emitInvoke('ShowDependencyStrings')
314314
),

src/i18n/en/pages/SettingsTranslation.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,23 @@ export const SettingsTranslation: SettingsMessageFormat = {
168168
errorRefreshing: 'There was a problem refreshing the mod list: {errorText}',
169169
disabledWhilstDownloading: 'Refreshing the mod list is disabled whilst there are active downloads',
170170
cacheDate: 'Cache date: {formattedDate}',
171+
apiUnavailable: 'No API information available',
171172
}
172173
},
173174
changeGame: {
174175
title: 'Change game',
175176
description: 'Change the current game.',
176177
}
178+
},
179+
modpacks: {
180+
showDependencyStrings: {
181+
title: 'Show dependency strings',
182+
description: 'View a list of installed mods with their version strings. Used inside the dependencies array inside the manifest.json file.',
183+
value: `
184+
No dependency strings as there are no mods installed |
185+
Show dependency strings for 1 mod |
186+
Show dependency strings for {n} mods
187+
`
188+
}
177189
}
178190
}

0 commit comments

Comments
 (0)