22 <div >
33 <ModalCard id =" select-platform-modal" v-show =" showPlatformModal" :is-active =" showPlatformModal" @close-modal =" () => {showPlatformModal = false;}" class =" z-max z-top" >
44 <template v-slot :header >
5- <h2 class =' modal-title' >{{ t(" translations.pages.gameSelection.platformModal.header" ) }}</h2 >
5+ <h2 class =' modal-title' >{{ t(' translations.pages.gameSelection.platformModal.header' ) }}</h2 >
66 </template >
77 <template v-slot :body >
88 <div v-if =" selectedGame !== null" >
99 <div v-for =" (platform, index) of selectedGame.storePlatformMetadata" :key =" `${index}-${platform.storePlatform}`" >
1010 <input type =" radio" :id =" `${index}-${platform.storePlatform}`" :value =" platform.storePlatform" v-model =" selectedPlatform" />
11- <label :for =" `${index}-${platform.storePlatform}`" ><span class =" margin-right margin-right--half-width" />{{ platformLabels[ platform.storePlatform] }}</label >
11+ <label :for =" `${index}-${platform.storePlatform}`" ><span class =" margin-right margin-right--half-width" />{{ t(`translations.platforms.${getPlatformKey( platform.storePlatform)}`) }}</label >
1212 </div >
1313 </div >
1414 </template >
1515 <template v-slot :footer >
1616 <button class =' button is-info' @click =' selectPlatform' >
17- Select platform
17+ {{ t('translations.pages.gameSelection.platformModal.selectAction') }}
1818 </button >
1919 </template >
2020 </ModalCard >
2121 <hero
22- :title =" `${capitalize(activeTab)} selection`"
23- :subtitle ="
24- activeTab === GameInstanceType.GAME
25- ? 'Which game are you managing your mods for?'
26- : 'Which dedicated server are you managing your mods for?'
27- "
22+ :title =" t(`translations.pages.gameSelection.pageTitle.title.${activeTab}`)"
23+ :subtitle =" t(`translations.pages.gameSelection.pageTitle.subtitle.${activeTab}`)"
2824 :heroType =" activeTab === GameInstanceType.GAME ? 'primary' : 'warning'"
2925 />
3026 <div class =" notification is-warning is-square" v-if =" runningMigration" >
3127 <div class =" container" >
32- <p >An update to the manager has occurred and needs to do background work. </p >
33- <p >The options to select a game are disabled until the work has completed. </p >
28+ <p >{{ t('translations.pages.gameSelection.migrationNotice.requiresUpdate') }} </p >
29+ <p >{{ t('translations.pages.gameSelection.migrationNotice.actionsDisabled') }} </p >
3430 </div >
3531 </div >
3632 <div class =" columns" >
4642 id =" game-selection-list-search"
4743 class =" input margin-right"
4844 type =" text"
49- placeholder =" Search for a game "
45+ : placeholder =" t(`translations.pages.gameSelection.filter.placeholder.${activeTab}`) "
5046 autocomplete =" off"
5147 />
5248 </div >
5349 </div >
5450 </div >
5551 <div class =" margin-right" >
5652 <button class =" button is-info"
57- :disabled =" !isAnyGameSelected() && !runningMigration" @click =" selectGame(selectedGame)" >Select {{ activeTab.toLowerCase( ) }}</button >
53+ :disabled =" !isAnyGameSelected() && !runningMigration" @click =" selectGame(selectedGame)" >{{ t(`translations.pages.gameSelection.actions.select.${activeTab}` ) }}</button >
5854 </div >
5955 <div class =" margin-right" >
6056 <button class =" button"
61- :disabled =" !isAnyGameSelected() && !runningMigration" @click =" selectDefaultGame(selectedGame)" >Set as default </button >
57+ :disabled =" !isAnyGameSelected() && !runningMigration" @click =" selectDefaultGame(selectedGame)" >{{ t('translations.pages.gameSelection.actions.setAsDefault') }} </button >
6258 </div >
6359 <div >
6460 <i class =" button fas fa-th-large" @click =" toggleViewMode" ></i >
7369 id =" game-selection-cards-search"
7470 class =" input margin-right"
7571 type =" text"
76- placeholder =" Search for a game "
72+ : placeholder =" t(`translations.pages.gameSelection.filter.placeholder.${activeTab}`) "
7773 autocomplete =" off"
7874 />
7975 </div >
8985 <ul class =" text-center" >
9086 <li v-for =" (value) in GameInstanceType" :key =" `tab-${value}`"
9187 :class =" [{'is-active': activeTab === value}]" >
92- <a @click =" changeTab(value)" >{{capitalize( value) }}</a >
88+ <a @click =" changeTab(value)" >{{ t(`translations.pages.gameSelection.tabs.${ value}`) }}</a >
9389 </li >
9490 </ul >
9591 </div >
141137 </p >
142138 </div >
143139 <div class =" absolute-center text-center" >
144- <button class =" button is-info" @click =" selectGame(game)" :class =" [{'is-disabled': selectedGame === null}]" >Select
145- {{ activeTab.toLowerCase() }}</button >
140+ <button class =" button is-info" @click =" selectGame(game)" :class =" [{'is-disabled': selectedGame === null}]" >
141+ {{ t(`translations.pages.gameSelection.actions.select.${activeTab}`) }}
142+ </button >
146143 <br /><br />
147- <button class =" button" @click =" selectDefaultGame(game)" >Set as default</button >
144+ <button class =" button" @click =" selectDefaultGame(game)" >
145+ {{ t('translations.pages.gameSelection.actions.setAsDefault') }}
146+ </button >
148147 </div >
149148 </div >
150149 </div >
@@ -190,6 +189,7 @@ import { State } from '../store';
190189import { useRouter } from ' vue-router' ;
191190import ProtocolProvider from ' ../providers/generic/protocol/ProtocolProvider' ;
192191import { useI18n } from ' vue-i18n' ;
192+ import EnumResolver from ' ../model/enums/_EnumResolver' ;
193193
194194const store = getStore <State >();
195195const router = useRouter ();
@@ -207,6 +207,10 @@ const viewMode = ref<GameSelectionViewMode>(GameSelectionViewMode.LIST);
207207const activeTab = ref <GameInstanceType >(GameInstanceType .GAME );
208208const gameImages = reactive ({});
209209
210+ function getPlatformKey(platform : Platform ) {
211+ return EnumResolver .from (Platform , platform );
212+ }
213+
210214const filteredGameList = computed (() => {
211215 const displayNameInAdditionalSearch = (game : Game , filterText : string ): boolean => {
212216 return game .additionalSearchStrings .find (value => value .toLowerCase ().trim ().indexOf (filterText .toLowerCase ().trim ()) >= 0 ) !== undefined ;
@@ -280,16 +284,6 @@ function selectDefaultGame(game: Game) {
280284 }
281285}
282286
283- const platformLabels = {
284- [Platform .STEAM ]: " Steam" ,
285- [Platform .STEAM_DIRECT ]: " Steam" ,
286- [Platform .EPIC_GAMES_STORE ]: " Epic Games Store" ,
287- [Platform .OCULUS_STORE ]: " Oculus Store" ,
288- [Platform .ORIGIN ]: " Origin / EA Desktop" ,
289- [Platform .XBOX_GAME_PASS ]: " Xbox Game Pass" ,
290- [Platform .OTHER ]: " Other"
291- }
292-
293287function selectPlatform() {
294288 if (isSettingDefaultPlatform .value ) {
295289 proceedDefault ()
0 commit comments