mirror of
https://github.com/Readarr/Readarr
synced 2026-05-08 21:13:58 +02:00
Deserialize asynchronously in LocalizationService
(cherry picked from commit 86a7f7bd54aa733b0e3abd3ec9463a85dd348118) Closes #2561
This commit is contained in:
parent
10766dd227
commit
de24aef059
1 changed files with 5 additions and 14 deletions
|
|
@ -146,21 +146,12 @@ private async Task CopyInto(IDictionary<string, string> dictionary, string resou
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var fs = File.OpenRead(resourcePath))
|
await using var fs = File.OpenRead(resourcePath);
|
||||||
{
|
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||||
if (fs != null)
|
|
||||||
{
|
|
||||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
|
||||||
|
|
||||||
foreach (var key in dict.Keys)
|
foreach (var key in dict.Keys)
|
||||||
{
|
{
|
||||||
dictionary[key] = dict[key];
|
dictionary[key] = dict[key];
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_logger.Error("Missing translation/culture resource: {0}", resourcePath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue