public static DeleteLanguage ( CultureInfo cultureInfo ) : void | ||
cultureInfo | CultureInfo | /// Culture info. /// |
Résultat | void |
void OnGUI() { if (EditorWindowUtility.ShowWindow()) { GUILayout.Label("Settings", EditorStyles.boldLabel); if (!LocFileUtility.CheckIfRootLanguageFileExists()) { if (GUILayout.Button("Create New Localization System")) { LocFileUtility.CreateRootResourceFile(); } } else { undoManager.CheckUndo(); if (GUILayout.Button("Refresh")) { LocFileUtility.CheckAvailableLanguages(availableLanguages, notAvailableLanguages, notAvailableLanguagesEnglishNames); } EditorGUILayout.BeginHorizontal(); GUILayout.Label("Microsoft Translator Settings", EditorStyles.boldLabel, GUILayout.Width(200)); if (microsoftTranslator.IsInitialized) { GUILayout.Label(" - Authenticated!", EditorStyles.miniLabel); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Client ID:", GUILayout.Width(70)); mtCliendID = EditorGUILayout.TextField(mtCliendID); GUILayout.Label("Client Secret:", GUILayout.Width(100)); mtCliendSecret = EditorGUILayout.TextField(mtCliendSecret); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Save", GUILayout.Width(50))) { SaveMicrosoftTranslatorSettings(); if (!microsoftTranslator.IsInitialized) { microsoftTranslator.GetAccessToken(mtCliendID, mtCliendSecret); } } if (!microsoftTranslator.IsInitialized) { if (GUILayout.Button("Authenticate!", GUILayout.Width(150))) { microsoftTranslator.GetAccessToken(mtCliendID, mtCliendSecret); } } keepTranslatorAuthenticated = EditorGUILayout.Toggle("Keep Authenticated", keepTranslatorAuthenticated); EditorGUILayout.EndHorizontal(); GUILayout.Label("Edit Root Language File", EditorStyles.boldLabel); if (GUILayout.Button("Edit")) { ShowRootEditWindow(LocFileUtility.LoadParsedLanguageFile(null)); } GUILayout.Label("Create new language", EditorStyles.boldLabel); chosenCreateNewCultureValue = EditorGUILayout.Popup(chosenCreateNewCultureValue, notAvailableLanguagesEnglishNames.ToArray()); if (GUILayout.Button("Create Language")) { CreateNewLanguage(notAvailableLanguagesEnglishNames[chosenCreateNewCultureValue]); } GUILayout.Label("Translate Languages", EditorStyles.boldLabel); //Start the scroll view scrollPosition = GUILayout.BeginScrollView(scrollPosition); bool languageDeleted = false; foreach (CultureInfo info in availableLanguages) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(info.EnglishName + " - " + info.Name)) { //Open language edit window ShowTranslateWindow(info); } if (GUILayout.Button("Delete", GUILayout.Width(60))) { LocFileUtility.DeleteLanguage(info); languageDeleted = true; break; } EditorGUILayout.EndHorizontal(); } if (languageDeleted) //Refresh { LocFileUtility.CheckAvailableLanguages(availableLanguages, notAvailableLanguages, notAvailableLanguagesEnglishNames); } //End the scroll view GUILayout.EndScrollView(); undoManager.CheckDirty(); } } }