Skip to content

Commit

Permalink
feat: update i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
sct committed Jan 6, 2023
1 parent 1245a86 commit e200d20
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 41 deletions.
28 changes: 19 additions & 9 deletions src/components/Discover/CreateSlider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
}
);
}
}}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Discover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -125,7 +125,7 @@ const Discover = () => {
onClick={() => setIsEditing(false)}
>
<ArrowUturnLeftIcon />
<span>{intl.formatMessage(messages.cancelchanges)}</span>
<span>{intl.formatMessage(messages.stopediting)}</span>
</Button>
</span>
<span className="ml-3 inline-flex rounded-md shadow-sm">
Expand Down
63 changes: 33 additions & 30 deletions src/i18n/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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?",
Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand Down

0 comments on commit e200d20

Please sign in to comment.