-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
653 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Text.Json; | ||
|
||
namespace StatisticAnalysisTool.Extractor; | ||
|
||
internal class SpellData | ||
{ | ||
public static async Task ExtractAsJsonAsync(LocalizationData localizationData, string outputFolderPath) | ||
{ | ||
var spells = new List<SpellLoc>(); | ||
|
||
foreach (var spellName in localizationData.SpellLocalizedNames) | ||
{ | ||
var tuId = spellName.Key; | ||
var descriptions = localizationData.SpellLocalizedDescriptions.FirstOrDefault(x => x.Key.Contains(tuId)).Value ?? new Dictionary<string, string>(); | ||
|
||
var uniqueName = tuId.Replace("@SPELLS_", "").Replace("_DESC", ""); | ||
|
||
spells.Add(new SpellLoc | ||
{ | ||
UniqueName = uniqueName, | ||
LocalizedNames = spellName.Value, | ||
LocalizedDescriptions = descriptions | ||
}); | ||
} | ||
|
||
var json = JsonSerializer.Serialize(spells, new JsonSerializerOptions | ||
{ | ||
WriteIndented = true, | ||
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping | ||
}); | ||
|
||
var outputFilePath = Path.Combine(outputFolderPath, "spells-localization.json"); | ||
await File.WriteAllTextAsync(outputFilePath, json); | ||
} | ||
|
||
internal class SpellLoc | ||
{ | ||
public string? UniqueName { get; init; } | ||
public Dictionary<string, string>? LocalizedNames { get; init; } | ||
public Dictionary<string, string>? LocalizedDescriptions { get; init; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.