/// <summary> /// Starts the generator /// </summary> private void ShowOverview() { var browser = new Browser(Language.T("Strategy Overview"), Data.Strategy.GenerateHtmlOverview()); browser.Show(); }
/// <summary> /// Opens the strategy overview window /// </summary> private void MenuStrategyOverviewOnClick(object sender, EventArgs e) { var so = new Browser(Language.T("Strategy Overview"), Data.Strategy.GenerateHtmlOverview()); so.Show(); }
/// <summary> /// Shows the phrases in a web browser. /// </summary> /// <param name="iWhatToshow">1 - English, 2 - Alt, 3 - Both, 4 - Wiki</param> public static void ShowPhrases(int iWhatToShow) { StringBuilder sb = new StringBuilder(); // Header sb.AppendLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"); sb.AppendLine("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">"); sb.AppendLine("<head><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" />"); sb.AppendLine("<title>" + Configs.Language + "</title>"); sb.AppendLine("<style type=\"text/css\">"); sb.AppendLine("body {padding: 0 10px 10px 10px; margin: 0px; font-family: Verdana, Helvetica, Arial, Sans-Serif; font-size: 62.5%; background-color: #fffffe; color: #000033}"); sb.AppendLine(".content h1 {font-size: 1.9em; text-align: center;}"); sb.AppendLine(".content h2 {font-size: 1.6em;}"); sb.AppendLine(".content p {color: #000033; font-size: 1.3em; text-align: left}"); sb.AppendLine("</style>"); sb.AppendLine("</head>"); sb.AppendLine("<body>"); sb.AppendLine("<div class=\"content\" id=\"header\">"); sb.AppendLine("<h1>" + T("Language Phrases") + "</h1>"); string[] asEnglishPhrases = new string[dictLanguage.Count]; string[] asAltPhrases = new string[dictLanguage.Count]; dictLanguage.Keys.CopyTo(asEnglishPhrases, 0); dictLanguage.Values.CopyTo(asAltPhrases, 0); string sTranslating = "<p>" + T("Translated by") + ": " + sTranslatedBy + "<br />" + T("Website") + ": <a href=\"" + sWebsite + "\" target=\"_blanc\">" + sWebsite + "</a>" + "<br />" + T("Contacts") + ": " + sContacts + "</p><hr />"; if (iWhatToShow == 1) { sb.AppendLine("<h2>" + T("Useful for Automatic Translation") + "</h2>"); sb.AppendLine(sTranslating); sb.AppendLine("<p>"); foreach (string sPhrase in asEnglishPhrases) { sb.AppendLine(sPhrase + "<br/>"); } sb.AppendLine("</p>"); } else if (iWhatToShow == 2) { sb.AppendLine("<h2>" + T("Useful for Spell Check") + "</h2>"); sb.AppendLine(sTranslating); sb.AppendLine("<p>"); foreach (string sPhrase in asAltPhrases) { sb.AppendLine(sPhrase + "<br/>"); } sb.AppendLine("</p>"); } else if (iWhatToShow == 3) { sb.AppendLine("<h2>" + T("Useful for Translation Check") + "</h2>"); sb.AppendLine(sTranslating); sb.AppendLine("<p>"); foreach (string sPhrase in asEnglishPhrases) { sb.AppendLine(sPhrase + " - " + dictLanguage[sPhrase] + "<br/>"); } sb.AppendLine("</p>"); } else if (iWhatToShow == 4) { sb.AppendLine("<h2>" + T("Wiki Format") + "</h2>"); sb.AppendLine(sTranslating); sb.AppendLine("<p>"); sb.AppendLine("====== " + Configs.Language + " ======" + "<br/><br/>"); sb.AppendLine("Please edit the right column only!<br/><br/>"); sb.AppendLine("^ English ^" + Configs.Language + "^" + "<br/>"); foreach (string sPhrase in asEnglishPhrases) { sb.AppendLine("| " + sPhrase + " | " + dictLanguage[sPhrase] + " |" + "<br/>"); } sb.AppendLine("</p>"); } // Footer sb.AppendLine("</div></body></html>"); Browser brwsr = new Browser(T("Translation"), sb.ToString()); brwsr.Show(); return; }