Translate Updated and Connection Lost Modals in frontend

(cherry picked from commit 074aa6f4457bf83173e6ba7209c452a6e0659a35)

Closes #8994
This commit is contained in:
Stevie Robinson 2023-08-13 23:03:52 +02:00 committed by Bogdan
parent 4bbc166040
commit 51149bccdd
5 changed files with 18 additions and 14 deletions

View File

@ -1,6 +1,7 @@
.version { .version {
margin: 0 3px; margin: 0 3px;
font-weight: bold; font-weight: bold;
font-family: var(--defaultFontFamily);
} }
.maintenance { .maintenance {

View File

@ -9,6 +9,7 @@ import ModalHeader from 'Components/Modal/ModalHeader';
import { kinds } from 'Helpers/Props'; import { kinds } from 'Helpers/Props';
import UpdateChanges from 'System/Updates/UpdateChanges'; import UpdateChanges from 'System/Updates/UpdateChanges';
import translate from 'Utilities/String/translate'; import translate from 'Utilities/String/translate';
import InlineMarkdown from 'Components/Markdown/InlineMarkdown';
import styles from './AppUpdatedModalContent.css'; import styles from './AppUpdatedModalContent.css';
function mergeUpdates(items, version, prevVersion) { function mergeUpdates(items, version, prevVersion) {
@ -64,20 +65,20 @@ function AppUpdatedModalContent(props) {
return ( return (
<ModalContent onModalClose={onModalClose}> <ModalContent onModalClose={onModalClose}>
<ModalHeader> <ModalHeader>
{translate('RadarrUpdated')} {translate('AppUpdated', { appName: 'Radarr' })}
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
<div dangerouslySetInnerHTML={{ __html: translate('VersionUpdateText', [`<span className=${styles.version}>${version}</span>`]) }} /> <div>
<InlineMarkdown data={translate('AppUpdatedVersion', { appName: 'Radarr', version })} blockClassName={styles.version} />
</div>
{ {
isPopulated && !error && !!update && isPopulated && !error && !!update &&
<div> <div>
{ {
!update.changes && !update.changes &&
<div className={styles.maintenance}> <div className={styles.maintenance}>{translate('MaintenanceRelease')}</div>
{translate('MaintenanceRelease')}
</div>
} }
{ {

View File

@ -28,11 +28,11 @@ function ConnectionLostModal(props) {
<ModalBody> <ModalBody>
<div> <div>
{translate('ConnectionLostMessage')} {translate('ConnectionLostToBackend', { appName: 'Radarr' })}
</div> </div>
<div className={styles.automatic}> <div className={styles.automatic}>
{translate('ConnectionLostAutomaticMessage')} {translate('ConnectionLostReconnect', { appName: 'Radarr' })}
</div> </div>
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>

View File

@ -10,7 +10,8 @@ class InlineMarkdown extends Component {
render() { render() {
const { const {
className, className,
data data,
blockClassName
} = this.props; } = this.props;
// For now only replace links or code blocks (not both) // For now only replace links or code blocks (not both)
@ -47,7 +48,7 @@ class InlineMarkdown extends Component {
markdownBlocks.push(data.substr(endIndex, match.index - endIndex)); markdownBlocks.push(data.substr(endIndex, match.index - endIndex));
} }
markdownBlocks.push(<code key={`code-${match.index}`}>{match[0].substring(1, match[0].length - 1)}</code>); markdownBlocks.push(<code key={`code-${match.index}`} className={blockClassName ?? null}>{match[0].substring(1, match[0].length - 1)}</code>);
endIndex = match.index + match[0].length; endIndex = match.index + match[0].length;
} }
@ -66,7 +67,8 @@ class InlineMarkdown extends Component {
InlineMarkdown.propTypes = { InlineMarkdown.propTypes = {
className: PropTypes.string, className: PropTypes.string,
data: PropTypes.string data: PropTypes.string,
blockClassName: PropTypes.string
}; };
export default InlineMarkdown; export default InlineMarkdown;

View File

@ -59,6 +59,8 @@
"ApiKeyValidationHealthCheckMessage": "Please update your API key to be at least {0} characters long. You can do this via settings or the config file", "ApiKeyValidationHealthCheckMessage": "Please update your API key to be at least {0} characters long. You can do this via settings or the config file",
"AppDataDirectory": "AppData directory", "AppDataDirectory": "AppData directory",
"AppDataLocationHealthCheckMessage": "Updating will not be possible to prevent deleting AppData on Update", "AppDataLocationHealthCheckMessage": "Updating will not be possible to prevent deleting AppData on Update",
"AppUpdated": "{appName} Updated",
"AppUpdatedVersion": "{appName} has been updated to version `{version}`, in order to get the latest changes you'll need to reload {appName}",
"ApplicationURL": "Application URL", "ApplicationURL": "Application URL",
"ApplicationUrlHelpText": "This application's external URL including http(s)://, port and URL base", "ApplicationUrlHelpText": "This application's external URL including http(s)://, port and URL base",
"Apply": "Apply", "Apply": "Apply",
@ -182,8 +184,8 @@
"ConnectSettingsSummary": "Notifications, connections to media servers/players, and custom scripts", "ConnectSettingsSummary": "Notifications, connections to media servers/players, and custom scripts",
"Connection": "Connection", "Connection": "Connection",
"ConnectionLost": "Connection Lost", "ConnectionLost": "Connection Lost",
"ConnectionLostAutomaticMessage": "Radarr will try to connect automatically, or you can click reload below.", "ConnectionLostReconnect": "{appName} will try to connect automatically, or you can click reload below.",
"ConnectionLostMessage": "Radarr has lost its connection to the backend and will need to be reloaded to restore functionality.", "ConnectionLostToBackend": "{appName} has lost its connection to the backend and will need to be reloaded to restore functionality.",
"Connections": "Connections", "Connections": "Connections",
"ConsideredAvailable": "Considered Available", "ConsideredAvailable": "Considered Available",
"CopyToClipboard": "Copy to Clipboard", "CopyToClipboard": "Copy to Clipboard",
@ -891,7 +893,6 @@
"RadarrSupportsAnyRSSMovieListsAsWellAsTheOneStatedBelow": "Radarr supports any RSS movie lists as well as the one stated below.", "RadarrSupportsAnyRSSMovieListsAsWellAsTheOneStatedBelow": "Radarr supports any RSS movie lists as well as the one stated below.",
"RadarrSupportsCustomConditionsAgainstTheReleasePropertiesBelow": "Radarr supports custom conditions against the release properties below.", "RadarrSupportsCustomConditionsAgainstTheReleasePropertiesBelow": "Radarr supports custom conditions against the release properties below.",
"RadarrTags": "Radarr Tags", "RadarrTags": "Radarr Tags",
"RadarrUpdated": "Radarr Updated",
"Rating": "Rating", "Rating": "Rating",
"Ratings": "Ratings", "Ratings": "Ratings",
"ReadTheWikiForMoreInformation": "Read the Wiki for more information", "ReadTheWikiForMoreInformation": "Read the Wiki for more information",
@ -1306,7 +1307,6 @@
"UsenetDisabled": "Usenet Disabled", "UsenetDisabled": "Usenet Disabled",
"Username": "Username", "Username": "Username",
"Version": "Version", "Version": "Version",
"VersionUpdateText": "Version {0} of Radarr has been installed, in order to get the latest changes you'll need to reload Radarr.",
"VideoCodec": "Video Codec", "VideoCodec": "Video Codec",
"VideoDynamicRange": "Video Dynamic Range", "VideoDynamicRange": "Video Dynamic Range",
"View": "View", "View": "View",