From 09ed5a36187933995918b8761efd9a1054079280 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Sun, 28 Jan 2018 14:42:09 +0100 Subject: [PATCH] Make strings in the report assistant localizable --- Output/Languages/English.xml | 15 +++++++++++++++ Vocaluxe/Reporting/Reporter.cs | 35 +++++++++++++++++----------------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index b6d55298..948080a0 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -242,4 +242,19 @@ Volume Server address Server is not running. Please check config.xml! + We are sorry + that Vocaluxe run into an error and crashed.\r\nTo help us fix the problem please send us a report.\r\nEdit the following log before submitting to remove possibly sensitive information. + that you experienced an error.\r\nTo help us fix the problem please send us a report.\r\nEdit the following log before submitting to remove possibly sensitive information. + Don\'t upload anything (you can still copy the error message above) + Upload and open an issue (publicly visible + requires a github account) + Upload and get a link to your report (publicly visible) + Submit + Uploading + Exit + Continue + The link to your report: + Error uploading the log. + Last error + Not available + Describe your issue here.\n\n### Steps to reproduce\nTell us how to reproduce this issue.\n\n### Vocaluxe version and logfile\n{0}\n{1} diff --git a/Vocaluxe/Reporting/Reporter.cs b/Vocaluxe/Reporting/Reporter.cs index 2974836e..e6297e3a 100644 --- a/Vocaluxe/Reporting/Reporter.cs +++ b/Vocaluxe/Reporting/Reporter.cs @@ -23,29 +23,30 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using Newtonsoft.Json; +using Vocaluxe.Base; using VocaluxeLib.Log; namespace Vocaluxe.Reporting { public partial class CReporter : Form { - private string _TitleText = "We are sorry"; - private string _MessageCrashText = "that Vocaluxe run into an error and crashed.\r\nTo help us fix the problem please send us a report.\r\nEdit the following log before submitting to remove possibly sensitive information."; - private string _MessageNoCrashText = "that you experienced an error.\r\nTo help us fix the problem please send us a report.\r\nEdit the following log before submitting to remove possibly sensitive information."; - private string _NoUploadText = "Don\'t upload anything (you can still copy the error message above)"; - private string _GistAndIssueText = "Upload and open an issue (publicly visible + requires a github account)"; - private string _GistOnlyText = "Upload and get a link to your report (publicly visible)"; - private string _SubmitStep0Text = "Submit"; - private string _SubmitStep1Text = "Uploading"; - private string _SubmitStep2ExitText = "Exit"; - private string _SubmitStep2ContinueText = "Continue"; - private string _SubmitedMessageText = "The link to your report:"; - private string _LogUploadErrorText = "Error uploading the log."; - private string _LastErrorTitleText = "Last error"; - private string _LastErrorNA = "Not available"; + private readonly string _TitleText = CLanguage.Translate("TR_REPORTER_TITLE_TEXT"); + private readonly string _MessageCrashText = CLanguage.Translate("TR_REPORTER_MESSAGE_CRASH_TEXT"); + private readonly string _MessageNoCrashText = CLanguage.Translate("TR_REPORTER_MESSAGE_NO_CRASH_TEXT"); + private readonly string _NoUploadText = CLanguage.Translate("TR_REPORTER_NO_UPLOAD_TEXT"); + private readonly string _GistAndIssueText = CLanguage.Translate("TR_REPORTER_GIST_AND_ISSUE_TEXT"); + private readonly string _GistOnlyText = CLanguage.Translate("TR_REPORTER_GIST_ONLY_TEXT"); + private readonly string _SubmitStep0Text = CLanguage.Translate("TR_REPORTER_SUBMIT_STEP0_TEXT"); + private readonly string _SubmitStep1Text = CLanguage.Translate("TR_REPORTER_SUBMIT_STEP1_TEXT"); + private readonly string _SubmitStep2ExitText = CLanguage.Translate("TR_REPORTER_SUBMIT_STEP2_EXIT_TEXT"); + private readonly string _SubmitStep2ContinueText = CLanguage.Translate("TR_REPORTER_SUBMIT_STEP2_CONTINUE_TEXT"); + private readonly string _SubmitedMessageText = CLanguage.Translate("TR_REPORTER_SUBMITED_MESSAGE_TEXT"); + private readonly string _LogUploadErrorText = CLanguage.Translate("TR_REPORTER_LOGUPLOAD_ERROR_TEXT"); + private readonly string _LastErrorTitleText = CLanguage.Translate("TR_REPORTER_LAST_ERROR_TITLE_TEXT"); + private readonly string _LastErrorNa = CLanguage.Translate("TR_REPORTER_LAST_ERROR_NA"); + private readonly string _IssueTemplate = CLanguage.Translate("TR_REPORTER_ISSUE_TEMPLATE"); - - private string _IssueTemplate = "Describe your issue here.\n\n### Steps to reproduce\nTell us how to reproduce this issue.\n\n### Vocaluxe version and logfile\n{0}\n{1}"; + //CLanguage.Translate("TR_DEBUG_AUDIO_STREAMS") private int _Step = 0; private readonly bool _Crash; @@ -112,7 +113,7 @@ namespace Vocaluxe.Reporting this.SubmitButton.Text = _SubmitStep0Text; this.SubmitedTitleLabel.Text = _SubmitedMessageText; this.LastErrorTitleLabel.Text = _LastErrorTitleText; - this.LastErrorBox.Text = string.IsNullOrWhiteSpace(lastError) ? _LastErrorNA : lastError; + this.LastErrorBox.Text = string.IsNullOrWhiteSpace(lastError) ? _LastErrorNa : lastError; this.LogBox.Text = log.Replace("\n","\r\n"); this.LogBox.SelectionStart = 0; }