From 1e5c879fc6c8c30a0bac41b384bf1a3f9d0be3c9 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 12 May 2020 14:13:34 -0400 Subject: [PATCH] Extract disc subtitle strings for translation --- ui/src/album/AlbumSongs.js | 11 +++++++++-- ui/src/i18n/en.json | 7 +++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ui/src/album/AlbumSongs.js b/ui/src/album/AlbumSongs.js index cb120e22a..c6e8dc603 100644 --- a/ui/src/album/AlbumSongs.js +++ b/ui/src/album/AlbumSongs.js @@ -6,6 +6,7 @@ import { ListToolbar, TextField, useListController, + useTranslate, DatagridLoading, DatagridBody, DatagridRow, @@ -71,6 +72,7 @@ const trackName = (r) => { const AlbumSongs = (props) => { const classes = useStyles(props) const classesToolbar = useStylesListToolbar(props) + const translate = useTranslate() const dispatch = useDispatch() const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs')) const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md')) @@ -100,8 +102,13 @@ const AlbumSongs = (props) => { {record.discSubtitle - ? `${record.discSubtitle} (disc ${record.discNumber})` - : `Disc ${record.discNumber}`} + ? translate('message.discSubtitle', { + subtitle: record.discSubtitle, + number: record.discNumber, + }) + : translate('message.discWithoutSubtitle', { + number: record.discNumber, + })} )} diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index 7e11e7a35..adc32299b 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -17,7 +17,8 @@ "year": "Year", "size": "File size", "bitRate": "Bit rate", - "updatedAt": "Uploaded at" + "updatedAt": "Uploaded at", + "discSubtitle": "Disc Subtitle" }, "actions": { "addToQueue": "Play Later", @@ -218,7 +219,9 @@ "message": { "note": "NOTE", "transcodingDisabled": "Changing the transcoding configuration through the web interface is disabled for security reasons. If you would like to change (edit or add) transcoding options, restart the server with the %{config} configuration option.", - "transcodingEnabled": "Navidrome is currently running with %{config}, making it possible to run system commands from the transcoding settings using the web interface. We recommend to disable it for security reasons and only enable it when configuring Transcoding options." + "transcodingEnabled": "Navidrome is currently running with %{config}, making it possible to run system commands from the transcoding settings using the web interface. We recommend to disable it for security reasons and only enable it when configuring Transcoding options.", + "discSubtitle": "%{subtitle} (disc %{number})", + "discWithoutSubtitle": "Disc %{number}" }, "menu": { "library": "Library",