Skip to content

Commit 4c8b91e

Browse files
committed
2 parents ba74256 + f0e70ed commit 4c8b91e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+330
-237
lines changed

client/components/app/Appbar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ export default {
332332
libraryItemIds: this.selectedMediaItems.map((i) => i.id)
333333
})
334334
.then(() => {
335-
this.$toast.success('Batch delete success')
335+
this.$toast.success(this.$strings.ToastBatchDeleteSuccess)
336336
this.$store.commit('globals/resetSelectedMediaItems', [])
337337
this.$eventBus.$emit('bookshelf_clear_selection')
338338
})
339339
.catch((error) => {
340340
console.error('Batch delete failed', error)
341-
this.$toast.error('Batch delete failed')
341+
this.$toast.error(this.$strings.ToastBatchDeleteFailed)
342342
})
343343
.finally(() => {
344344
this.$store.commit('setProcessingBatch', false)

client/components/app/BookShelfToolbar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@ export default {
473473
this.$axios
474474
.$get(`/api/me/series/${this.seriesId}/readd-to-continue-listening`)
475475
.then(() => {
476-
this.$toast.success('Series re-added to continue listening')
476+
this.$toast.success(this.$strings.ToastItemUpdateSuccess)
477477
})
478478
.catch((error) => {
479479
console.error('Failed to re-add series to continue listening', error)
480-
this.$toast.error('Failed to re-add series to continue listening')
480+
this.$toast.error(this.$strings.ToastItemUpdateFailed)
481481
})
482482
.finally(() => {
483483
this.processingSeries = false
@@ -504,7 +504,7 @@ export default {
504504
})
505505
if (!response) {
506506
console.error(`Author ${author.name} not found`)
507-
this.$toast.error(`Author ${author.name} not found`)
507+
this.$toast.error(this.$getString('ToastAuthorNotFound', [author.name]))
508508
} else if (response.updated) {
509509
if (response.author.imagePath) console.log(`Author ${response.author.name} was updated`)
510510
else console.log(`Author ${response.author.name} was updated (no image found)`)
@@ -522,13 +522,13 @@ export default {
522522
this.$axios
523523
.$delete(`/api/libraries/${this.currentLibraryId}/issues`)
524524
.then(() => {
525-
this.$toast.success('Removed library items with issues')
525+
this.$toast.success(this.$strings.ToastRemoveItemsWithIssuesSuccess)
526526
this.$router.push(`/library/${this.currentLibraryId}/bookshelf`)
527527
this.$store.dispatch('libraries/fetch', this.currentLibraryId)
528528
})
529529
.catch((error) => {
530530
console.error('Failed to remove library items with issues', error)
531-
this.$toast.error('Failed to remove library items with issues')
531+
this.$toast.error(this.$strings.ToastRemoveItemsWithIssuesFailed)
532532
})
533533
.finally(() => {
534534
this.processingIssues = false

client/components/cards/LazyBookCard.vue

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ export default {
346346
},
347347
displaySortLine() {
348348
if (this.collapsedSeries) return null
349-
if (this.orderBy === 'mtimeMs') return 'Modified ' + this.$formatDate(this._libraryItem.mtimeMs, this.dateFormat)
350-
if (this.orderBy === 'birthtimeMs') return 'Born ' + this.$formatDate(this._libraryItem.birthtimeMs, this.dateFormat)
351-
if (this.orderBy === 'addedAt') return 'Added ' + this.$formatDate(this._libraryItem.addedAt, this.dateFormat)
352-
if (this.orderBy === 'media.duration') return 'Duration: ' + this.$elapsedPrettyExtended(this.media.duration, false)
353-
if (this.orderBy === 'size') return 'Size: ' + this.$bytesPretty(this._libraryItem.size)
354-
if (this.orderBy === 'media.numTracks') return `${this.numEpisodes} Episodes`
349+
if (this.orderBy === 'mtimeMs') return this.$getString('LabelFileModifiedDate', [this.$formatDate(this._libraryItem.mtimeMs, this.dateFormat)])
350+
if (this.orderBy === 'birthtimeMs') return this.$getString('LabelFileBornDate', [this.$formatDate(this._libraryItem.birthtimeMs, this.dateFormat)])
351+
if (this.orderBy === 'addedAt') return this.$getString('LabelAddedDate', [this.$formatDate(this._libraryItem.addedAt, this.dateFormat)])
352+
if (this.orderBy === 'media.duration') return this.$strings.LabelDuration + ': ' + this.$elapsedPrettyExtended(this.media.duration, false)
353+
if (this.orderBy === 'size') return this.$strings.LabelSize + ': ' + this.$bytesPretty(this._libraryItem.size)
354+
if (this.orderBy === 'media.numTracks') return `${this.numEpisodes} ` + this.$strings.LabelEpisodes
355355
if (this.orderBy === 'media.metadata.publishedYear') {
356-
if (this.mediaMetadata.publishedYear) return 'Published ' + this.mediaMetadata.publishedYear
356+
if (this.mediaMetadata.publishedYear) return this.$getString('LabelPublishedDate', [this.mediaMetadata.publishedYear])
357357
return '\u00A0'
358358
}
359359
return null
@@ -710,7 +710,7 @@ export default {
710710
toggleFinished(confirmed = false) {
711711
if (!this.itemIsFinished && this.userProgressPercent > 0 && !confirmed) {
712712
const payload = {
713-
message: `Are you sure you want to mark "${this.displayTitle}" as finished?`,
713+
message: this.$getString('MessageConfirmMarkItemFinished', [this.displayTitle]),
714714
callback: (confirmed) => {
715715
if (confirmed) {
716716
this.toggleFinished(true)
@@ -755,18 +755,18 @@ export default {
755755
.then((data) => {
756756
var result = data.result
757757
if (!result) {
758-
this.$toast.error(`Re-Scan Failed for "${this.title}"`)
758+
this.$toast.error(this.$getString('ToastRescanFailed', [this.displayTitle]))
759759
} else if (result === 'UPDATED') {
760-
this.$toast.success(`Re-Scan complete item was updated`)
760+
this.$toast.success(this.$strings.ToastRescanUpdated)
761761
} else if (result === 'UPTODATE') {
762-
this.$toast.success(`Re-Scan complete item was up to date`)
762+
this.$toast.success(this.$strings.ToastRescanUpToDate)
763763
} else if (result === 'REMOVED') {
764-
this.$toast.error(`Re-Scan complete item was removed`)
764+
this.$toast.error(this.$strings.ToastRescanRemoved)
765765
}
766766
})
767767
.catch((error) => {
768768
console.error('Failed to scan library item', error)
769-
this.$toast.error('Failed to scan library item')
769+
this.$toast.error(this.$strings.ToastScanFailed)
770770
})
771771
.finally(() => {
772772
this.processing = false
@@ -823,7 +823,7 @@ export default {
823823
})
824824
.catch((error) => {
825825
console.error('Failed to remove series from home', error)
826-
this.$toast.error('Failed to update user')
826+
this.$toast.error(this.$strings.ToastFailedToUpdateUser)
827827
})
828828
.finally(() => {
829829
this.processing = false
@@ -841,7 +841,7 @@ export default {
841841
})
842842
.catch((error) => {
843843
console.error('Failed to hide item from home', error)
844-
this.$toast.error('Failed to update user')
844+
this.$toast.error(this.$strings.ToastFailedToUpdateUser)
845845
})
846846
.finally(() => {
847847
this.processing = false
@@ -856,7 +856,7 @@ export default {
856856
episodeId: this.recentEpisode.id,
857857
title: this.recentEpisode.title,
858858
subtitle: this.mediaMetadata.title,
859-
caption: this.recentEpisode.publishedAt ? `Published ${this.$formatDate(this.recentEpisode.publishedAt, this.dateFormat)}` : 'Unknown publish date',
859+
caption: this.recentEpisode.publishedAt ? this.$getString('LabelPublishedDate', [this.$formatDate(this.recentEpisode.publishedAt, this.dateFormat)]) : this.$strings.LabelUnknownPublishDate,
860860
duration: this.recentEpisode.audioFile.duration || null,
861861
coverPath: this.media.coverPath || null
862862
}
@@ -906,11 +906,11 @@ export default {
906906
axios
907907
.$delete(`/api/items/${this.libraryItemId}?hard=${hardDelete ? 1 : 0}`)
908908
.then(() => {
909-
this.$toast.success('Item deleted')
909+
this.$toast.success(this.$strings.ToastItemDeletedSuccess)
910910
})
911911
.catch((error) => {
912912
console.error('Failed to delete item', error)
913-
this.$toast.error('Failed to delete item')
913+
this.$toast.error(this.$strings.ToastItemDeletedFailed)
914914
})
915915
.finally(() => {
916916
this.processing = false
@@ -1016,7 +1016,7 @@ export default {
10161016
episodeId: episode.id,
10171017
title: episode.title,
10181018
subtitle: this.mediaMetadata.title,
1019-
caption: episode.publishedAt ? `Published ${this.$formatDate(episode.publishedAt, this.dateFormat)}` : 'Unknown publish date',
1019+
caption: episode.publishedAt ? this.$getString('LabelPublishedDate', [this.$formatDate(episode.publishedAt, this.dateFormat)]) : this.$strings.LabelUnknownPublishDate,
10201020
duration: episode.audioFile.duration || null,
10211021
coverPath: this.media.coverPath || null
10221022
})

client/components/cards/LazySeriesCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default {
9696
displaySortLine() {
9797
switch (this.orderBy) {
9898
case 'addedAt':
99-
return `${this.$strings.LabelAdded} ${this.$formatDate(this.addedAt, this.dateFormat)}`
99+
return this.$getString('LabelAddedDate', [this.$formatDate(this.addedAt, this.dateFormat)])
100100
case 'totalDuration':
101101
return `${this.$strings.LabelDuration} ${this.$elapsedPrettyExtended(this.totalDuration, false)}`
102102
case 'lastBookUpdated':

client/components/cards/NotificationCard.vue

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<p class="text-base md:text-lg font-semibold pr-4">{{ eventName }}</p>
55
<div class="flex-grow" />
66

7-
<ui-btn v-if="eventName === 'onTest' && notification.enabled" :loading="testing" small class="mr-2" @click.stop="fireTestEventAndSucceed">Fire onTest Event</ui-btn>
8-
<ui-btn v-if="eventName === 'onTest' && notification.enabled" :loading="testing" small class="mr-2" color="red-600" @click.stop="fireTestEventAndFail">Fire & Fail</ui-btn>
7+
<ui-btn v-if="eventName === 'onTest' && notification.enabled" :loading="testing" small class="mr-2" @click.stop="fireTestEventAndSucceed">{{ this.$strings.ButtonFireOnTest }}</ui-btn>
8+
<ui-btn v-if="eventName === 'onTest' && notification.enabled" :loading="testing" small class="mr-2" color="red-600" @click.stop="fireTestEventAndFail">{{ this.$strings.ButtonFireAndFail }}</ui-btn>
99
<!-- <ui-btn v-if="eventName === 'onTest' && notification.enabled" :loading="testing" small class="mr-2" @click.stop="rapidFireTestEvents">Rapid Fire</ui-btn> -->
10-
<ui-btn v-else-if="notification.enabled" :loading="sendingTest" small class="mr-2" @click.stop="sendTestClick">Test</ui-btn>
11-
<ui-btn v-else :loading="enabling" small color="success" class="mr-2" @click="enableNotification">Enable</ui-btn>
10+
<ui-btn v-else-if="notification.enabled" :loading="sendingTest" small class="mr-2" @click.stop="sendTestClick">{{ this.$strings.ButtonTest }}</ui-btn>
11+
<ui-btn v-else :loading="enabling" small color="success" class="mr-2" @click="enableNotification">{{ this.$strings.ButtonEnable }}</ui-btn>
1212

1313
<ui-icon-btn :size="7" icon-font-size="1.1rem" icon="edit" class="mr-2" @click="editNotification" />
1414
<ui-icon-btn bg-color="error" :size="7" icon-font-size="1.2rem" icon="delete" @click="deleteNotificationClick" />
@@ -65,12 +65,12 @@ export default {
6565
this.$axios
6666
.$get(`/api/notifications/test?fail=${intentionallyFail ? 1 : 0}`)
6767
.then(() => {
68-
this.$toast.success('Triggered onTest Event')
68+
this.$toast.success(this.$strings.ToastNotificationTestTriggerSuccess)
6969
})
7070
.catch((error) => {
7171
console.error('Failed', error)
7272
const errorMsg = error.response ? error.response.data : null
73-
this.$toast.error(`Failed: ${errorMsg}` || 'Failed to trigger onTest event')
73+
this.$toast.error(`Failed: ${errorMsg}` || this.$strings.ToastNotificationTestTriggerFailed)
7474
})
7575
.finally(() => {
7676
this.testing = false
@@ -91,7 +91,7 @@ export default {
9191
// End testing functions
9292
sendTestClick() {
9393
const payload = {
94-
message: `Trigger this notification with test data?`,
94+
message: this.$strings.MessageConfirmNotificationTestTrigger,
9595
callback: (confirmed) => {
9696
if (confirmed) {
9797
this.sendTest()
@@ -106,12 +106,12 @@ export default {
106106
this.$axios
107107
.$get(`/api/notifications/${this.notification.id}/test`)
108108
.then(() => {
109-
this.$toast.success('Triggered test notification')
109+
this.$toast.success(this.$strings.ToastNotificationTestTriggerSuccess)
110110
})
111111
.catch((error) => {
112112
console.error('Failed', error)
113113
const errorMsg = error.response ? error.response.data : null
114-
this.$toast.error(`Failed: ${errorMsg}` || 'Failed to trigger test notification')
114+
this.$toast.error(`Failed: ${errorMsg}` || this.$strings.ToastNotificationTestTriggerFailed)
115115
})
116116
.finally(() => {
117117
this.sendingTest = false
@@ -127,19 +127,18 @@ export default {
127127
.$patch(`/api/notifications/${this.notification.id}`, payload)
128128
.then((updatedSettings) => {
129129
this.$emit('update', updatedSettings)
130-
this.$toast.success('Notification enabled')
131130
})
132131
.catch((error) => {
133132
console.error('Failed to update notification', error)
134-
this.$toast.error('Failed to update notification')
133+
this.$toast.error(this.$strings.ToastNotificationUpdateFailed)
135134
})
136135
.finally(() => {
137136
this.enabling = false
138137
})
139138
},
140139
deleteNotificationClick() {
141140
const payload = {
142-
message: `Are you sure you want to delete this notification?`,
141+
message: this.$strings.MessageConfirmDeleteNotification,
143142
callback: (confirmed) => {
144143
if (confirmed) {
145144
this.deleteNotification()
@@ -155,11 +154,10 @@ export default {
155154
.$delete(`/api/notifications/${this.notification.id}`)
156155
.then((updatedSettings) => {
157156
this.$emit('update', updatedSettings)
158-
this.$toast.success('Deleted notification')
159157
})
160158
.catch((error) => {
161159
console.error('Failed', error)
162-
this.$toast.error('Failed to delete notification')
160+
this.$toast.error(this.$strings.ToastNotificationDeleteFailed)
163161
})
164162
.finally(() => {
165163
this.deleting = false
@@ -171,4 +169,4 @@ export default {
171169
},
172170
mounted() {}
173171
}
174-
</script>
172+
</script>

client/components/modals/AccountModal.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
</div>
112112

113113
<div class="flex pt-4 px-2">
114-
<ui-btn v-if="hasOpenIDLink" small :loading="unlinkingFromOpenID" color="primary" type="button" class="mr-2" @click.stop="unlinkOpenID">Unlink OpenID</ui-btn>
114+
<ui-btn v-if="hasOpenIDLink" small :loading="unlinkingFromOpenID" color="primary" type="button" class="mr-2" @click.stop="unlinkOpenID">{{ $strings.ButtonUnlinkOpenId }}</ui-btn>
115115
<ui-btn v-if="isEditingRoot" small class="flex items-center" to="/account">{{ $strings.ButtonChangeRootPassword }}</ui-btn>
116116
<div class="flex-grow" />
117117
<ui-btn color="success" type="submit">{{ $strings.ButtonSubmit }}</ui-btn>
@@ -212,19 +212,19 @@ export default {
212212
},
213213
unlinkOpenID() {
214214
const payload = {
215-
message: 'Are you sure you want to unlink this user from OpenID?',
215+
message: this.$strings.MessageConfirmUnlinkOpenId,
216216
callback: (confirmed) => {
217217
if (confirmed) {
218218
this.unlinkingFromOpenID = true
219219
this.$axios
220220
.$patch(`/api/users/${this.account.id}/openid-unlink`)
221221
.then(() => {
222-
this.$toast.success('User unlinked from OpenID')
222+
this.$toast.success(this.$strings.ToastUnlinkOpenIdSuccess)
223223
this.show = false
224224
})
225225
.catch((error) => {
226226
console.error('Failed to unlink user from OpenID', error)
227-
this.$toast.error('Failed to unlink user from OpenID')
227+
this.$toast.error(this.$strings.ToastUnlinkOpenIdFailed)
228228
})
229229
.finally(() => {
230230
this.unlinkingFromOpenID = false
@@ -265,15 +265,15 @@ export default {
265265
},
266266
submitForm() {
267267
if (!this.newUser.username) {
268-
this.$toast.error('Enter a username')
268+
this.$toast.error(this.$strings.ToastNewUserUsernameError)
269269
return
270270
}
271271
if (!this.newUser.permissions.accessAllLibraries && !this.newUser.librariesAccessible.length) {
272-
this.$toast.error('Must select at least one library')
272+
this.$toast.error(this.$strings.ToastNewUserLibraryError)
273273
return
274274
}
275275
if (!this.newUser.permissions.accessAllTags && !this.newUser.itemTagsSelected.length) {
276-
this.$toast.error('Must select at least one tag')
276+
this.$toast.error(this.$strings.ToastNewUserTagError)
277277
return
278278
}
279279
@@ -313,12 +313,12 @@ export default {
313313
this.processing = false
314314
console.error('Failed to update account', error)
315315
var errMsg = error.response ? error.response.data || '' : ''
316-
this.$toast.error(errMsg || 'Failed to update account')
316+
this.$toast.error(errMsg || this.$strings.ToastFailedToUpdateAccount)
317317
})
318318
},
319319
submitCreateAccount() {
320320
if (!this.newUser.password) {
321-
this.$toast.error('Must have a password, only root user can have an empty password')
321+
this.$toast.error(this.$strings.ToastNewUserPasswordError)
322322
return
323323
}
324324
@@ -329,9 +329,9 @@ export default {
329329
.then((data) => {
330330
this.processing = false
331331
if (data.error) {
332-
this.$toast.error(`Failed to create account: ${data.error}`)
332+
this.$toast.error(this.$strings.ToastNewUserCreatedFailed + ': ' + data.error)
333333
} else {
334-
this.$toast.success('New account created')
334+
this.$toast.success(this.$strings.ToastNewUserCreatedSuccess)
335335
this.show = false
336336
}
337337
})

client/components/modals/AddCustomMetadataProviderModal.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modals-modal ref="modal" v-model="show" name="custom-metadata-provider" :width="600" :height="'unset'" :processing="processing">
33
<template #outer>
44
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
5-
<p class="text-3xl text-white truncate">Add custom metadata provider</p>
5+
<p class="text-3xl text-white truncate">{{ $strings.HeaderAddCustomMetadataProvider }}</p>
66
</div>
77
</template>
88
<form @submit.prevent="submitForm">
@@ -20,7 +20,7 @@
2020
<ui-text-input-with-label v-model="newUrl" label="URL" />
2121
</div>
2222
<div class="w-full mb-2 p-1">
23-
<ui-text-input-with-label v-model="newAuthHeaderValue" :label="'Authorization Header Value'" type="password" />
23+
<ui-text-input-with-label v-model="newAuthHeaderValue" :label="$strings.LabelProviderAuthorizationValue" type="password" />
2424
</div>
2525
<div class="flex px-1 pt-4">
2626
<div class="flex-grow" />
@@ -67,7 +67,7 @@ export default {
6767
methods: {
6868
submitForm() {
6969
if (!this.newName || !this.newUrl) {
70-
this.$toast.error('Must add name and url')
70+
this.$toast.error(this.$strings.ToastProviderNameAndUrlRequired)
7171
return
7272
}
7373
@@ -81,13 +81,13 @@ export default {
8181
})
8282
.then((data) => {
8383
this.$emit('added', data.provider)
84-
this.$toast.success('New provider added')
84+
this.$toast.success(this.$strings.ToastProviderCreatedSuccess)
8585
this.show = false
8686
})
8787
.catch((error) => {
8888
const errorMsg = error.response?.data || 'Unknown error'
8989
console.error('Failed to add provider', error)
90-
this.$toast.error('Failed to add provider: ' + errorMsg)
90+
this.$toast.error(this.$strings.ToastProviderCreatedFailed + ': ' + errorMsg)
9191
})
9292
.finally(() => {
9393
this.processing = false

0 commit comments

Comments
 (0)