Fix creating localization table on blank project

#1060
This commit is contained in:
Wojtek Figat
2023-05-05 14:54:42 +02:00
parent 315df12fbe
commit 37e8fa7b76
5 changed files with 14 additions and 6 deletions

View File

@@ -145,7 +145,10 @@ namespace FlaxEditor.CustomEditors.Dedicated
else
{
// No localization so initialize with empty table
var path = Path.Combine(Path.Combine(Path.GetDirectoryName(GameSettings.Load().Localization.Path), "Localization", culture.Name + ".json"));
var folder = Path.Combine(Path.GetDirectoryName(GameSettings.Load().Localization.Path), "Localization");
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
var path = Path.Combine(Path.Combine(folder, culture.Name + ".json"));
var table = FlaxEngine.Content.CreateVirtualAsset<LocalizedStringTable>();
table.Locale = culture.Name;
if (!table.Save(path))