From 2dcda39d40d820419e098bd6f1101eb820e5b42d Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 27 Dec 2020 10:12:06 +0000 Subject: [PATCH] fix(frontend): add localized strings for status checker --- src/components/StatusChacker/index.tsx | 16 ++++++++++++---- src/i18n/locale/en.json | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/StatusChacker/index.tsx b/src/components/StatusChacker/index.tsx index f40ebda4c..ce9b73419 100644 --- a/src/components/StatusChacker/index.tsx +++ b/src/components/StatusChacker/index.tsx @@ -1,9 +1,18 @@ import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; import useSWR from 'swr'; import Modal from '../Common/Modal'; import Transition from '../Transition'; +const messages = defineMessages({ + newversionavailable: 'New Version Available', + newversionDescription: + 'An update is now available. Click the button below to reload the application.', + reloadOverseerr: 'Reload Overseerr', +}); + const StatusChecker: React.FC = () => { + const intl = useIntl(); const { data, error } = useSWR<{ version: string; commitTag: string }>( '/api/v1/status', { @@ -47,13 +56,12 @@ const StatusChecker: React.FC = () => { /> } - title="New Version Available" + title={intl.formatMessage(messages.newversionavailable)} onOk={() => location.reload()} - okText="Reload Overseerr" + okText={intl.formatMessage(messages.reloadOverseerr)} backgroundClickable={false} > - An update is now available. Click the button below to reload the - application. + {intl.formatMessage(messages.newversionDescription)} ); diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 6382b19ed..0ab0263c9 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -130,9 +130,9 @@ "components.Settings.Notifications.enableSsl": "Enable SSL", "components.Settings.Notifications.save": "Save Changes", "components.Settings.Notifications.saving": "Saving…", + "components.Settings.Notifications.senderName": "Sender Name", "components.Settings.Notifications.settinguptelegram": "Setting up Telegram Notifications", "components.Settings.Notifications.settinguptelegramDescription": "To setup Telegram you need to create a bot and get the bot API key. Additionally, you need the chat id for the chat you want the bot to send notifications to. You can do this by adding @get_id_bot to the chat or group chat.", - "components.Settings.Notifications.senderName": "Sender Name", "components.Settings.Notifications.smtpHost": "SMTP Host", "components.Settings.Notifications.smtpPort": "SMTP Port", "components.Settings.Notifications.ssldisabletip": "SSL should be disabled on standard TLS connections (Port 587)", @@ -312,6 +312,9 @@ "components.Setup.tip": "Tip", "components.Setup.welcome": "Welcome to Overseerr", "components.Slider.noresults": "No Results", + "components.StatusChacker.newversionDescription": "An update is now available. Click the button below to reload the application.", + "components.StatusChacker.newversionavailable": "New Version Available", + "components.StatusChacker.reloadOverseerr": "Reload Overseerr", "components.TitleCard.movie": "Movie", "components.TitleCard.tvshow": "Series", "components.TvDetails.TvCast.fullseriescast": "Full Series Cast",