diff --git a/src/renderer/App.js b/src/renderer/App.js index f7447b94..ec94e628 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -207,8 +207,7 @@ export default Vue.extend({ this.updateChangelog = marked.parse(json[0].body) this.changeLogTitle = json[0].name - const message = this.$t('Version $ is now available! Click for more details') - this.updateBannerMessage = message.replace('$', versionNumber) + this.updateBannerMessage = this.$t('Version {versionNumber} is now available! Click for more details', { versionNumber }) const appVersion = packageDetails.version.split('.') const latestVersion = versionNumber.split('.') @@ -242,8 +241,7 @@ export default Vue.extend({ const latestPubDate = new Date(latestBlog.pubDate) if (lastAppWasRunning === null || latestPubDate > lastAppWasRunning) { - const message = this.$t('A new blog is now available, $. Click to view more') - this.blogBannerMessage = message.replace('$', latestBlog.title) + this.blogBannerMessage = this.$t('A new blog is now available, {blogTitle}. Click to view more', { blogTitle: latestBlog.title }) this.latestBlogUrl = latestBlog.link this.showBlogBanner = true } diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 14201469..2f28ab5d 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -1013,7 +1013,7 @@ export default Vue.extend({ const objectKeys = Object.keys(playlistObject) if ((objectKeys.length < requiredKeys.length) || playlistObject.videos.length === 0) { - const message = this.$t('Settings.Data Settings.Playlist insufficient data').replace('$', playlistData.playlistName) + const message = this.$t('Settings.Data Settings.Playlist insufficient data', { playlist: playlistData.playlistName }) this.showToast({ message: message }) diff --git a/src/renderer/components/external-player-settings/external-player-settings.js b/src/renderer/components/external-player-settings/external-player-settings.js index 1b5eabb4..5e4c6841 100644 --- a/src/renderer/components/external-player-settings/external-player-settings.js +++ b/src/renderer/components/external-player-settings/external-player-settings.js @@ -47,8 +47,8 @@ export default Vue.extend({ const cmdArgs = this.$store.getters.getExternalPlayerCmdArguments[this.externalPlayer] if (cmdArgs && typeof cmdArgs.defaultCustomArguments === 'string' && cmdArgs.defaultCustomArguments !== '') { - const defaultArgs = this.$t('Tooltips.External Player Settings.DefaultCustomArgumentsTemplate') - .replace('$', cmdArgs.defaultCustomArguments) + const defaultArgs = this.$t('Tooltips.External Player Settings.DefaultCustomArgumentsTemplate', + { defaultCustomArguments: cmdArgs.defaultCustomArguments }) return `${tooltip} ${defaultArgs}` } diff --git a/src/renderer/components/ft-age-restricted/ft-age-restricted.js b/src/renderer/components/ft-age-restricted/ft-age-restricted.js index 5769012b..cc38888f 100644 --- a/src/renderer/components/ft-age-restricted/ft-age-restricted.js +++ b/src/renderer/components/ft-age-restricted/ft-age-restricted.js @@ -16,7 +16,7 @@ export default Vue.extend({ restrictedMessage: function () { const contentType = this.$t('Age Restricted.Type.' + this.contentTypeString) - return this.$t('Age Restricted.This $contentType is age restricted').replace('$contentType', contentType) + return this.$t('Age Restricted.This {videoOrPlaylist} is age restricted', { videoOrPlaylist: contentType }) } } }) diff --git a/src/renderer/components/ft-list-playlist/ft-list-playlist.js b/src/renderer/components/ft-list-playlist/ft-list-playlist.js index d6305b9e..308ec463 100644 --- a/src/renderer/components/ft-list-playlist/ft-list-playlist.js +++ b/src/renderer/components/ft-list-playlist/ft-list-playlist.js @@ -65,7 +65,6 @@ export default Vue.extend({ methods: { handleExternalPlayer: function () { this.openInExternalPlayer({ - strings: this.$t('Video.External Player'), watchProgress: 0, playbackRate: this.defaultPlayback, videoId: null, diff --git a/src/renderer/components/ft-list-playlist/ft-list-playlist.vue b/src/renderer/components/ft-list-playlist/ft-list-playlist.vue index 6e055c11..e7f38432 100644 --- a/src/renderer/components/ft-list-playlist/ft-list-playlist.vue +++ b/src/renderer/components/ft-list-playlist/ft-list-playlist.vue @@ -25,7 +25,7 @@
profile.name !== this.profile.name ? [profile.name] : []) }, selectedText: function () { - const localeText = this.$t('Profile.$ selected') - return localeText.replace('$', this.selectedLength) + return this.$t('Profile.{number} selected', { number: this.selectedLength }) } }, watch: { diff --git a/src/renderer/components/ft-profile-selector/ft-profile-selector.js b/src/renderer/components/ft-profile-selector/ft-profile-selector.js index c1507a78..94d343b9 100644 --- a/src/renderer/components/ft-profile-selector/ft-profile-selector.js +++ b/src/renderer/components/ft-profile-selector/ft-profile-selector.js @@ -78,7 +78,7 @@ export default Vue.extend({ if (targetProfile) { this.updateActiveProfile(targetProfile._id) - const message = this.$t('Profile.$ is now the active profile').replace('$', profile.name) + const message = this.$t('Profile.{profile} is now the active profile', { profile: profile.name }) this.showToast({ message }) } } diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index 1a1b2836..bb5dd269 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -1344,7 +1344,7 @@ export default Vue.extend({ } catch (err) { console.error(`Parse failed: ${err.message}`) this.showToast({ - message: this.$t('Screenshot Error').replace('$', err.message) + message: this.$t('Screenshot Error', { error: err.message }) }) canvas.remove() return @@ -1412,7 +1412,7 @@ export default Vue.extend({ } catch (err) { console.error(err) this.showToast({ - message: this.$t('Screenshot Error').replace('$', err) + message: this.$t('Screenshot Error', { error: err }) }) canvas.remove() return @@ -1429,11 +1429,11 @@ export default Vue.extend({ if (err) { console.error(err) this.showToast({ - message: this.$t('Screenshot Error').replace('$', err) + message: this.$t('Screenshot Error', { error: err }) }) } else { this.showToast({ - message: this.$t('Screenshot Success').replace('$', filePath) + message: this.$t('Screenshot Success', { filePath }) }) } }) diff --git a/src/renderer/components/general-settings/general-settings.js b/src/renderer/components/general-settings/general-settings.js index 6d650a48..f01a9332 100644 --- a/src/renderer/components/general-settings/general-settings.js +++ b/src/renderer/components/general-settings/general-settings.js @@ -193,9 +193,8 @@ export default Vue.extend({ const instance = this.currentInvidiousInstance this.updateDefaultInvidiousInstance(instance) - const message = this.$t('Default Invidious instance has been set to $') this.showToast({ - message: message.replace('$', instance) + message: this.$t('Default Invidious instance has been set to {instance}', { instance }) }) }, diff --git a/src/renderer/components/general-settings/general-settings.vue b/src/renderer/components/general-settings/general-settings.vue index a5aff4a1..82f25f6b 100644 --- a/src/renderer/components/general-settings/general-settings.vue +++ b/src/renderer/components/general-settings/general-settings.vue @@ -116,7 +116,7 @@ v-if="defaultInvidiousInstance !== ''" class="center" > - {{ $t('Settings.General Settings.The currently set default instance is $').replace('$', defaultInvidiousInstance) }} + {{ $t('Settings.General Settings.The currently set default instance is {instance}', { instance: defaultInvidiousInstance }) }}