public LocalizationUnitReference(LocalizationGroup group, string unitPath, bool createIfNeeded = false) { Group = group; UnitPath = unitPath; UnitName = Path.GetFileNameWithoutExtension(unitPath); if (createIfNeeded && !File.Exists(UnitPath)) { Create(); } }
private LocalizationGroup CreateGroup(string name) { if (!AllowEditPackFile) { Debug.LogError("ORLL: LocalizationPack: This pack is not allowed to write to disk."); return(null); } Debug.Log("Create group " + name); var g = new LocalizationGroup(this, PackPath, name, true); Groups.Add(g); GroupNames.Add(name); Save(); return(g); }
internal void Migrate(LocalizationGroup newGroup) { var newReference = newGroup.RequestReference(UnitName); int i = 0; LocalizationUnitHandle prevHandle = null; while (i < Handles.Count) { prevHandle = Handles[i]; newReference.RegisterHandle(Handles[i]); if (i < Handles.Count && prevHandle == Handles[i]) { i++; } } }