From 4f5e702f5da98fdff5437f2fe22d7ffaa68e2475 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Tue, 25 Mar 2025 21:19:56 +0100 Subject: [PATCH] [web] Use pluralization for displaying some texts --- web-src/src/i18n/de.json | 4 ++-- web-src/src/i18n/en.json | 4 ++-- web-src/src/i18n/fr.json | 4 ++-- web-src/src/i18n/zh-CN.json | 4 ++-- web-src/src/i18n/zh-TW.json | 4 ++-- web-src/src/pages/PageNowPlaying.vue | 8 +++++--- web-src/src/pages/PagePlaylistFolder.vue | 7 +++---- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/web-src/src/i18n/de.json b/web-src/src/i18n/de.json index 7603ab6e..c698e70b 100644 --- a/web-src/src/i18n/de.json +++ b/web-src/src/i18n/de.json @@ -208,11 +208,11 @@ }, "now-playing": { "info": "Tracks durch Auswählen aus der Bibliothek anfügen", - "live": "Live", + "time": "Live|{time}|{time}", "title": "Deine Playliste ist leer." }, "playlists": { - "title": "Playlisten" + "title": "{name}|Playlisten" }, "podcast": { "remove-info": "Diesen Podcast dauerhaft aus der Bibliothek löschen?{separator}(Damit wird auch die RSS-Playliste {name} gelöscht)" diff --git a/web-src/src/i18n/en.json b/web-src/src/i18n/en.json index 7f3b7faa..a6c01429 100644 --- a/web-src/src/i18n/en.json +++ b/web-src/src/i18n/en.json @@ -208,11 +208,11 @@ }, "now-playing": { "info": "Add some tracks by browsing your library", - "live": "Live", + "time": "Live|{time}|{time}", "title": "Your play queue is empty" }, "playlists": { - "title": "Playlists" + "title": "{name}|Playlists" }, "podcast": { "remove-info": "Permanently remove this podcast from your library?{separator}(This will also remove the RSS playlist {name})" diff --git a/web-src/src/i18n/fr.json b/web-src/src/i18n/fr.json index efbf701c..0fe9401c 100644 --- a/web-src/src/i18n/fr.json +++ b/web-src/src/i18n/fr.json @@ -208,11 +208,11 @@ }, "now-playing": { "info": "Ajoutez des pistes en parcourant votre bibliothèque", - "live": "En direct", + "time": "En direct|{time}|{time}", "title": "La file d’attente est vide" }, "playlists": { - "title": "Listes de lecture" + "title": "{name}|Listes de lecture" }, "podcast": { "remove-info": "Supprimer ce podcast de manière permanente de la bibliothèque ?{separator}(Cela supprimera également la liste de lecture RSS {name})" diff --git a/web-src/src/i18n/zh-CN.json b/web-src/src/i18n/zh-CN.json index 9668ef03..e7eb9664 100644 --- a/web-src/src/i18n/zh-CN.json +++ b/web-src/src/i18n/zh-CN.json @@ -208,11 +208,11 @@ }, "now-playing": { "info": "浏览资料库添加曲目", - "live": "直播", + "time": "直播|{time}|{time}", "title": "播放清单是空的" }, "playlists": { - "title": "播放列表" + "title": "{name}|播放列表" }, "podcast": { "remove-info": "从资料库中永久移除该播客?{separator}(这也将移除该播客RSS列表 {name})" diff --git a/web-src/src/i18n/zh-TW.json b/web-src/src/i18n/zh-TW.json index 51e7c620..5447b9b1 100644 --- a/web-src/src/i18n/zh-TW.json +++ b/web-src/src/i18n/zh-TW.json @@ -208,11 +208,11 @@ }, "now-playing": { "info": "瀏覽資料庫新增曲目", - "live": "直播", + "time": "直播|{time}|{time}", "title": "播放清單是空的" }, "playlists": { - "title": "播放列表" + "title": "{name}|播放列表" }, "podcast": { "remove-info": "從資料庫中永久移除該Podcast?{separator}(這也將移除該PodcastRSS列表 {name})" diff --git a/web-src/src/pages/PageNowPlaying.vue b/web-src/src/pages/PageNowPlaying.vue index 96c0096a..232509fa 100644 --- a/web-src/src/pages/PageNowPlaying.vue +++ b/web-src/src/pages/PageNowPlaying.vue @@ -129,9 +129,11 @@ export default { return this.isLive ? 1 : Math.floor(this.track.length_ms / INTERVAL) }, trackTotalTime() { - return this.isLive - ? this.$t('page.now-playing.live') - : this.$filters.toTimecode(this.track.length_ms) + return this.$t('page.now-playing.time', this.track.length_ms, { + named: { + time: this.$filters.toTimecode(this.track.length_ms) + } + }) } }, watch: { diff --git a/web-src/src/pages/PagePlaylistFolder.vue b/web-src/src/pages/PagePlaylistFolder.vue index 1dea4bb3..c3c720f2 100644 --- a/web-src/src/pages/PagePlaylistFolder.vue +++ b/web-src/src/pages/PagePlaylistFolder.vue @@ -59,10 +59,9 @@ export default { heading() { return { subtitle: [{ count: this.playlists.count, key: 'count.playlists' }], - title: - this.playlists.count === 0 - ? this.$t('page.playlists.title') - : this.playlist.name + title: this.$t('page.playlists.title', this.playlists.count, { + name: this.playlist.name + }) } }, playlists() {