public void DrawContent() { if(!GetLanguagesGUI()) { return; } if(_allKnownConfigurations.Count == 0) { createANewConfig(); if(_allKnownConfigurations.Count == 0) return; } advancedOptions = EditorGUILayout.Toggle("Advanced Options", advancedOptions); if(advancedOptions) { showAllLanguages = EditorGUILayout.Toggle("Show all langauges, not just simplified list", showAllLanguages); SelectAConfig(); createANewConfig(); } else { selectedConfig = getOrCreateGameTranslationConfig(""); } if(selectedConfig == null) { return; } DisplaySelectedTranslationConfiguration(selectedConfig); GUILayout.Space(30); if(GUILayout.Button("SHOW MISSING TRANSLATION COUNTS")) { if(_estimate == null) { _estimate = new TranslationEstimate(_mediator); } StringBuilder sb = new StringBuilder(); foreach(var dest in selectedConfig.destinationLanguages) { int missing = _estimate.numberOfMissingTranslationsBetweenLanguages(selectedConfig.sourceLanguage, dest, selectedConfig.translation_set_group); if(missing > 0) { sb.AppendFormat("Language {0} is missing {1} translations\n", dest.name, missing); } } EditorUtility.DisplayDialog("MISSING", "Missing this many translations:\n" + sb.ToString(), "OK"); } GUILayout.Space(30); GUILayout.Label("Account options:"); if(!userHasSetCredentials()) { GUILayout.Label("Log in to translate your text as well as upload and download your local translations"); ShowLoginFields(); //return; } else { if(GUILayout.Button("LOG OUT OF ACCOUNT")) { _mediator.setUsernamePassword("", ""); } } ShowUploadDownload(); DoTranslation(); }
private void DoTranslation() { //TODO: review estimation algorithm GUILayout.Space(30); GUILayout.Label("Translate all known language from source to destination languages:"); if(_estimate == null) { _estimate = new TranslationEstimate(_mediator); } _estimate.presentEstimateAndMakeOrder(selectedConfig); }