aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Localization/LocalizationManager.cs
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-02-08 10:03:38 +0100
committerBond-009 <bond.009@outlook.com>2019-02-08 22:10:55 +0100
commitc3c52b66822d94c92e0f66603e868ba8f98df4b0 (patch)
tree8436b81a969328f43d8e3aaefc64a37d44a54bab /Emby.Server.Implementations/Localization/LocalizationManager.cs
parent80281e599df0ee9d838d7de20418907de0159fa8 (diff)
Default to en-US for missing core translations
Diffstat (limited to 'Emby.Server.Implementations/Localization/LocalizationManager.cs')
-rw-r--r--Emby.Server.Implementations/Localization/LocalizationManager.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs
index 8651a7dad..7cf42a50a 100644
--- a/Emby.Server.Implementations/Localization/LocalizationManager.cs
+++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs
@@ -460,11 +460,15 @@ namespace Emby.Server.Implementations.Localization
{
using (var stream = _assembly.GetManifestResourceStream(resourcePath))
{
- var dict = await _jsonSerializer.DeserializeFromStreamAsync<Dictionary<string, string>>(stream);
-
- foreach (var key in dict.Keys)
+ // If a Culture doesn't have a translation the stream will be null and it defaults to en-us further up the chain
+ if (stream != null)
{
- dictionary[key] = dict[key];
+ var dict = await _jsonSerializer.DeserializeFromStreamAsync<Dictionary<string, string>>(stream);
+
+ foreach (var key in dict.Keys)
+ {
+ dictionary[key] = dict[key];
+ }
}
}
}