diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-11 11:36:25 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-11 11:36:25 -0400 |
| commit | f5261fc4b7b78b5b7bfd9f0e78338f0905eb3bb5 (patch) | |
| tree | 5ffceeb4239ecd3be8cfe33bc31bd6c524886ace /MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | |
| parent | efef76424e6db71b139a13a51f56f043902b31de (diff) | |
extract nowplayingbar into standalone widget to work with any player
Diffstat (limited to 'MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index 1a85d9133..3672afbc2 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -125,7 +125,18 @@ namespace MediaBrowser.Server.Implementations.Localization public IEnumerable<CountryInfo> GetCountries() { return CultureInfo.GetCultures(CultureTypes.SpecificCultures) - .Select(c => new RegionInfo(c.LCID)) + .Select(c => + { + try + { + return new RegionInfo(c.LCID); + } + catch (CultureNotFoundException) + { + return null; + } + }) + .Where(i => i != null) .OrderBy(c => c.DisplayName) .DistinctBy(c => c.TwoLetterISORegionName) .Select(c => new CountryInfo @@ -356,7 +367,7 @@ namespace MediaBrowser.Server.Implementations.Localization }.OrderBy(i => i.Name); } - public string LocalizeDocument(string document, string culture, Func<string,string> tokenBuilder) + public string LocalizeDocument(string document, string culture, Func<string, string> tokenBuilder) { foreach (var pair in GetLocalizationDictionary(culture).ToList()) { |
