1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

New: Separate UI Language into two settings for Movie Info and Main UI

This commit is contained in:
Qstick 2020-09-08 21:38:05 -04:00
parent 2014ff6610
commit ecbdd58f42
7 changed files with 37 additions and 11 deletions

View File

@ -117,7 +117,7 @@ const links = [
to: '/settings/general' to: '/settings/general'
}, },
{ {
title: translate('Ui'), title: translate('UI'),
to: '/settings/ui' to: '/settings/ui'
} }
] ]

View File

@ -196,17 +196,30 @@ class UISettings extends Component {
<FieldSet legend={translate('Language')}> <FieldSet legend={translate('Language')}>
<FormGroup> <FormGroup>
<FormLabel>{translate('SettingsUiLanguage')}</FormLabel> <FormLabel>{translate('MovieInfoLanguage')}</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.SELECT} type={inputTypes.SELECT}
name="movieInfoLanguage" name="movieInfoLanguage"
values={languages} values={languages}
helpText={translate('SettingsUiLanguageHelpText')} helpText={translate('MovieInfoLanguageHelpText')}
helpTextWarning={translate('MovieInfoLanguageHelpTextWarning')} helpTextWarning={translate('MovieInfoLanguageHelpTextWarning')}
onChange={onInputChange} onChange={onInputChange}
{...settings.movieInfoLanguage} {...settings.movieInfoLanguage}
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>{translate('UILanguage')}</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
name="uiLanguage"
values={languages}
helpText={translate('UILanguageHelpText')}
helpTextWarning={translate('UILanguageHelpTextWarning')}
onChange={onInputChange}
{...settings.uiLanguage}
/>
</FormGroup>
</FieldSet> </FieldSet>
</Form> </Form>
} }

View File

@ -386,6 +386,13 @@ public int MovieInfoLanguage
set { SetValue("MovieInfoLanguage", value); } set { SetValue("MovieInfoLanguage", value); }
} }
public int UILanguage
{
get { return GetValueInt("UILanguage", (int)Language.English); }
set { SetValue("UILanguage", value); }
}
public bool CleanupMetadataImages public bool CleanupMetadataImages
{ {
get { return GetValueBoolean("CleanupMetadataImages", true); } get { return GetValueBoolean("CleanupMetadataImages", true); }

View File

@ -77,6 +77,7 @@ public interface IConfigService
bool ShowRelativeDates { get; set; } bool ShowRelativeDates { get; set; }
bool EnableColorImpairedMode { get; set; } bool EnableColorImpairedMode { get; set; }
int MovieInfoLanguage { get; set; } int MovieInfoLanguage { get; set; }
int UILanguage { get; set; }
//Internal //Internal
bool CleanupMetadataImages { get; set; } bool CleanupMetadataImages { get; set; }

View File

@ -116,12 +116,12 @@
"Crew": "Crew", "Crew": "Crew",
"CustomFilters": "Custom Filters", "CustomFilters": "Custom Filters",
"CustomFormatJSON": "Custom Format JSON", "CustomFormatJSON": "Custom Format JSON",
"CustomFormatUnknownCondition": "Unknown Custom Format condition '{0}'",
"CustomFormatUnknownConditionOption": "Unknown option '{0}' for condition '{1}'",
"CustomFormats": "Custom Formats", "CustomFormats": "Custom Formats",
"CustomFormatScore": "Custom Format score", "CustomFormatScore": "Custom Format score",
"CustomFormatsSettings": "Custom Formats Settings", "CustomFormatsSettings": "Custom Formats Settings",
"CustomFormatsSettingsSummary": "Custom Formats and Settings", "CustomFormatsSettingsSummary": "Custom Formats and Settings",
"CustomFormatUnknownCondition": "Unknown Custom Format condition '{0}'",
"CustomFormatUnknownConditionOption": "Unknown option '{0}' for condition '{1}'",
"Cutoff": "Cutoff", "Cutoff": "Cutoff",
"CutoffFormatScoreHelpText": "Once this custom format score is reached Radarr will no longer download movies", "CutoffFormatScoreHelpText": "Once this custom format score is reached Radarr will no longer download movies",
"CutoffHelpText": "Once this quality is reached Radarr will no longer download movies", "CutoffHelpText": "Once this quality is reached Radarr will no longer download movies",
@ -413,6 +413,8 @@
"MovieFolderFormat": "Movie Folder Format", "MovieFolderFormat": "Movie Folder Format",
"MovieID": "Movie ID", "MovieID": "Movie ID",
"MovieIndex": "Movie Index", "MovieIndex": "Movie Index",
"MovieInfoLanguage": "Movie Info Language",
"MovieInfoLanguageHelpText": "Language that Radarr will use for Movie Information in UI",
"MovieInfoLanguageHelpTextWarning": "Browser Reload Required", "MovieInfoLanguageHelpTextWarning": "Browser Reload Required",
"MovieIsDownloading": "Movie is downloading", "MovieIsDownloading": "Movie is downloading",
"MovieIsDownloadingInterp": "Movie is downloading - {0}% {1}", "MovieIsDownloadingInterp": "Movie is downloading - {0}% {1}",
@ -635,8 +637,6 @@
"SettingsShowRelativeDates": "Show Relative Dates", "SettingsShowRelativeDates": "Show Relative Dates",
"SettingsShowRelativeDatesHelpText": "Show relative (Today/Yesterday/etc) or absolute dates", "SettingsShowRelativeDatesHelpText": "Show relative (Today/Yesterday/etc) or absolute dates",
"SettingsTimeFormat": "Time Format", "SettingsTimeFormat": "Time Format",
"SettingsUiLanguage": "UI Language",
"SettingsUiLanguageHelpText": "Language that Radarr will use for UI",
"SettingsWeekColumnHeader": "Week Column Header", "SettingsWeekColumnHeader": "Week Column Header",
"SettingsWeekColumnHeaderHelpText": "Shown above each column when week is the active view", "SettingsWeekColumnHeaderHelpText": "Shown above each column when week is the active view",
"ShouldMonitorHelpText": "If enabled, movies added by this list are added and monitored", "ShouldMonitorHelpText": "If enabled, movies added by this list are added and monitored",
@ -718,6 +718,9 @@
"TotalSpace": "Total Space", "TotalSpace": "Total Space",
"Type": "Type", "Type": "Type",
"UI": "UI", "UI": "UI",
"UILanguage": "UI Language",
"UILanguageHelpText": "Language that Radarr will use for UI",
"UILanguageHelpTextWarning": "Browser Reload Required",
"UISettings": "UI Settings", "UISettings": "UI Settings",
"UISettingsSummary": "Calendar, date and color impaired options", "UISettingsSummary": "Calendar, date and color impaired options",
"UnableToAddANewConditionPleaseTryAgain": "Unable to add a new condition, please try again.", "UnableToAddANewConditionPleaseTryAgain": "Unable to add a new condition, please try again.",

View File

@ -45,14 +45,14 @@ public LocalizationService(IConfigService configService,
public Dictionary<string, string> GetLocalizationDictionary() public Dictionary<string, string> GetLocalizationDictionary()
{ {
var language = IsoLanguages.Get((Language)_configService.MovieInfoLanguage).TwoLetterCode; var language = IsoLanguages.Get((Language)_configService.UILanguage).TwoLetterCode;
return GetLocalizationDictionary(language); return GetLocalizationDictionary(language);
} }
public string GetLocalizedString(string phrase) public string GetLocalizedString(string phrase)
{ {
var language = IsoLanguages.Get((Language)_configService.MovieInfoLanguage).TwoLetterCode; var language = IsoLanguages.Get((Language)_configService.UILanguage).TwoLetterCode;
return GetLocalizedString(phrase, language); return GetLocalizedString(phrase, language);
} }
@ -66,7 +66,7 @@ public string GetLocalizedString(string phrase, string language)
if (language.IsNullOrWhiteSpace()) if (language.IsNullOrWhiteSpace())
{ {
language = IsoLanguages.Get((Language)_configService.MovieInfoLanguage).TwoLetterCode; language = IsoLanguages.Get((Language)_configService.UILanguage).TwoLetterCode;
} }
if (language == null) if (language == null)

View File

@ -20,6 +20,7 @@ public class UiConfigResource : RestResource
public bool EnableColorImpairedMode { get; set; } public bool EnableColorImpairedMode { get; set; }
public int MovieInfoLanguage { get; set; } public int MovieInfoLanguage { get; set; }
public int UILanguage { get; set; }
} }
public static class UiConfigResourceMapper public static class UiConfigResourceMapper
@ -39,7 +40,8 @@ public static UiConfigResource ToResource(IConfigService model)
ShowRelativeDates = model.ShowRelativeDates, ShowRelativeDates = model.ShowRelativeDates,
EnableColorImpairedMode = model.EnableColorImpairedMode, EnableColorImpairedMode = model.EnableColorImpairedMode,
MovieInfoLanguage = model.MovieInfoLanguage MovieInfoLanguage = model.MovieInfoLanguage,
UILanguage = model.UILanguage
}; };
} }
} }