|
17 | 17 | import { getModalStore, getToastStore, type ModalSettings } from '@skeletonlabs/skeleton'; |
18 | 18 | import EditCompatibilityModal from '$lib/modals/EditCompatibilityModal.svelte'; |
19 | 19 | import Page404 from '$lib/components/general/Page404.svelte'; |
| 20 | + import { getTranslate } from '@tolgee/svelte'; |
20 | 21 |
|
21 | 22 | export let data: PageData; |
22 | 23 |
|
| 24 | + export const { t } = getTranslate(); |
| 25 | +
|
23 | 26 | $: ({ modId, mod } = data); |
24 | 27 |
|
25 | 28 | const client = getContextClient(); |
|
46 | 49 | }); |
47 | 50 | } else { |
48 | 51 | toastStore.trigger({ |
49 | | - message: `Mod deleted`, |
| 52 | + message: $t('mod.toast.mod-deleted'), |
50 | 53 | background: 'variant-filled-success', |
51 | 54 | timeout: 5000 |
52 | 55 | }); |
|
57 | 60 |
|
58 | 61 | const deleteModal: ModalSettings = { |
59 | 62 | type: 'confirm', |
60 | | - title: 'Delete Mod?', |
61 | | - body: 'Are you sure you wish to delete this mod?', |
| 63 | + title: $t('mod.modal.delete.title'), |
| 64 | + body: $t('mod.modal.delete.text'), |
62 | 65 | response: (r: boolean) => { |
63 | 66 | if (r) { |
64 | 67 | deleteModFn(); |
|
103 | 106 | {#if canUserEdit} |
104 | 107 | <button class="variant-ghost-primary btn" on:click={() => goto(base + '/mod/' + modId + '/edit')}> |
105 | 108 | <span class="material-icons pr-2">edit</span> |
106 | | - Edit</button> |
| 109 | + {$t('mod.edit')}</button> |
107 | 110 | <button class="variant-ghost-primary btn" on:click={() => modalStore.trigger(deleteModal)}> |
108 | 111 | <span class="material-icons pr-2">delete_forever</span> |
109 | | - Delete</button> |
| 112 | + {$t('mod.delete')}</button> |
110 | 113 | <button class="variant-ghost-primary btn" on:click={() => goto(base + '/mod/' + modId + '/new-version')}> |
111 | 114 | <span class="material-icons pr-2">upload_file</span> |
112 | | - New Version</button> |
| 115 | + {$t('mod.new-version')}</button> |
113 | 116 | {/if} |
114 | 117 | {#if canUserEditCompatibility} |
115 | 118 | <button class="variant-ghost-primary btn" on:click={() => modalStore.trigger(editCompatibilityModal)}> |
116 | 119 | <span class="material-icons">rocket_launch</span> |
117 | 120 | <span class="material-icons pr-2">science</span> |
118 | | - Edit Compatibility</button> |
| 121 | + {$t('mod.edit-compatibility')}</button> |
119 | 122 | {/if} |
120 | 123 | <button class="variant-ghost-primary btn" on:click={() => (versionsTab = !versionsTab)}> |
121 | 124 | {#if !versionsTab} |
122 | 125 | <span class="material-icons pr-2" title="Browse all uploaded versions of this mod">view_list</span> |
123 | | - View Versions |
| 126 | + {$t('mod.view-versions')} |
124 | 127 | {:else} |
125 | 128 | <span class="material-icons pr-2" title="View the description page for this mod">description</span> |
126 | | - View Description |
| 129 | + {$t('mod.view-description')} |
127 | 130 | {/if} |
128 | 131 | </button> |
129 | 132 | </div> |
|
0 commit comments