void ShowExportGUI() { if (GUILayout.Button("Export")) { string folderPath = EditorUtility.OpenFolderPanel("Select folder to save to.", "", ""); 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("Exported CSV file to " + 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("Exported XLS file to " + fullPath); this.Close(); } else { Debug.LogError("BulkUpdateWindow: Unsupported export format!"); } } }
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); }