1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -36,7 +37,11 @@ namespace Net.BITKit.Localization
|
||||
|
||||
for (var i = 1; i < headers.Length; i++) // 跳过 "Key" 列
|
||||
{
|
||||
dict[headers[i]] = new Dictionary<string, string>();
|
||||
var header = headers[i];
|
||||
if (dict.ContainsKey(header) is false)
|
||||
{
|
||||
dict.Add(header, new Dictionary<string, string>());
|
||||
}
|
||||
}
|
||||
|
||||
string? line;
|
||||
@@ -48,7 +53,15 @@ namespace Net.BITKit.Localization
|
||||
var key = columns[0]; // 取 Key 值
|
||||
for (var i = 1; i < columns.Length; i++)
|
||||
{
|
||||
dict[headers[i]][key] = columns[i]; // 填充语言数据
|
||||
if(i>headers.Length-1)continue;
|
||||
var header = headers[i];
|
||||
if (dict.TryGetValue(header, out var d) is false)
|
||||
{
|
||||
d = new Dictionary<string, string>();
|
||||
dict.Add(header,d);
|
||||
}
|
||||
d.Set(key,columns[i]);
|
||||
//dict[headers[i]][key] = columns[i]; // 填充语言数据
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +70,7 @@ namespace Net.BITKit.Localization
|
||||
|
||||
private async UniTask OnLanguageChangeAsync(string arg1, string arg2)
|
||||
{
|
||||
var csv = await new HttpClient().GetStringAsync(Url);
|
||||
var csv = await new HttpClient().GetStringAsync(Url+$"?{DateTime.Now.Ticks}");
|
||||
|
||||
_logger.LogInformation($"下载完成:\n{csv}");
|
||||
|
||||
|
Reference in New Issue
Block a user