From e200d20325fa6189169e3447b09737c9a488d92b Mon Sep 17 00:00:00 2001 From: sct Date: Fri, 6 Jan 2023 14:47:00 +0900 Subject: [PATCH] feat: update i18n --- .../Discover/CreateSlider/index.tsx | 28 ++++++--- src/components/Discover/index.tsx | 4 +- src/i18n/locale/en.json | 63 ++++++++++--------- 3 files changed, 54 insertions(+), 41 deletions(-) diff --git a/src/components/Discover/CreateSlider/index.tsx b/src/components/Discover/CreateSlider/index.tsx index 176b59b65f..3f70c980ee 100644 --- a/src/components/Discover/CreateSlider/index.tsx +++ b/src/components/Discover/CreateSlider/index.tsx @@ -31,7 +31,9 @@ const messages = defineMessages({ providetmdbnetwork: 'Provide TMDB Network ID', addsuccess: 'Created new slider and saved discover customization settings.', addfail: 'Failed to create new slider.', - needresults: 'You need to have at least 1 result to create a slider.', + editsuccess: 'Edited slider and saved discover customization settings.', + editfail: 'Failed to edit slider.', + needresults: 'You need to have at least 1 result.', validationDatarequired: 'You must provide a data value.', validationTitlerequired: 'You must provide a title.', addcustomslider: 'Create Custom Slider', @@ -309,17 +311,25 @@ const CreateSlider = ({ onCreate, slider }: CreateSliderProps) => { }); } - addToast(intl.formatMessage(messages.addsuccess), { - appearance: 'success', - autoDismiss: true, - }); + addToast( + intl.formatMessage( + slider ? messages.editsuccess : messages.addsuccess + ), + { + appearance: 'success', + autoDismiss: true, + } + ); onCreate(); resetForm(); } catch (e) { - addToast(intl.formatMessage(messages.addfail), { - appearance: 'error', - autoDismiss: true, - }); + addToast( + intl.formatMessage(slider ? messages.editfail : messages.addfail), + { + appearance: 'error', + autoDismiss: true, + } + ); } }} > diff --git a/src/components/Discover/index.tsx b/src/components/Discover/index.tsx index 03e6af41ad..510aa893c1 100644 --- a/src/components/Discover/index.tsx +++ b/src/components/Discover/index.tsx @@ -46,7 +46,7 @@ const messages = defineMessages({ resetfailed: 'Something went wrong resetting the discover customization settings.', customizediscover: 'Customize Discover', - cancelchanges: 'Cancel Changes', + stopediting: 'Stop Editing', }); const Discover = () => { @@ -125,7 +125,7 @@ const Discover = () => { onClick={() => setIsEditing(false)} > - {intl.formatMessage(messages.cancelchanges)} + {intl.formatMessage(messages.stopediting)} diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index d773f17e9b..867ad1f1eb 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -6,10 +6,35 @@ "components.CollectionDetails.overview": "Overview", "components.CollectionDetails.requestcollection": "Request Collection", "components.CollectionDetails.requestcollection4k": "Request Collection in 4K", + "components.Discover.CreateSlider.addSlider": "Add Slider", + "components.Discover.CreateSlider.addcustomslider": "Create Custom Slider", + "components.Discover.CreateSlider.addfail": "Failed to create new slider.", + "components.Discover.CreateSlider.addsuccess": "Created new slider and saved discover customization settings.", + "components.Discover.CreateSlider.editSlider": "Edit Slider", + "components.Discover.CreateSlider.editfail": "Failed to edit slider.", + "components.Discover.CreateSlider.editsuccess": "Edited slider and saved discover customization settings.", + "components.Discover.CreateSlider.needresults": "You need to have at least 1 result.", + "components.Discover.CreateSlider.nooptions": "No results.", + "components.Discover.CreateSlider.providetmdbgenreid": "Provide a TMDB Genre ID", + "components.Discover.CreateSlider.providetmdbkeywordid": "Provide a TMDB Keyword ID", + "components.Discover.CreateSlider.providetmdbnetwork": "Provide TMDB Network ID", + "components.Discover.CreateSlider.providetmdbsearch": "Provide a search query", + "components.Discover.CreateSlider.providetmdbstudio": "Provide TMDB Studio ID", + "components.Discover.CreateSlider.searchGenres": "Search genres…", + "components.Discover.CreateSlider.searchKeywords": "Search keywords…", + "components.Discover.CreateSlider.searchStudios": "Search studios…", + "components.Discover.CreateSlider.slidernameplaceholder": "Slider Name", + "components.Discover.CreateSlider.starttyping": "Starting typing to search.", + "components.Discover.CreateSlider.validationDatarequired": "You must provide a data value.", + "components.Discover.CreateSlider.validationTitlerequired": "You must provide a title.", "components.Discover.DiscoverMovieGenre.genreMovies": "{genre} Movies", "components.Discover.DiscoverMovieKeyword.keywordMovies": "{keywordTitle} Movies", "components.Discover.DiscoverMovieLanguage.languageMovies": "{language} Movies", "components.Discover.DiscoverNetwork.networkSeries": "{network} Series", + "components.Discover.DiscoverSliderEdit.deletefail": "Failed to delete slider.", + "components.Discover.DiscoverSliderEdit.deletesuccess": "Sucessfully deleted slider.", + "components.Discover.DiscoverSliderEdit.enable": "Toggle Visibility", + "components.Discover.DiscoverSliderEdit.remove": "Remove", "components.Discover.DiscoverStudio.studioMovies": "{studio} Movies", "components.Discover.DiscoverTvGenre.genreSeries": "{genre} Series", "components.Discover.DiscoverTvKeyword.keywordSeries": "{keywordTitle} Series", @@ -25,6 +50,7 @@ "components.Discover.StudioSlider.studios": "Studios", "components.Discover.TvGenreList.seriesgenres": "Series Genres", "components.Discover.TvGenreSlider.tvgenres": "Series Genres", + "components.Discover.customizediscover": "Customize Discover", "components.Discover.discover": "Discover", "components.Discover.discovermovies": "Popular Movies", "components.Discover.discovertv": "Popular Series", @@ -36,6 +62,11 @@ "components.Discover.populartv": "Popular Series", "components.Discover.recentlyAdded": "Recently Added", "components.Discover.recentrequests": "Recent Requests", + "components.Discover.resetfailed": "Something went wrong resetting the discover customization settings.", + "components.Discover.resetsuccess": "Sucessfully reset discover customization settings.", + "components.Discover.resettodefault": "Reset to Default", + "components.Discover.resetwarning": "Reset all sliders to default. This will also delete any custom sliders!", + "components.Discover.stopediting": "Stop Editing", "components.Discover.studios": "Studios", "components.Discover.tmdbmoviegenre": "TMDB Movie Genre", "components.Discover.tmdbmoviekeyword": "TMDB Movie Keyword", @@ -49,6 +80,8 @@ "components.Discover.upcoming": "Upcoming Movies", "components.Discover.upcomingmovies": "Upcoming Movies", "components.Discover.upcomingtv": "Upcoming Series", + "components.Discover.updatefailed": "Something went wrong updating the discover customization settings.", + "components.Discover.updatesuccess": "Updated discover customization settings.", "components.DownloadBlock.estimatedtime": "Estimated {time}", "components.DownloadBlock.formattedTitle": "{title}: Season {seasonNumber} Episode {episodeNumber}", "components.IssueDetails.IssueComment.areyousuredelete": "Are you sure you want to delete this comment?", @@ -704,34 +737,6 @@ "components.Settings.SettingsLogs.showall": "Show All Logs", "components.Settings.SettingsLogs.time": "Timestamp", "components.Settings.SettingsLogs.viewdetails": "View Details", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.addSlider": "Add Slider", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.addcustomslider": "Add Custom Slider", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.addfail": "Failed to create new slider.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.addsuccess": "Created new slider and saved discover customization settings.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.needresults": "You need to have at least 1 result to create a slider.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.nooptions": "No results.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.providetmdbgenreid": "Provide a TMDB Genre ID", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.providetmdbkeywordid": "Provide a TMDB Keyword ID", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.providetmdbnetwork": "Provide TMDB Network ID", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.providetmdbsearch": "Provide a search query", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.providetmdbstudio": "Provide TMDB Studio ID", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.searchGenres": "Search genres…", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.searchKeywords": "Search keywords…", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.searchStudios": "Search studios…", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.slidernameplaceholder": "Slider Name", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.starttyping": "Starting typing to search.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.validationDatarequired": "You must provide a data value.", - "components.Settings.SettingsMain.DiscoverCustomization.CreateSlider.validationTitlerequired": "You must provide a title.", - "components.Settings.SettingsMain.DiscoverCustomization.DiscoverOption.deletefail": "Failed to delete slider.", - "components.Settings.SettingsMain.DiscoverCustomization.DiscoverOption.deletesuccess": "Sucessfully deleted slider.", - "components.Settings.SettingsMain.DiscoverCustomization.DiscoverOption.enable": "Toggle Visibility", - "components.Settings.SettingsMain.DiscoverCustomization.DiscoverOption.remove": "Remove", - "components.Settings.SettingsMain.DiscoverCustomization.resetfailed": "Something went wrong resetting the discover customization settings.", - "components.Settings.SettingsMain.DiscoverCustomization.resetsuccess": "Sucessfully reset discover customization settings.", - "components.Settings.SettingsMain.DiscoverCustomization.resettodefault": "Reset to Default", - "components.Settings.SettingsMain.DiscoverCustomization.resetwarning": "Reset all sliders to default. This will also delete any custom sliders!", - "components.Settings.SettingsMain.DiscoverCustomization.updatefailed": "Something went wrong updating the discover customization settings.", - "components.Settings.SettingsMain.DiscoverCustomization.updatesuccess": "Updated discover customization settings.", "components.Settings.SettingsMain.apikey": "API Key", "components.Settings.SettingsMain.applicationTitle": "Application Title", "components.Settings.SettingsMain.applicationurl": "Application URL", @@ -740,8 +745,6 @@ "components.Settings.SettingsMain.csrfProtection": "Enable CSRF Protection", "components.Settings.SettingsMain.csrfProtectionHoverTip": "Do NOT enable this setting unless you understand what you are doing!", "components.Settings.SettingsMain.csrfProtectionTip": "Set external API access to read-only (requires HTTPS)", - "components.Settings.SettingsMain.discovercustomization": "Discover Customization", - "components.Settings.SettingsMain.discovercustomizationDescription": "Add or remove sliders on the Discover page.", "components.Settings.SettingsMain.general": "General", "components.Settings.SettingsMain.generalsettings": "General Settings", "components.Settings.SettingsMain.generalsettingsDescription": "Configure global and default settings for Overseerr.",