void ShowExportGUI() { if (GUILayout.Button("Экспорт")) { string folderPath = EditorUtility.OpenFolderPanel("Выберите папку для сохранения.", "", ""); if (availableFileFormats[chosenFileFormat] == csvFileEnding) { string fullPath = folderPath + "/" + exportFileName + csvFileEnding; CSVParser.Write(fullPath, CSVParser.GetDelimiter(delimiter), new List <string>(LanguageHandlerEditor.LoadLanguageFile(null, true).Keys), LanguageHandlerEditor.LoadAllLanguageFiles()); Debug.Log("Экспортирован файл CSV в " + fullPath); this.Close(); } else if (availableFileFormats[chosenFileFormat] == xlsFileEnding) { string fullPath = folderPath + "/" + exportFileName + xlsFileEnding; XLSExporter.Write(fullPath, "Languages", new List <string>(LanguageHandlerEditor.LoadLanguageFile(null, true).Keys), LanguageHandlerEditor.LoadAllLanguageFiles()); Debug.Log("Экспортирован файл XLS в " + fullPath); this.Close(); } else { Debug.LogError("BulkUpdateWindow: Неподдерживаемый формат экспорта!"); } } }
void ExportToCSV(string chosenExportFolder) { string name = chosenCulture.englishName + " - " + chosenCulture.languageCode + ".csv"; var input = new List <List <string> >(); Dictionary <string, LocalizedObject> languageItems = LanguageHandlerEditor.LoadParsedLanguageFile(chosenCulture.languageCode, false); foreach (var item in languageItems) { var row = new List <string>(); row.Add(item.Key); row.Add(item.Value.TextValue); input.Add(row); } CSVParser.Write(chosenExportFolder + "/" + name, CSVParser.GetDelimiter(delimiter), input); }
public static void WriteCSV(string path, char delimiter, List <string> keys, Dictionary <string, Dictionary <string, string> > languages) { CSVParser.Write(path, delimiter, keys, languages); }
public static void WriteCSV(string path, char delimiter, List <List <string> > input) { CSVParser.Write(path, delimiter, input); }