From 5c0993f83e26e64509d232c1c5aa1d75a268bcca Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Tue, 11 Mar 2014 15:24:47 -0700 Subject: [PATCH] Changed the interface to translations. --- AboutPage/AboutPage.cs | 60 ++++++------- AboutPage/ContactForm.cs | 30 +++---- ActionBar/ActionBarBaseControls.cs | 12 +-- ActionBar/HelpTextWidget.cs | 12 +-- ActionBar/PrintActionRow.cs | 40 ++++----- ActionBar/PrintStatusRow.cs | 26 +++--- ActionBar/PrinterActionRow.cs | 6 +- ConfigurationPage/ConfigurationPage.cs | 20 ++--- ConfigurationPage/PrintLevelWizard.cs | 84 +++++++++---------- ControlElements/StyledMessageBoxWindow.cs | 6 +- CustomWidgets/ExportQueueItemWindow.cs | 16 ++-- CustomWidgets/ExportToFolderFeedbackWindow.cs | 4 +- CustomWidgets/SavePartsSheetFeedbackWindow.cs | 4 +- CustomWidgets/WizardControl.cs | 6 +- EeProm/EePromMarlinWidget.cs | 6 +- EeProm/EePromRepetierWidget.cs | 16 ++-- LocalizedString.cs | 39 +++------ MainSlidePanel.cs | 20 ++--- PartPreviewWindow/GcodeViewBasic.cs | 36 ++++---- PartPreviewWindow/PartPreviewMainWindow.cs | 6 +- PartPreviewWindow/View3DTransfromPart.cs | 58 ++++++------- PrintLibrary/ExportLibraryItemWindow.cs | 16 ++-- PrintLibrary/PluginChooserWindow.cs | 6 +- PrintLibrary/PrintLibraryListItem.cs | 8 +- PrintLibrary/PrintLibraryWidget.cs | 6 +- PrintQueue/PrintQueueItem.cs | 18 ++-- PrintQueue/PrintQueueMenu.cs | 26 +++--- PrintQueue/QueueControlsWidget.cs | 4 +- PrinterCommunication/PrinterCommunication.cs | 18 ++-- PrinterControls/EditMacrosWindow.cs | 26 +++--- .../EditManualMovementSpeedsWindow.cs | 12 +-- .../EditTemperaturePresetsWindow.cs | 14 ++-- PrinterControls/MacroControls.cs | 4 +- PrinterControls/ManualPrinterControls.cs | 44 +++++----- PrinterControls/OutputScrollWindow.cs | 8 +- .../PrinterConnections/AddConnectionWidget.cs | 30 +++---- .../ChooseConnectionWidget.cs | 12 +-- .../PrinterConnections/ConnectionWindow.cs | 6 +- .../PrinterConnections/PrinterChooser.cs | 8 +- .../PrinterConnections/PrinterListItems.cs | 6 +- .../SetupConnectionWidgetBase.cs | 4 +- .../PrinterConnections/SetupStepBaudRate.cs | 18 ++-- .../SetupStepComPortManual.cs | 26 +++--- .../PrinterConnections/SetupStepComPortOne.cs | 14 ++-- .../PrinterConnections/SetupStepComPortTwo.cs | 30 +++---- .../SetupStepInstallDriver.cs | 14 ++-- .../SetupStepMakeModelName.cs | 14 ++-- PrinterControls/TemperatureIndicator.cs | 6 +- PrinterControls/XYZJogControls.cs | 4 +- SlicerConfiguration/ActiveSliceSettings.cs | 6 +- SlicerConfiguration/SettingsControlBar.cs | 16 ++-- SlicerConfiguration/SliceSettingsOrganizer.cs | 2 +- SlicerConfiguration/SliceSettingsWidget.cs | 18 ++-- SlicerConfiguration/SlicingQueue.cs | 2 +- StaticData/Translations/Master.txt | 3 + StaticData/Translations/fr/Translation.txt | 3 + ToolsPage/ToolsWidget.cs | 6 +- WidescreenPanel.cs | 8 +- 58 files changed, 481 insertions(+), 492 deletions(-) diff --git a/AboutPage/AboutPage.cs b/AboutPage/AboutPage.cs index 0e605132f..3573a2e60 100644 --- a/AboutPage/AboutPage.cs +++ b/AboutPage/AboutPage.cs @@ -84,18 +84,18 @@ namespace MatterHackers.MatterControl GuiWidget horizontalSpacer = new GuiWidget(); horizontalSpacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; - checkUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Check for Update").Translated); + checkUpdateLink = textImageButtonFactory.Generate(LocalizedString.Get("Check for Update")); checkUpdateLink.VAnchor = VAnchor.ParentCenter; checkUpdateLink.Click += CheckForUpdate; checkUpdateLink.Visible = false; - downloadUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Download Update").Translated); + downloadUpdateLink = textImageButtonFactory.Generate(LocalizedString.Get("Download Update")); downloadUpdateLink.VAnchor = VAnchor.ParentCenter; downloadUpdateLink.Click += DownloadUpdate; downloadUpdateLink.Visible = false; - installUpdateLink = textImageButtonFactory.Generate(new LocalizedString("Install Update").Translated); + installUpdateLink = textImageButtonFactory.Generate(LocalizedString.Get("Install Update")); installUpdateLink.VAnchor = VAnchor.ParentCenter; installUpdateLink.Click += InstallUpdate; installUpdateLink.Visible = false; @@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl { if (!updateInitiated) { - updateStatusText.Text = new LocalizedString("Checking for updates...").Translated; + updateStatusText.Text = LocalizedString.Get("Checking for updates..."); checkUpdateLink.Visible = false; updateInitiated = true; @@ -206,7 +206,7 @@ namespace MatterHackers.MatterControl catch { installUpdateLink.Visible = false; - updateStatusText.Text = string.Format(new LocalizedString("Oops! Unable to install update.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("Oops! Unable to install update.")); if (System.IO.File.Exists(friendlyFileName)) { System.IO.File.Delete(friendlyFileName); @@ -221,7 +221,7 @@ namespace MatterHackers.MatterControl if (!updateInitiated) { downloadUpdateLink.Visible = false; - updateStatusText.Text = string.Format(new LocalizedString("Downloading updates...").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("Downloading updates...")); updateInitiated = true; string downloadUri = string.Format("https://mattercontrol.appspot.com/downloads/development/{0}", ApplicationSettings.Instance.get("CurrentBuildToken")); @@ -260,13 +260,13 @@ namespace MatterHackers.MatterControl void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { this.downloadPercent = e.ProgressPercentage; //This doesn't work currently - updateStatusText.Text = string.Format(new LocalizedString("Downloading updates...").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("Downloading updates...")); } void DownloadCompleted(object sender, EventArgs e) { this.updateInitiated = false; - updateStatusText.Text = string.Format(new LocalizedString("New updates are ready to install.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("New updates are ready to install.")); downloadUpdateLink.Visible = false; installUpdateLink.Visible = true; checkUpdateLink.Visible = false; @@ -281,19 +281,19 @@ namespace MatterHackers.MatterControl if (applicationBuildToken == currentBuildToken || currentBuildToken == null) { - updateStatusText.Text = string.Format(new LocalizedString("New updates may be available.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("New updates may be available.")); checkUpdateLink.Visible = true; } else if (System.IO.File.Exists(updateFileName)) { - updateStatusText.Text = string.Format(new LocalizedString("New updates are ready to install.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("New updates are ready to install.")); installUpdateLink.Visible = true; checkUpdateLink.Visible = false; } else { //updateStatusText.Text = string.Format("New version available: {0}", ApplicationSettings.Instance.get("CurrentReleaseVersion")); - updateStatusText.Text = string.Format(new LocalizedString("There are updates available.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("There are updates available.")); downloadUpdateLink.Visible = true; checkUpdateLink.Visible = false; } @@ -309,7 +309,7 @@ namespace MatterHackers.MatterControl if (applicationBuildToken == currentBuildToken) { - updateStatusText.Text = string.Format(new LocalizedString("Your application is up-to-date.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("Your application is up-to-date.")); downloadUpdateLink.Visible = false; installUpdateLink.Visible = false; checkUpdateLink.Visible = true; @@ -317,7 +317,7 @@ namespace MatterHackers.MatterControl } else if (System.IO.File.Exists(updateFileName)) { - updateStatusText.Text = string.Format(new LocalizedString("New updates are ready to install.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("New updates are ready to install.")); downloadUpdateLink.Visible = false; installUpdateLink.Visible = true; checkUpdateLink.Visible = false; @@ -325,7 +325,7 @@ namespace MatterHackers.MatterControl } else { - updateStatusText.Text = string.Format(new LocalizedString("There is a recommended update available.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("There is a recommended update available.")); //updateStatusText.Text = string.Format("New version available: {0}", ApplicationSettings.Instance.get("CurrentReleaseVersion")); downloadUpdateLink.Visible = true; installUpdateLink.Visible = false; @@ -338,7 +338,7 @@ namespace MatterHackers.MatterControl void onVersionRequestFailed(object sender, EventArgs e) { this.updateInitiated = false; - updateStatusText.Text = string.Format(new LocalizedString("No updates are currently available.").Translated); + updateStatusText.Text = string.Format(LocalizedString.Get("No updates are currently available.")); checkUpdateLink.Visible = true; downloadUpdateLink.Visible = false; installUpdateLink.Visible = false; @@ -383,17 +383,17 @@ namespace MatterHackers.MatterControl headerContainer.Margin = new BorderDouble(0, 0, 0, 10); headerContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; { - TextWidget headerText = new TextWidget(string.Format(new LocalizedString("MatterControl").Translated), textColor: RGBA_Bytes.White, pointSize: 20); + TextWidget headerText = new TextWidget(string.Format(LocalizedString.Get("MatterControl")), textColor: RGBA_Bytes.White, pointSize: 20); headerText.MinimumSize = new VectorMath.Vector2(headerText.Width, headerText.Height); headerText.HAnchor = Agg.UI.HAnchor.ParentCenter; headerContainer.AddChild(headerText); - TextWidget versionText = new TextWidget(string.Format(new LocalizedString("Version {0}").Translated, VersionInfo.Instance.ReleaseVersion), textColor: RGBA_Bytes.White, pointSize: 10); + TextWidget versionText = new TextWidget(string.Format(LocalizedString.Get("Version {0}"), VersionInfo.Instance.ReleaseVersion), textColor: RGBA_Bytes.White, pointSize: 10); versionText.MinimumSize = new VectorMath.Vector2(versionText.Width, versionText.Height); versionText.HAnchor = Agg.UI.HAnchor.ParentCenter; headerContainer.AddChild(versionText); - TextWidget developedByText = new TextWidget(new LocalizedString("Developed by MatterHackers").Translated, textColor: RGBA_Bytes.White); + TextWidget developedByText = new TextWidget(LocalizedString.Get("Developed by MatterHackers"), textColor: RGBA_Bytes.White); developedByText.Margin = new BorderDouble(top: 5); developedByText.HAnchor = Agg.UI.HAnchor.ParentCenter; developedByText.MinimumSize = new VectorMath.Vector2(developedByText.Width, developedByText.Height); @@ -410,13 +410,13 @@ namespace MatterHackers.MatterControl // donate to mc { FlowLayoutWidget donateTextContanier = new FlowLayoutWidget(); - TextWidget donateStartText = new TextWidget(new LocalizedString("Please consider ").Translated, textColor: RGBA_Bytes.White); + TextWidget donateStartText = new TextWidget(LocalizedString.Get("Please consider "), textColor: RGBA_Bytes.White); donateTextContanier.AddChild(donateStartText); - Button matterControlDonateLink = linkButtonFactory.Generate(new LocalizedString("donating").Translated); + Button matterControlDonateLink = linkButtonFactory.Generate(LocalizedString.Get("donating")); matterControlDonateLink.OriginRelativeParent = new VectorMath.Vector2(matterControlDonateLink.OriginRelativeParent.x, matterControlDonateLink.OriginRelativeParent.y + donateStartText.Printer.TypeFaceStyle.DescentInPixels); matterControlDonateLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("http://www.matterhackers.com/store/printer-accessories/mattercontrol-donation"); }; donateTextContanier.AddChild(matterControlDonateLink); - donateTextContanier.AddChild(new TextWidget(new LocalizedString(" to help support and improve MatterControl.").Translated, textColor: RGBA_Bytes.White)); + donateTextContanier.AddChild(new TextWidget(LocalizedString.Get(" to help support and improve MatterControl."), textColor: RGBA_Bytes.White)); donateTextContanier.HAnchor = Agg.UI.HAnchor.ParentCenter; topToBottom.AddChild(donateTextContanier); } @@ -436,7 +436,7 @@ namespace MatterHackers.MatterControl { feedbackButtons.HAnchor |= Agg.UI.HAnchor.ParentCenter; - Button feedbackLink = textImageButtonFactory.Generate(new LocalizedString("Send Feedback").Translated); + Button feedbackLink = textImageButtonFactory.Generate(LocalizedString.Get("Send Feedback")); feedbackLink.Click += (sender, mouseEvent) => { ContactFormWindow.Open(); }; feedbackButtons.AddChild(feedbackLink); @@ -447,14 +447,14 @@ namespace MatterHackers.MatterControl topToBottom.AddChild(feedbackButtons); - Button learnMoreLink = linkButtonFactory.Generate(new LocalizedString("www.matterhackers.com").Translated); + Button learnMoreLink = linkButtonFactory.Generate(LocalizedString.Get("www.matterhackers.com")); learnMoreLink.Margin = new BorderDouble(right: 12); learnMoreLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("http://www.matterhackers.com?clk=mc"); }; learnMoreLink.HAnchor = HAnchor.ParentCenter; learnMoreLink.Margin = new BorderDouble(0, 5); topToBottom.AddChild(learnMoreLink); - TextWidget copyrightText = new TextWidget(string.Format(new LocalizedString("Copyright © 2014 MatterHackers, Inc.").Translated), textColor: offWhite); + TextWidget copyrightText = new TextWidget(string.Format(LocalizedString.Get("Copyright © 2014 MatterHackers, Inc.")), textColor: offWhite); copyrightText.HAnchor = Agg.UI.HAnchor.ParentCenter; topToBottom.AddChild(copyrightText); @@ -462,12 +462,12 @@ namespace MatterHackers.MatterControl FlowLayoutWidget leftToRightBuildInfo = new FlowLayoutWidget(); leftToRightBuildInfo.HAnchor |= HAnchor.ParentCenter; - TextWidget buildText = new TextWidget(string.Format(new LocalizedString("Build: {0} | ").Translated, VersionInfo.Instance.BuildVersion), textColor: offWhite, pointSize: 10); + TextWidget buildText = new TextWidget(string.Format(LocalizedString.Get("Build: {0} | "), VersionInfo.Instance.BuildVersion), textColor: offWhite, pointSize: 10); leftToRightBuildInfo.AddChild(buildText); double oldFontSize = linkButtonFactory.fontSize; linkButtonFactory.fontSize = 10; - Button deleteCacheLink = linkButtonFactory.Generate(new LocalizedString("Clear Cache").Translated); + Button deleteCacheLink = linkButtonFactory.Generate(LocalizedString.Get("Clear Cache")); linkButtonFactory.fontSize = oldFontSize; deleteCacheLink.OriginRelativeParent = new VectorMath.Vector2(deleteCacheLink.OriginRelativeParent.x, deleteCacheLink.OriginRelativeParent.y + buildText.Printer.TypeFaceStyle.DescentInPixels); deleteCacheLink.Click += (sender, mouseEvent) => { DeleteCacheData(); }; @@ -482,9 +482,9 @@ namespace MatterHackers.MatterControl // slicer credit { FlowLayoutWidget donateTextContainer = new FlowLayoutWidget(); - TextWidget thanksText = new TextWidget(new LocalizedString("Special thanks to Alessandro Ranellucci for his incredible work on ").Translated, textColor: RGBA_Bytes.White); + TextWidget thanksText = new TextWidget(LocalizedString.Get("Special thanks to Alessandro Ranellucci for his incredible work on "), textColor: RGBA_Bytes.White); donateTextContainer.AddChild(thanksText); - Button slic3rOrgLink = linkButtonFactory.Generate(new LocalizedString("Slic3r").Translated); + Button slic3rOrgLink = linkButtonFactory.Generate(LocalizedString.Get("Slic3r")); //slic3rOrgLink.VAnchor = Agg.UI.VAnchor.Bottom; slic3rOrgLink.OriginRelativeParent = new VectorMath.Vector2(slic3rOrgLink.OriginRelativeParent.x, slic3rOrgLink.OriginRelativeParent.y + thanksText.Printer.TypeFaceStyle.DescentInPixels); slic3rOrgLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("https://github.com/alexrj/Slic3r"); }; @@ -496,10 +496,10 @@ namespace MatterHackers.MatterControl // cura engine credit { FlowLayoutWidget curaEngineTextContanier = new FlowLayoutWidget(); - TextWidget donateStartText = new TextWidget(new LocalizedString("and to David Braam and Ultimaker BV, for the amazing ").Translated, textColor: RGBA_Bytes.White); + TextWidget donateStartText = new TextWidget(LocalizedString.Get("and to David Braam and Ultimaker BV, for the amazing "), textColor: RGBA_Bytes.White); curaEngineTextContanier.AddChild(donateStartText); - Button curaEngineSourceLink = linkButtonFactory.Generate(new LocalizedString("CuraEngine").Translated); + Button curaEngineSourceLink = linkButtonFactory.Generate(LocalizedString.Get("CuraEngine")); curaEngineSourceLink.OriginRelativeParent = new VectorMath.Vector2(curaEngineSourceLink.OriginRelativeParent.x, curaEngineSourceLink.OriginRelativeParent.y + donateStartText.Printer.TypeFaceStyle.DescentInPixels); curaEngineSourceLink.Click += (sender, mouseEvent) => { System.Diagnostics.Process.Start("https://github.com/Ultimaker/CuraEngine"); }; curaEngineTextContanier.AddChild(curaEngineSourceLink); diff --git a/AboutPage/ContactForm.cs b/AboutPage/ContactForm.cs index 56f65a9f9..960cc3ae6 100644 --- a/AboutPage/ContactForm.cs +++ b/AboutPage/ContactForm.cs @@ -80,9 +80,9 @@ namespace MatterHackers.MatterControl.ContactForm SetButtonAttributes(); AnchorAll(); - cancelButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); - submitButton = textImageButtonFactory.Generate(new LocalizedString("Submit").Translated); - doneButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated); + cancelButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); + submitButton = textImageButtonFactory.Generate(LocalizedString.Get("Submit")); + doneButton = textImageButtonFactory.Generate(LocalizedString.Get("Done")); doneButton.Visible = false; DoLayout(subjectText, bodyText); @@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl.ContactForm labelContainer.HAnchor = HAnchor.ParentLeftRight; labelContainer.Height = 30; - TextWidget formLabel = new TextWidget(new LocalizedString("How can we help?").Translated, pointSize:16); + TextWidget formLabel = new TextWidget(LocalizedString.Get("How can we help?"), pointSize: 16); formLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; formLabel.VAnchor = VAnchor.ParentTop; formLabel.HAnchor = HAnchor.ParentLeft; @@ -144,8 +144,8 @@ namespace MatterHackers.MatterControl.ContactForm messageContainer.Visible = false; messageContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor; messageContainer.Padding = new BorderDouble(10); - - submissionStatus = new TextWidget(new LocalizedString("Submitting your information...").Translated, pointSize: 13); + + submissionStatus = new TextWidget(LocalizedString.Get("Submitting your information..."), pointSize: 13); submissionStatus.AutoExpandBoundsToText = true; submissionStatus.Margin = new BorderDouble(0, 5); submissionStatus.TextColor = RGBA_Bytes.White; @@ -158,8 +158,8 @@ namespace MatterHackers.MatterControl.ContactForm formContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor; formContainer.Padding = new BorderDouble(10); - formContainer.AddChild(LabelGenerator(new LocalizedString("Question*").Translated)); - formContainer.AddChild(LabelGenerator(new LocalizedString("Briefly describe your question").Translated, 9, 14)); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Question*"))); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Briefly describe your question"), 9, 14)); questionInput = new MHTextEditWidget(subjectText); questionInput.HAnchor = HAnchor.ParentLeftRight; @@ -168,8 +168,8 @@ namespace MatterHackers.MatterControl.ContactForm questionErrorMessage = ErrorMessageGenerator(); formContainer.AddChild(questionErrorMessage); - formContainer.AddChild(LabelGenerator(new LocalizedString("Details*").Translated)); - formContainer.AddChild(LabelGenerator(new LocalizedString("Fill in the details here").Translated, 9, 14)); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Details*"))); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Fill in the details here"), 9, 14)); detailInput = new MHTextEditWidget(bodyText, pixelHeight: 120, multiLine: true); detailInput.HAnchor = HAnchor.ParentLeftRight; @@ -178,7 +178,7 @@ namespace MatterHackers.MatterControl.ContactForm detailErrorMessage = ErrorMessageGenerator(); formContainer.AddChild(detailErrorMessage); - formContainer.AddChild(LabelGenerator(new LocalizedString("Your Email Address*").Translated)); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Your Email Address*"))); emailInput = new MHTextEditWidget(); emailInput.HAnchor = HAnchor.ParentLeftRight; @@ -187,7 +187,7 @@ namespace MatterHackers.MatterControl.ContactForm emailErrorMessage = ErrorMessageGenerator(); formContainer.AddChild(emailErrorMessage); - formContainer.AddChild(LabelGenerator(new LocalizedString("Your Name*").Translated)); + formContainer.AddChild(LabelGenerator(LocalizedString.Get("Your Name*"))); nameInput = new MHTextEditWidget(); nameInput.HAnchor = HAnchor.ParentLeftRight; @@ -266,13 +266,13 @@ namespace MatterHackers.MatterControl.ContactForm void onPostRequestSucceeded(object sender, EventArgs e) { - submissionStatus.Text = new LocalizedString("Thank you! Your information has been submitted.").Translated; + submissionStatus.Text = LocalizedString.Get("Thank you! Your information has been submitted."); doneButton.Visible = true; } void onPostRequestFailed(object sender, EventArgs e) { - submissionStatus.Text = new LocalizedString("Sorry! We weren't able to submit your request.").Translated; + submissionStatus.Text = LocalizedString.Get("Sorry! We weren't able to submit your request."); doneButton.Visible = true; } @@ -327,7 +327,7 @@ namespace MatterHackers.MatterControl.ContactForm private ContactFormWindow(string subject = "", string bodyText = "") : base(500, 550) { - Title = new LocalizedString("MatterControl: Submit an Issue").Translated; + Title = LocalizedString.Get("MatterControl: Submit an Issue"); BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; diff --git a/ActionBar/ActionBarBaseControls.cs b/ActionBar/ActionBarBaseControls.cs index 998c81a92..729affddc 100644 --- a/ActionBar/ActionBarBaseControls.cs +++ b/ActionBar/ActionBarBaseControls.cs @@ -146,8 +146,8 @@ namespace MatterHackers.MatterControl.ActionBar printerNameText.HAnchor = HAnchor.ParentCenter; printerNameText.TextColor = textColor; - string printerStatusTxtBeg = new LocalizedString("Status").Translated; - string printerStatusTxtEnd = new LocalizedString("Connected").Translated; + string printerStatusTxtBeg = LocalizedString.Get("Status"); + string printerStatusTxtEnd = LocalizedString.Get("Connected"); string printerStatusTxtFull = string.Format("{0}: {1}", printerStatusTxtBeg, printerStatusTxtEnd); printerStatusText = new TextWidget(printerStatusTxtFull, pointSize:statusTextHeight); printerStatusText.AutoExpandBoundsToText = true; @@ -189,12 +189,12 @@ namespace MatterHackers.MatterControl.ActionBar { if (PrinterCommunication.Instance.CommunicationState == PrinterCommunication.CommunicationStates.FailedToConnect && PrinterCommunication.Instance.ConnectionFailureMessage != "") { - string statusString = new LocalizedString("Status: {0} - {1}").Translated; + string statusString = LocalizedString.Get("Status: {0} - {1}"); printerStatusText.Text = string.Format(statusString, PrinterCommunication.Instance.PrinterConnectionStatusVerbose, PrinterCommunication.Instance.ConnectionFailureMessage); } else { - string statusStringBeg = new LocalizedString ("Status").Translated; + string statusStringBeg = LocalizedString.Get("Status"); string statusString = string.Format("{1}: {0}", PrinterCommunication.Instance.PrinterConnectionStatusVerbose, statusStringBeg); printerStatusText.Text = string.Format(statusString,PrinterCommunication.Instance.PrinterConnectionStatusVerbose); } @@ -207,13 +207,13 @@ namespace MatterHackers.MatterControl.ActionBar { if (GetPrinterRecordCount() > 0) { - string printerNameLbl = new LocalizedString ("Select Printer").Translated; + string printerNameLbl = LocalizedString.Get("Select Printer"); string printerNameLblFull = string.Format("- {0} -", printerNameLbl); printerNameText.Text = (printerNameLblFull); } else { - string addPrinterLbl = new LocalizedString ("Add Printer").Translated; + string addPrinterLbl = LocalizedString.Get("Add Printer"); string addPrinterLblFull = string.Format ("- {0} -", addPrinterLbl); printerNameText.Text = (addPrinterLblFull); } diff --git a/ActionBar/HelpTextWidget.cs b/ActionBar/HelpTextWidget.cs index 01ee812a7..32366f874 100644 --- a/ActionBar/HelpTextWidget.cs +++ b/ActionBar/HelpTextWidget.cs @@ -121,7 +121,7 @@ namespace MatterHackers.MatterControl { if (ActivePrinterProfile.Instance.ActivePrinter == null) { - return new LocalizedString("No printer selected. Press 'Connect' to choose a printer.").Translated; + return LocalizedString.Get("No printer selected. Press 'Connect' to choose a printer."); } else { @@ -129,22 +129,22 @@ namespace MatterHackers.MatterControl switch (PrinterCommunication.Instance.CommunicationState) { case PrinterCommunication.CommunicationStates.Disconnected: - return new LocalizedString("Not connected. Press 'Connect' to enable printing.").Translated; + return LocalizedString.Get("Not connected. Press 'Connect' to enable printing."); case PrinterCommunication.CommunicationStates.AttemptingToConnect: - string attemptToConnect = new LocalizedString ("Attempting to Connect").Translated; + string attemptToConnect = LocalizedString.Get ("Attempting to Connect"); string attemptToConnectFull = string.Format ("{0}...", attemptToConnect); return attemptToConnectFull; case PrinterCommunication.CommunicationStates.ConnectionLost: case PrinterCommunication.CommunicationStates.FailedToConnect: - return new LocalizedString("Unable to communicate with printer.").Translated; + return LocalizedString.Get("Unable to communicate with printer."); case PrinterCommunication.CommunicationStates.Connected: if (PrinterCommunication.Instance.ActivePrintItem != null) { - return new LocalizedString("Item selected. Press 'Start' to begin your print.").Translated; + return LocalizedString.Get("Item selected. Press 'Start' to begin your print."); } else { - return new LocalizedString("No items to select. Press 'Add' to select a file to print.").Translated; + return LocalizedString.Get("No items to select. Press 'Add' to select a file to print."); } default: return ""; diff --git a/ActionBar/PrintActionRow.cs b/ActionBar/PrintActionRow.cs index 69b78bfe7..c7e346071 100644 --- a/ActionBar/PrintActionRow.cs +++ b/ActionBar/PrintActionRow.cs @@ -55,44 +55,44 @@ namespace MatterHackers.MatterControl.ActionBar protected override void AddChildElements() { - addButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton(new LocalizedString("Add").Translated, "icon_circle_plus.png"); - addButton.tooltipText = new LocalizedString("Add a file to be printed").Translated; + addButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton(LocalizedString.Get("Add"), "icon_circle_plus.png"); + addButton.tooltipText = LocalizedString.Get("Add a file to be printed"); addButton.Margin = new BorderDouble(0, 6, 6, 3); - startButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton(new LocalizedString("Start").Translated, "icon_play_32x32.png"); - startButton.tooltipText = new LocalizedString("Begin printing the selected item.").Translated; + startButton = (TooltipButton)textImageButtonFactory.GenerateTooltipButton(LocalizedString.Get("Start"), "icon_play_32x32.png"); + startButton.tooltipText = LocalizedString.Get("Begin printing the selected item."); startButton.Margin = new BorderDouble(0, 6, 6, 3); - string skipButtonTxt = new LocalizedString("Skip").Translated; - string skipButtonMessage = new LocalizedString("Skip the current item and move to the next in queue").Translated; + string skipButtonTxt = LocalizedString.Get("Skip"); + string skipButtonMessage = LocalizedString.Get("Skip the current item and move to the next in queue"); skipButton = makeButton(skipButtonTxt, skipButtonMessage); - string removeButtonTxt = new LocalizedString("Remove").Translated; - string removeButtonMessage = new LocalizedString("Remove current item from queue").Translated; + string removeButtonTxt = LocalizedString.Get("Remove"); + string removeButtonMessage = LocalizedString.Get("Remove current item from queue"); removeButton = makeButton(removeButtonTxt, removeButtonMessage); - string pauseButtonTxt = new LocalizedString("Pause").Translated; - string pauseButtonMessage = new LocalizedString("Pause the current print").Translated; + string pauseButtonTxt = LocalizedString.Get("Pause"); + string pauseButtonMessage = LocalizedString.Get("Pause the current print"); pauseButton = makeButton(pauseButtonTxt, pauseButtonMessage); - string cancelCancelButtonTxt = new LocalizedString("Cancel Connect").Translated; - string cancelConnectButtonMessage = new LocalizedString("Stop trying to connect to the printer.").Translated; + string cancelCancelButtonTxt = LocalizedString.Get("Cancel Connect"); + string cancelConnectButtonMessage = LocalizedString.Get("Stop trying to connect to the printer."); cancelConnectButton = makeButton(cancelCancelButtonTxt, cancelConnectButtonMessage); - string cancelButtonTxt = new LocalizedString("Cancel").Translated; - string cancelButtonMessage = new LocalizedString("Stop the current print").Translated; + string cancelButtonTxt = LocalizedString.Get("Cancel"); + string cancelButtonMessage = LocalizedString.Get("Stop the current print"); cancelButton = makeButton(cancelButtonTxt, cancelButtonMessage); - string resumeButtonTxt = new LocalizedString("Resume").Translated; - string resumeButtonMessage = new LocalizedString ("Resume the current print").Translated; + string resumeButtonTxt = LocalizedString.Get("Resume"); + string resumeButtonMessage = LocalizedString.Get ("Resume the current print"); resumeButton = makeButton(resumeButtonTxt, resumeButtonMessage); - string reprintButtonTxt = new LocalizedString("Reprint").Translated; - string reprintButtonMessage = new LocalizedString ("Print current item again").Translated; + string reprintButtonTxt = LocalizedString.Get("Reprint"); + string reprintButtonMessage = LocalizedString.Get ("Print current item again"); reprintButton = makeButton(reprintButtonTxt, reprintButtonMessage); - string doneCurrentPartButtonTxt = new LocalizedString ("Done").Translated; - string doenCurrentPartButtonMessage = new LocalizedString ("Move to next print in queue").Translated; + string doneCurrentPartButtonTxt = LocalizedString.Get ("Done"); + string doenCurrentPartButtonMessage = LocalizedString.Get ("Move to next print in queue"); doneWithCurrentPartButton = makeButton(doneCurrentPartButtonTxt, doenCurrentPartButtonMessage); this.AddChild(addButton); diff --git a/ActionBar/PrintStatusRow.cs b/ActionBar/PrintStatusRow.cs index 909ca8ccb..b8d57bf3e 100644 --- a/ActionBar/PrintStatusRow.cs +++ b/ActionBar/PrintStatusRow.cs @@ -151,7 +151,7 @@ namespace MatterHackers.MatterControl.ActionBar topRow.Name = "PrintStatusRow.ActivePrinterInfo.TopRow"; topRow.HAnchor = HAnchor.ParentLeftRight; - string nextPrintLbl = new LocalizedString("Next Print").Translated; + string nextPrintLbl = LocalizedString.Get("Next Print"); string nextPrintLblFull = string.Format("{0}:", nextPrintLbl); activePrintLabel = getPrintStatusLabel(nextPrintLblFull, pointSize: 11); activePrintLabel.VAnchor = VAnchor.ParentTop; @@ -244,8 +244,8 @@ namespace MatterHackers.MatterControl.ActionBar int totalMinutesInPrint = (int)(totalSecondsInPrint / 60 - totalHoursInPrint * 60); totalSecondsInPrint = totalSecondsInPrint % 60; - string totalTimeLabel = new LocalizedString("Est. Print Time").Translated; - string calculatingLabel = new LocalizedString("Calculating...").Translated; + string totalTimeLabel = LocalizedString.Get("Est. Print Time"); + string calculatingLabel = LocalizedString.Get("Calculating..."); string totalPrintTimeText; if (totalSecondsInPrint > 0) @@ -276,13 +276,13 @@ namespace MatterHackers.MatterControl.ActionBar //GC.WaitForFullGCComplete(); string printPercentRemainingText; - string printPercentCompleteTxt = new LocalizedString("complete").Translated; + string printPercentCompleteTxt = LocalizedString.Get("complete"); printPercentRemainingText = string.Format("{0:0.0}% {1}", PrinterCommunication.Instance.PercentComplete,printPercentCompleteTxt); switch (PrinterCommunication.Instance.CommunicationState) { case PrinterCommunication.CommunicationStates.PreparingToPrint: - string preparingPrintLbl = new LocalizedString("Preparing To Print").Translated; + string preparingPrintLbl = LocalizedString.Get("Preparing To Print"); string preparingPrintLblFull = string.Format("{0}:", preparingPrintLbl); activePrintLabel.Text = preparingPrintLblFull; //ActivePrintStatusText = ""; // set by slicer @@ -298,7 +298,7 @@ namespace MatterHackers.MatterControl.ActionBar case PrinterCommunication.CommunicationStates.Paused: { - string activePrintLblTxt = new LocalizedString ("Printing Paused").Translated; + string activePrintLblTxt = LocalizedString.Get ("Printing Paused"); string activePrintLblTxtFull = string.Format("{0}:", activePrintLblTxt); activePrintLabel.Text = activePrintLblTxtFull; ActivePrintStatusText = totalPrintTimeText; @@ -306,14 +306,14 @@ namespace MatterHackers.MatterControl.ActionBar break; case PrinterCommunication.CommunicationStates.FinishedPrint: - string donePrintingTxt = new LocalizedString ("Done Printing").Translated; + string donePrintingTxt = LocalizedString.Get ("Done Printing"); string donePrintingTxtFull = string.Format ("{0}:", donePrintingTxt); activePrintLabel.Text = donePrintingTxtFull; ActivePrintStatusText = totalPrintTimeText; break; default: - string nextPrintLblActive = new LocalizedString ("Next Print").Translated; + string nextPrintLblActive = LocalizedString.Get ("Next Print"); string nextPrintLblActiveFull = string.Format("{0}: ", nextPrintLblActive); activePrintLabel.Text = nextPrintLblActiveFull; @@ -324,11 +324,11 @@ namespace MatterHackers.MatterControl.ActionBar } else { - string nextPrintLabel = new LocalizedString ("Next Print").Translated; + string nextPrintLabel = LocalizedString.Get ("Next Print"); string nextPrintLabelFull = string.Format ("{0}:", nextPrintLabel); activePrintLabel.Text = nextPrintLabelFull; - ActivePrintStatusText = string.Format(new LocalizedString("Press 'Add' to choose an item to print").Translated); + ActivePrintStatusText = string.Format(LocalizedString.Get("Press 'Add' to choose an item to print")); activePrintInfo.Text = ""; } } @@ -349,7 +349,7 @@ namespace MatterHackers.MatterControl.ActionBar } else { - this.activePrintName.Text = new LocalizedString("No items in the print queue").Translated; + this.activePrintName.Text = LocalizedString.Get("No items in the print queue"); } } @@ -393,7 +393,7 @@ namespace MatterHackers.MatterControl.ActionBar void onMouseEnterBounds(Object sender, EventArgs e) { - HelpTextWidget.Instance.ShowHoverText(new LocalizedString("Extruder Temperature").Translated); + HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("Extruder Temperature")); } void onMouseLeaveBounds(Object sender, EventArgs e) @@ -453,7 +453,7 @@ namespace MatterHackers.MatterControl.ActionBar void onMouseEnterBounds(Object sender, EventArgs e) { - HelpTextWidget.Instance.ShowHoverText(new LocalizedString("Bed Temperature").Translated); + HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("Bed Temperature")); } void onMouseLeaveBounds(Object sender, EventArgs e) diff --git a/ActionBar/PrinterActionRow.cs b/ActionBar/PrinterActionRow.cs index e3b569f10..7f2d7df7c 100644 --- a/ActionBar/PrinterActionRow.cs +++ b/ActionBar/PrinterActionRow.cs @@ -46,13 +46,13 @@ namespace MatterHackers.MatterControl.ActionBar protected override void AddChildElements() { actionBarButtonFactory.invertImageLocation = false; - string connectString = new LocalizedString("Connect").Translated; + string connectString = LocalizedString.Get("Connect"); connectPrinterButton = actionBarButtonFactory.Generate(connectString, "icon_power_32x32.png"); connectPrinterButton.Margin = new BorderDouble(3, 0); connectPrinterButton.VAnchor = VAnchor.ParentCenter; connectPrinterButton.Cursor = Cursors.Hand; - string disconnectString = new LocalizedString("Disconnect").Translated; + string disconnectString = LocalizedString.Get("Disconnect"); disconnectPrinterButton = actionBarButtonFactory.Generate(disconnectString, "icon_power_32x32.png"); disconnectPrinterButton.Margin = new BorderDouble(3, 0); disconnectPrinterButton.VAnchor = VAnchor.ParentCenter; @@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl.ActionBar FlowLayoutWidget leftToRight = new FlowLayoutWidget(); leftToRight.Margin = new BorderDouble(5, 0); - string optionsString = new LocalizedString("Options").Translated; + string optionsString = LocalizedString.Get("Options"); TextWidget optionsText = new TextWidget(optionsString, textColor: RGBA_Bytes.White); optionsText.VAnchor = Agg.UI.VAnchor.ParentCenter; optionsText.Margin = new BorderDouble(0, 0, 3, 0); diff --git a/ConfigurationPage/ConfigurationPage.cs b/ConfigurationPage/ConfigurationPage.cs index d82dc42ed..9fd546ed0 100644 --- a/ConfigurationPage/ConfigurationPage.cs +++ b/ConfigurationPage/ConfigurationPage.cs @@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl private void AddEePromControls(FlowLayoutWidget controlsTopToBottomLayout) { - GroupBox eePromControlsGroupBox = new GroupBox(new LocalizedString("EEProm Settings").Translated); + GroupBox eePromControlsGroupBox = new GroupBox(LocalizedString.Get("EEProm Settings")); eePromControlsGroupBox.Margin = new BorderDouble(0); eePromControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl ImageWidget eePromIcon = new ImageWidget(eePromImage); eePromIcon.Margin = new BorderDouble (right: 6); - Button openEePromWindow = textImageButtonFactory.Generate(new LocalizedString("CONFIGURE").Translated); + Button openEePromWindow = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE")); openEePromWindow.Click += (sender, e) => { #if false // This is to force the creation of the repetier window for testing when we don't have repetier firmware. @@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl default: UiThread.RunOnIdle((state) => { - string message = new LocalizedString("Oops! There is no eeprom mapping for your printer's firmware.").Translated; + string message = LocalizedString.Get("Oops! There is no eeprom mapping for your printer's firmware."); StyledMessageBox.ShowMessageBox(message, "Warning no eeprom mapping", StyledMessageBox.MessageType.OK); } ); @@ -191,7 +191,7 @@ namespace MatterHackers.MatterControl private GuiWidget CreatePrintLevelingControlsContainer() { GroupBox printLevelingControlsContainer; - printLevelingControlsContainer = new GroupBox(new LocalizedString("Automatic Calibration").Translated); + printLevelingControlsContainer = new GroupBox(LocalizedString.Get("Automatic Calibration")); printLevelingControlsContainer.Margin = new BorderDouble(0); printLevelingControlsContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -208,7 +208,7 @@ namespace MatterHackers.MatterControl this.textImageButtonFactory.FixedHeight = TallButtonHeight; - Button runPrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("CONFIGURE").Translated); + Button runPrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE")); runPrintLevelingButton.Margin = new BorderDouble(left:6); runPrintLevelingButton.VAnchor = VAnchor.ParentCenter; runPrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(runPrintLeveling_Click); @@ -218,17 +218,17 @@ namespace MatterHackers.MatterControl ImageWidget levelingIcon = new ImageWidget(levelingImage); levelingIcon.Margin = new BorderDouble (right: 6); - enablePrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("ENABLE").Translated); + enablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("ENABLE")); enablePrintLevelingButton.Margin = new BorderDouble(left:6); enablePrintLevelingButton.VAnchor = VAnchor.ParentCenter; enablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(enablePrintLeveling_Click); - disablePrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("DISABLE").Translated); + disablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("DISABLE")); disablePrintLevelingButton.Margin = new BorderDouble(left:6); disablePrintLevelingButton.VAnchor = VAnchor.ParentCenter; disablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(disablePrintLeveling_Click); - CheckBox doLevelingCheckBox = new CheckBox(new LocalizedString("Enable Automatic Print Leveling").Translated); + CheckBox doLevelingCheckBox = new CheckBox(LocalizedString.Get("Enable Automatic Print Leveling")); doLevelingCheckBox.Margin = new BorderDouble(left: 3); doLevelingCheckBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; doLevelingCheckBox.VAnchor = VAnchor.ParentCenter; @@ -394,11 +394,11 @@ namespace MatterHackers.MatterControl disablePrintLevelingButton.Visible = ActivePrinterProfile.Instance.DoPrintLeveling; if (ActivePrinterProfile.Instance.DoPrintLeveling) { - printLevelingStatusLabel.Text = new LocalizedString ("Automatic Print Leveling (enabled)").Translated; + printLevelingStatusLabel.Text = LocalizedString.Get("Automatic Print Leveling (enabled)"); } else { - printLevelingStatusLabel.Text = new LocalizedString ("Automatic Print Leveling (disabled)").Translated; + printLevelingStatusLabel.Text = LocalizedString.Get("Automatic Print Leveling (disabled)"); } } diff --git a/ConfigurationPage/PrintLevelWizard.cs b/ConfigurationPage/PrintLevelWizard.cs index 397afd416..152a308c0 100644 --- a/ConfigurationPage/PrintLevelWizard.cs +++ b/ConfigurationPage/PrintLevelWizard.cs @@ -207,13 +207,13 @@ namespace MatterHackers.MatterControl public class GetCoarseBedHeight : FindBedHeight { - static string setZHeightCoarseInstruction1 = new LocalizedString("Using the [Z] controls on this screen, we will now take a coarse measurement of the extruder height at this position.").Translated; + static string setZHeightCoarseInstruction1 = LocalizedString.Get("Using the [Z] controls on this screen, we will now take a coarse measurement of the extruder height at this position."); - static string setZHeightCourseInstructTxtOne = new LocalizedString("Place the paper under the extruder").Translated; - static string setZHeightCourseInstructTxtTwo = new LocalizedString("Using the above contols").Translated; - static string setZHeightCourseInstructTxtThree = new LocalizedString("Press [Z-] until there is resistance to moving the paper").Translated; - static string setZHeightCourseInstructTxtFour = new LocalizedString("Press [Z+] once to release the paper").Translated; - static string setZHeightCourseInstructTxtFive = new LocalizedString("Finally click 'Next' to continue.").Translated; + static string setZHeightCourseInstructTxtOne = LocalizedString.Get("Place the paper under the extruder"); + static string setZHeightCourseInstructTxtTwo = LocalizedString.Get("Using the above contols"); + static string setZHeightCourseInstructTxtThree = LocalizedString.Get("Press [Z-] until there is resistance to moving the paper"); + static string setZHeightCourseInstructTxtFour = LocalizedString.Get("Press [Z+] once to release the paper"); + static string setZHeightCourseInstructTxtFive = LocalizedString.Get("Finally click 'Next' to continue."); static string setZHeightCoarseInstruction2 = string.Format("\t• {0}\n\t• {1}\n\t• {2}\n\t• {3}\n\n{4}", setZHeightCourseInstructTxtOne, setZHeightCourseInstructTxtTwo, setZHeightCourseInstructTxtThree,setZHeightCourseInstructTxtFour, setZHeightCourseInstructTxtFive); Vector3 probeStartPosition; @@ -253,10 +253,10 @@ namespace MatterHackers.MatterControl public class GetFineBedHeight : FindBedHeight { - static string setZHeightFineInstruction1 = new LocalizedString("We will now refine our measurement of the extruder height at this position.").Translated; - static string setZHeightFineInstructionTxtOne = new LocalizedString("Press [Z-] until there is resistance to moving the paper").Translated; - static string setZHeightFineInstructionTxtTwo = new LocalizedString("Press [Z+] once to release the paper").Translated; - static string setZHeightFineInstructionTxtThree = new LocalizedString("Finally click 'Next' to continue.").Translated; + static string setZHeightFineInstruction1 = LocalizedString.Get("We will now refine our measurement of the extruder height at this position."); + static string setZHeightFineInstructionTxtOne = LocalizedString.Get("Press [Z-] until there is resistance to moving the paper"); + static string setZHeightFineInstructionTxtTwo = LocalizedString.Get("Press [Z+] once to release the paper"); + static string setZHeightFineInstructionTxtThree = LocalizedString.Get("Finally click 'Next' to continue."); static string setZHeightFineInstruction2 = string.Format("\t• {0}\n\t• {1}\n\n{2}",setZHeightFineInstructionTxtOne, setZHeightFineInstructionTxtTwo, setZHeightFineInstructionTxtThree); public GetFineBedHeight(string instructionsText, ProbePosition whereToWriteProbePosition) @@ -267,9 +267,9 @@ namespace MatterHackers.MatterControl public class GetUltraFineBedHeight : FindBedHeight { - static string setZHeightFineInstruction1 = new LocalizedString("We will now finalize our measurement of the extruder height at this position.").Translated; - static string setHeightFineInstructionTxtOne = new LocalizedString("Press [Z-] one click PAST the first hint of resistance").Translated; - static string setHeightFineInstructionTxtTwo = new LocalizedString("Finally click 'Next' to continue.").Translated; + static string setZHeightFineInstruction1 = LocalizedString.Get("We will now finalize our measurement of the extruder height at this position."); + static string setHeightFineInstructionTxtOne = LocalizedString.Get("Press [Z-] one click PAST the first hint of resistance"); + static string setHeightFineInstructionTxtTwo = LocalizedString.Get("Finally click 'Next' to continue."); static string setZHeightFineInstruction2 = string.Format("\t• {0}\n\n\n{1}", setHeightFineInstructionTxtOne, setHeightFineInstructionTxtTwo); public GetUltraFineBedHeight(string instructionsText, ProbePosition whereToWriteProbePosition) @@ -299,22 +299,22 @@ namespace MatterHackers.MatterControl public class PrintLevelWizardWindow : SystemWindow { - string pageOneInstructionsTxtOne = new LocalizedString("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do.").Translated; - string pageOneInstructionsTxtTwo = new LocalizedString("'Home' the printer").Translated; - string pageOneInstructionsTxtThree = new LocalizedString("Sample the bed at three points").Translated; - string pageOneInstructionsTxtFour = new LocalizedString("Turn auto leveling on").Translated; - string pageOneInstructionsTxtFive = new LocalizedString("You should be done in about 3 minutes.").Translated; - string pageOneInstructionsTxtSix = new LocalizedString("Click 'Next' to continue.").Translated; + string pageOneInstructionsTxtOne = LocalizedString.Get("Welcome to the print leveling wizard. Here is a quick overview on what we are going to do."); + string pageOneInstructionsTxtTwo = LocalizedString.Get("'Home' the printer"); + string pageOneInstructionsTxtThree = LocalizedString.Get("Sample the bed at three points"); + string pageOneInstructionsTxtFour = LocalizedString.Get("Turn auto leveling on"); + string pageOneInstructionsTxtFive = LocalizedString.Get("You should be done in about 3 minutes."); + string pageOneInstructionsTxtSix = LocalizedString.Get("Click 'Next' to continue."); string pageOneInstructions; - string homingPageInstructionsTxtOne = new LocalizedString("The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need").Translated; - string homingPageInstructionsTxtTwo = new LocalizedString("A standard sheet of paper").Translated; - string homingPageInstructionsTxtThree = new LocalizedString("We will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue.").Translated; + string homingPageInstructionsTxtOne = LocalizedString.Get("The printer should now be 'homing'. Once it is finished homing we will move it to the first point to sample.\n\nTo complete the next few steps you will need"); + string homingPageInstructionsTxtTwo = LocalizedString.Get("A standard sheet of paper"); + string homingPageInstructionsTxtThree = LocalizedString.Get("We will use this paper to measure the distance between the extruder and the bed.\n\nClick 'Next' to continue."); string homingPageInstructions; - string doneInstructionsTxt = new LocalizedString("Congratulations!\n\nAuto Print Leveling is now configured and enabled.").Translated; - string doneInstructionsTxtTwo = new LocalizedString("Remove the paper").Translated; - string doneInstructionsTxtThree = new LocalizedString("If in the future you wish to turn Auto Print Leveling off, you can uncheck the 'Enabled' button found in 'Advanced Settings'->'Printer Controls'.\n\nClick 'Done' to close this window.").Translated; + string doneInstructionsTxt = LocalizedString.Get("Congratulations!\n\nAuto Print Leveling is now configured and enabled."); + string doneInstructionsTxtTwo = LocalizedString.Get("Remove the paper"); + string doneInstructionsTxtThree = LocalizedString.Get("If in the future you wish to turn Auto Print Leveling off, you can uncheck the 'Enabled' button found in 'Advanced Settings'->'Printer Controls'.\n\nClick 'Done' to close this window."); string doneInstructions; WizardControl printLevelWizard; @@ -326,8 +326,8 @@ namespace MatterHackers.MatterControl doneInstructions = string.Format("{0}\n\n\t• {1}\n\n{2}",doneInstructionsTxt, doneInstructionsTxtTwo, doneInstructionsTxtThree); - string printLevelWizardTitle = new LocalizedString("MatterControl").Translated; - string printLevelWizardTitleFull = new LocalizedString ("Print Leveling Wizard").Translated; + string printLevelWizardTitle = LocalizedString.Get("MatterControl"); + string printLevelWizardTitleFull = LocalizedString.Get ("Print Leveling Wizard"); Title = string.Format("{0} - {1}",printLevelWizardTitle, printLevelWizardTitleFull); ProbePosition[] probePositions = new ProbePosition[3]; probePositions[0] = new ProbePosition(); @@ -343,34 +343,34 @@ namespace MatterHackers.MatterControl Vector2 probeBackCenter = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(0); - string lowPrecisionPositionLbl = new LocalizedString ("Position").Translated; - string lowPrecisionLbl = new LocalizedString ("Low Precision").Translated; + string lowPrecisionPositionLbl = LocalizedString.Get ("Position"); + string lowPrecisionLbl = LocalizedString.Get ("Low Precision"); GetCoarseBedHeight getCourseBedHeight = new GetCoarseBedHeight (printLevelWizard, new Vector3 (probeBackCenter, 10), string.Format ("{0} {1} 1 - {2}", Step (),lowPrecisionPositionLbl, lowPrecisionLbl), probePositions [0]); printLevelWizard.AddPage(getCourseBedHeight); - string precisionPositionLbl = new LocalizedString("Position").Translated; - string medPrecisionLbl = new LocalizedString("Medium Precision").Translated; + string precisionPositionLbl = LocalizedString.Get("Position"); + string medPrecisionLbl = LocalizedString.Get("Medium Precision"); printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 1 - {2}", Step(), precisionPositionLbl, medPrecisionLbl), probePositions[0])); - string highPrecisionLbl = new LocalizedString("High Precision").Translated; + string highPrecisionLbl = LocalizedString.Get("High Precision"); printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 1 - {2}", Step(), precisionPositionLbl, highPrecisionLbl), probePositions[0])); Vector2 probeFrontLeft = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(1); - string positionLblTwo = new LocalizedString("Position").Translated; - string lowPrecisionTwoLbl = new LocalizedString("Low Precision").Translated; - string medPrecisionTwoLbl = new LocalizedString("Medium Precision").Translated; - string highPrecisionTwoLbl = new LocalizedString("High Precision").Translated; + string positionLblTwo = LocalizedString.Get("Position"); + string lowPrecisionTwoLbl = LocalizedString.Get("Low Precision"); + string medPrecisionTwoLbl = LocalizedString.Get("Medium Precision"); + string highPrecisionTwoLbl = LocalizedString.Get("High Precision"); printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontLeft, 10), string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo, lowPrecisionTwoLbl ), probePositions[1])); printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo,medPrecisionTwoLbl), probePositions[1])); printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 2 - {2}", Step(), positionLblTwo,highPrecisionTwoLbl), probePositions[1])); Vector2 probeFrontRight = ActiveSliceSettings.Instance.GetPrintLevelSamplePosition(2); - string positionLabelThree = new LocalizedString("Position").Translated; - string lowPrecisionLblThree = new LocalizedString("Low Precision").Translated; - string medPrecisionLblThree = new LocalizedString("Medium Precision").Translated; - string highPrecisionLblThree = new LocalizedString("High Precision").Translated; + string positionLabelThree = LocalizedString.Get("Position"); + string lowPrecisionLblThree = LocalizedString.Get("Low Precision"); + string medPrecisionLblThree = LocalizedString.Get("Medium Precision"); + string highPrecisionLblThree = LocalizedString.Get("High Precision"); printLevelWizard.AddPage(new GetCoarseBedHeight(printLevelWizard, new Vector3(probeFrontRight, 10), string.Format("{0} {1} 3 - {2}", Step(), positionLabelThree, lowPrecisionLblThree), probePositions[2])); printLevelWizard.AddPage(new GetFineBedHeight(string.Format("{0} {1} 3 - {2}", Step(),positionLabelThree, medPrecisionLblThree ), probePositions[2])); printLevelWizard.AddPage(new GetUltraFineBedHeight(string.Format("{0} {1} 3 - {2}", Step(), positionLabelThree, highPrecisionLblThree ), probePositions[2])); @@ -379,8 +379,8 @@ namespace MatterHackers.MatterControl } int step = 1; - string stepTextBeg = new LocalizedString("Step").Translated; - string stepTextEnd = new LocalizedString("of").Translated; + string stepTextBeg = LocalizedString.Get("Step"); + string stepTextEnd = LocalizedString.Get("of"); string Step() { return string.Format("{0} {1} {2} 9:",stepTextBeg, step++, stepTextEnd); diff --git a/ControlElements/StyledMessageBoxWindow.cs b/ControlElements/StyledMessageBoxWindow.cs index bd48db26e..8c4300092 100644 --- a/ControlElements/StyledMessageBoxWindow.cs +++ b/ControlElements/StyledMessageBoxWindow.cs @@ -76,14 +76,14 @@ namespace MatterHackers.MatterControl FlowLayoutWidget yesNoButtonsFlow = new FlowLayoutWidget(); yesNoButtonsFlow.HAnchor |= HAnchor.ParentCenter; - Button yesButton = textImageButtonFactory.Generate(new LocalizedString("Yes").Translated, centerText:true); + Button yesButton = textImageButtonFactory.Generate(LocalizedString.Get("Yes"), centerText:true); yesButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click); yesNoButtonsFlow.AddChild(yesButton); GuiWidget buttonSpacer = new GuiWidget(10, 10); yesNoButtonsFlow.AddChild(buttonSpacer); - Button noButton = textImageButtonFactory.Generate(new LocalizedString("No").Translated, centerText: true); + Button noButton = textImageButtonFactory.Generate(LocalizedString.Get("No"), centerText: true); noButton.Click += new ButtonBase.ButtonEventHandler(noButton_Click); yesNoButtonsFlow.AddChild(noButton); @@ -93,7 +93,7 @@ namespace MatterHackers.MatterControl case MessageType.OK: { - Button okButton = textImageButtonFactory.Generate(new LocalizedString("Ok").Translated, centerText: true); + Button okButton = textImageButtonFactory.Generate(LocalizedString.Get("Ok"), centerText: true); //okButton.DebugShowBounds = true; okButton.Click += new ButtonBase.ButtonEventHandler(okButton_Click); okButton.HAnchor = HAnchor.ParentCenter; diff --git a/CustomWidgets/ExportQueueItemWindow.cs b/CustomWidgets/ExportQueueItemWindow.cs index 3966c88a2..6517be2b5 100644 --- a/CustomWidgets/ExportQueueItemWindow.cs +++ b/CustomWidgets/ExportQueueItemWindow.cs @@ -29,8 +29,8 @@ namespace MatterHackers.MatterControl partIsGCode = true; } - string McExportFileTitleBeg = new LocalizedString("MatterControl").Translated; - string McExportFileTitleEnd = new LocalizedString("Export File").Translated; + string McExportFileTitleBeg = LocalizedString.Get("MatterControl"); + string McExportFileTitleEnd = LocalizedString.Get("Export File"); string McExportFileTitleFull = string.Format("{0}: {1}", McExportFileTitleBeg, McExportFileTitleEnd); this.Title = McExportFileTitleFull; @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl topToBottom.Padding = new BorderDouble(10); topToBottom.AnchorAll(); - string exportLblTxt = new LocalizedString ("File export options").Translated; + string exportLblTxt = LocalizedString.Get ("File export options"); string exportLblTxtFull = string.Format ("{0}:", exportLblTxt); TextWidget exportLabel = new TextWidget(exportLblTxtFull); exportLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -66,7 +66,7 @@ namespace MatterHackers.MatterControl if (!partIsGCode) { - string exportStlTxt = new LocalizedString("Export as").Translated; + string exportStlTxt = LocalizedString.Get("Export as"); string exportStlTxtFull = string.Format("{0} STL", exportStlTxt); Button exportAsStlButton = textImageButtonFactory.Generate(exportStlTxtFull); @@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl if(showExportGCodeButton) { - string exportGCodeText = new LocalizedString("Export as").Translated; + string exportGCodeText = LocalizedString.Get("Export as"); string exportGCodeTextFull = string.Format("{0} GCode", exportGCodeText); Button exportGCode = textImageButtonFactory.Generate(exportGCodeTextFull); @@ -95,8 +95,8 @@ namespace MatterHackers.MatterControl if (!showExportGCodeButton) { - string noGCodeMessageTxtBeg = new LocalizedString("Note").Translated; - string noGCodeMessageTxtEnd = new LocalizedString ("To enable GCode export, select a printer profile.").Translated; + string noGCodeMessageTxtBeg = LocalizedString.Get("Note"); + string noGCodeMessageTxtEnd = LocalizedString.Get ("To enable GCode export, select a printer profile."); string noGCodeMessageTxtFull = string.Format ("{0}: {1}", noGCodeMessageTxtBeg, noGCodeMessageTxtEnd); TextWidget noGCodeMessage = new TextWidget(noGCodeMessageTxtFull, textColor: RGBA_Bytes.White, pointSize: 10); topToBottom.AddChild(noGCodeMessage); @@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl // TODO: make this work on the mac and then delete this if if (MatterHackers.Agg.UI.WindowsFormsAbstract.GetOSType() == WindowsFormsAbstract.OSType.Windows) { - showInFolderAfterSave = new CheckBox(new LocalizedString("Show file in folder after save").Translated, RGBA_Bytes.White, 10); + showInFolderAfterSave = new CheckBox(LocalizedString.Get("Show file in folder after save"), RGBA_Bytes.White, 10); showInFolderAfterSave.Margin = new BorderDouble(top: 10); topToBottom.AddChild(showInFolderAfterSave); } diff --git a/CustomWidgets/ExportToFolderFeedbackWindow.cs b/CustomWidgets/ExportToFolderFeedbackWindow.cs index b012106c1..82dfcb31d 100644 --- a/CustomWidgets/ExportToFolderFeedbackWindow.cs +++ b/CustomWidgets/ExportToFolderFeedbackWindow.cs @@ -20,8 +20,8 @@ namespace MatterHackers.MatterControl : base(300, 500) { BackgroundColor = backgroundColor; - string exportingToFolderTitle = new LocalizedString("MatterControl").Translated; - string exportingToFolderTitleFull = new LocalizedString("Exporting to Folder").Translated; + string exportingToFolderTitle = LocalizedString.Get("MatterControl"); + string exportingToFolderTitleFull = LocalizedString.Get("Exporting to Folder"); Title = string.Format("{0} - {1}", exportingToFolderTitle, exportingToFolderTitleFull); this.totalParts = totalParts; diff --git a/CustomWidgets/SavePartsSheetFeedbackWindow.cs b/CustomWidgets/SavePartsSheetFeedbackWindow.cs index 62f96a544..28feba7a3 100644 --- a/CustomWidgets/SavePartsSheetFeedbackWindow.cs +++ b/CustomWidgets/SavePartsSheetFeedbackWindow.cs @@ -19,8 +19,8 @@ namespace MatterHackers.MatterControl : base(300, 500) { BackgroundColor = backgroundColor; - string savePartSheetTitle = new LocalizedString("MatterControl").Translated; - string savePartSheetTitleFull = new LocalizedString("Saving to Parts Sheet").Translated; + string savePartSheetTitle = LocalizedString.Get("MatterControl"); + string savePartSheetTitleFull = LocalizedString.Get("Saving to Parts Sheet"); Title = string.Format("{0} - {1}",savePartSheetTitle, savePartSheetTitleFull) ; this.totalParts = totalParts; diff --git a/CustomWidgets/WizardControl.cs b/CustomWidgets/WizardControl.cs index 96473c077..9c78b4cc6 100644 --- a/CustomWidgets/WizardControl.cs +++ b/CustomWidgets/WizardControl.cs @@ -56,13 +56,13 @@ namespace MatterHackers.MatterControl FlowLayoutWidget buttonBar = new FlowLayoutWidget(); textImageButtonFactory.FixedWidth = 60; - backButton = textImageButtonFactory.Generate(new LocalizedString("Back").Translated, centerText: true); + backButton = textImageButtonFactory.Generate(LocalizedString.Get("Back"), centerText: true); backButton.Click += new ButtonBase.ButtonEventHandler(back_Click); - nextButton = textImageButtonFactory.Generate(new LocalizedString("Next").Translated, centerText: true); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Next"), centerText: true); nextButton.Click += new ButtonBase.ButtonEventHandler(next_Click); - doneButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated, centerText: true); + doneButton = textImageButtonFactory.Generate(LocalizedString.Get("Done"), centerText: true); doneButton.Click += new ButtonBase.ButtonEventHandler(done_Click); textImageButtonFactory.FixedWidth = 0; diff --git a/EeProm/EePromMarlinWidget.cs b/EeProm/EePromMarlinWidget.cs index 47dc71bad..ffeb2149a 100644 --- a/EeProm/EePromMarlinWidget.cs +++ b/EeProm/EePromMarlinWidget.cs @@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl.EeProm public EePromMarlinWidget() : base(700, 480) { - Title = new LocalizedString("Marlin Firmware EEPROM Settings").Translated; + Title = LocalizedString.Get("Marlin Firmware EEPROM Settings"); currentEePromSettings = new EePromMarlinSettings(); currentEePromSettings.eventAdded += SetUiToPrinterSettings; @@ -259,7 +259,7 @@ namespace MatterHackers.MatterControl.EeProm row.Margin = new BorderDouble(3); row.HAnchor = Agg.UI.HAnchor.ParentLeftRight; - TextWidget labelWidget = new TextWidget(new LocalizedString(label).Translated, textColor: ActiveTheme.Instance.PrimaryTextColor); + TextWidget labelWidget = new TextWidget(LocalizedString.Get(label), textColor: ActiveTheme.Instance.PrimaryTextColor); labelWidget.VAnchor = VAnchor.ParentCenter; maxWidthOfLeftStuff = Math.Max(maxWidthOfLeftStuff, labelWidget.Width); GuiWidget holder = new GuiWidget(labelWidget.Width, labelWidget.Height); @@ -301,7 +301,7 @@ namespace MatterHackers.MatterControl.EeProm private void CreateMainButton(ref Button button, FlowLayoutWidget buttonBar, string text) { - button = textImageButtonFactory.Generate(new LocalizedString(text).Translated); + button = textImageButtonFactory.Generate(LocalizedString.Get(text)); buttonBar.AddChild(button); } diff --git a/EeProm/EePromRepetierWidget.cs b/EeProm/EePromRepetierWidget.cs index cfae3b7a4..2d7fa39c2 100644 --- a/EeProm/EePromRepetierWidget.cs +++ b/EeProm/EePromRepetierWidget.cs @@ -69,13 +69,13 @@ namespace MatterHackers.MatterControl.EeProm FlowLayoutWidget row = new FlowLayoutWidget(); row.HAnchor = Agg.UI.HAnchor.ParentLeftRight; row.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; - GuiWidget descriptionWidget = AddDescription(new LocalizedString("Description").Translated); + GuiWidget descriptionWidget = AddDescription(LocalizedString.Get("Description")); descriptionWidget.Margin = new BorderDouble(left: 3); row.AddChild(descriptionWidget); CreateSpacer(row); - GuiWidget valueText = new TextWidget(new LocalizedString("Value").Translated, textColor: ActiveTheme.Instance.PrimaryTextColor); + GuiWidget valueText = new TextWidget(LocalizedString.Get("Value"), textColor: ActiveTheme.Instance.PrimaryTextColor); valueText.VAnchor = Agg.UI.VAnchor.ParentCenter; valueText.Margin = new BorderDouble(left: 5, right: 60); row.AddChild(valueText); @@ -97,13 +97,13 @@ namespace MatterHackers.MatterControl.EeProm FlowLayoutWidget buttonBar = new FlowLayoutWidget(); buttonBar.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth; buttonBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; - buttonSave = textImageButtonFactory.Generate(new LocalizedString("Save To EEPROM").Translated); + buttonSave = textImageButtonFactory.Generate(LocalizedString.Get("Save To EEPROM")); buttonSave.Margin = new BorderDouble(0,3); buttonBar.AddChild(buttonSave); CreateSpacer(buttonBar); - buttonCancel = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + buttonCancel = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); buttonCancel.Margin = new BorderDouble(3); buttonBar.AddChild(buttonCancel); @@ -158,11 +158,11 @@ namespace MatterHackers.MatterControl.EeProm public void translate() { - Title = new LocalizedString("Firmware EEPROM Settings").Translated; - buttonCancel.Text = new LocalizedString("Cancel").Translated; + Title = LocalizedString.Get("Firmware EEPROM Settings"); + buttonCancel.Text = LocalizedString.Get("Cancel"); buttonCancel.Click += buttonAbort_Click; - - buttonSave.Text = new LocalizedString("Save to EEPROM").Translated; + + buttonSave.Text = LocalizedString.Get("Save to EEPROM"); buttonSave.Click += buttonSave_Click; } diff --git a/LocalizedString.cs b/LocalizedString.cs index 6f85b697b..d3aa2f2f6 100644 --- a/LocalizedString.cs +++ b/LocalizedString.cs @@ -10,47 +10,30 @@ using MatterHackers.MatterControl.DataStorage; namespace MatterHackers.Localizations { - public class LocalizedString + public static class LocalizedString { static TranslationMap MatterControlTranslationMap; - string englishText; - string EnglishText + public static string Get(string EnglishText) { - get + string language = "fr"; + if (language == "en") { - return englishText; + return EnglishText; } - } - - public string Translated - { - get + else { - string language = "fr"; - if (language == "en") + if (MatterControlTranslationMap == null) { - return EnglishText; + string pathToTranslationsFolder = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "Translations"); + MatterControlTranslationMap = new TranslationMap(pathToTranslationsFolder, language); } - else - { - if (MatterControlTranslationMap == null) - { - string pathToTranslationsFolder = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "Translations"); - MatterControlTranslationMap = new TranslationMap(pathToTranslationsFolder, language); - } #if DEBUG_SHOW_TRANSLATED_STRINGS && DEBUG return "El " + EnglishText + " o"; #else - return MatterControlTranslationMap.Translate(EnglishText); - } -#endif + return MatterControlTranslationMap.Translate(EnglishText); } - } - - public LocalizedString(string EnglishText) - { - this.englishText = EnglishText; +#endif } } } diff --git a/MainSlidePanel.cs b/MainSlidePanel.cs index dd53190bb..16ece78e3 100644 --- a/MainSlidePanel.cs +++ b/MainSlidePanel.cs @@ -177,7 +177,7 @@ namespace MatterHackers.MatterControl //mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new GuiWidget(), "History"), 18, // ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - string libraryTabLabel = new LocalizedString("Library").Translated; + string libraryTabLabel = LocalizedString.Get("Library"); mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new PrintLibraryWidget(), libraryTabLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); @@ -185,7 +185,7 @@ namespace MatterHackers.MatterControl //mainControlsTabControl.AddTab(new SimpleTextTabWidget(new TabPage(new ToolsWidget(), "Tools"), 18, //ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - AboutTabPage = new TabPage(new AboutPage(), new LocalizedString("About").Translated); + AboutTabPage = new TabPage(new AboutPage(), LocalizedString.Get("About")); aboutTabView = new SimpleTextTabWidget(AboutTabPage, 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes()); mainControlsTabControl.AddTab(aboutTabView); @@ -201,7 +201,7 @@ namespace MatterHackers.MatterControl advancedControlsButtonFactory.disabledBorderColor = ActiveTheme.Instance.PrimaryBackgroundColor; advancedControlsButtonFactory.invertImageLocation = true; - Button advancedControlsLinkButton = advancedControlsButtonFactory.Generate(new LocalizedString("Advanced\nControls").Translated, "icon_arrow_right_32x32.png"); + Button advancedControlsLinkButton = advancedControlsButtonFactory.Generate(LocalizedString.Get("Advanced\nControls"), "icon_arrow_right_32x32.png"); advancedControlsLinkButton.Margin = new BorderDouble(right: 3); advancedControlsLinkButton.VAnchor = VAnchor.ParentBottom; advancedControlsLinkButton.Cursor = Cursors.Hand; @@ -243,7 +243,7 @@ namespace MatterHackers.MatterControl void onMouseEnterBoundsAdvancedControlsLink(Object sender, EventArgs e) { - HelpTextWidget.Instance.ShowHoverText(new LocalizedString("View Manual Printer Controls and Slicing Settings").Translated); + HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("View Manual Printer Controls and Slicing Settings")); } void onMouseLeaveBoundsAdvancedControlsLink(Object sender, EventArgs e) @@ -253,7 +253,7 @@ namespace MatterHackers.MatterControl void onMouseEnterBoundsPrintQueueLink(Object sender, EventArgs e) { - HelpTextWidget.Instance.ShowHoverText(new LocalizedString("View Queue and Library").Translated); + HelpTextWidget.Instance.ShowHoverText(LocalizedString.Get("View Queue and Library")); } void onMouseLeaveBoundsPrintQueueLink(Object sender, EventArgs e) @@ -330,7 +330,7 @@ namespace MatterHackers.MatterControl advancedControls.TabBar.Padding = new BorderDouble(0, 2); advancedControlsButtonFactory.invertImageLocation = false; - Button advancedControlsLinkButton = advancedControlsButtonFactory.Generate(new LocalizedString("Print\nQueue").Translated, "icon_arrow_left_32x32.png"); + Button advancedControlsLinkButton = advancedControlsButtonFactory.Generate(LocalizedString.Get("Print\nQueue"), "icon_arrow_left_32x32.png"); advancedControlsLinkButton.Margin = new BorderDouble(right: 3); advancedControlsLinkButton.VAnchor = VAnchor.ParentBottom; advancedControlsLinkButton.Cursor = Cursors.Hand; @@ -347,16 +347,16 @@ namespace MatterHackers.MatterControl manualPrinterControlsScrollArea.AddChild(manualPrinterControls); //Add the tab contents for 'Advanced Controls' - string printerControlsLabel = new LocalizedString("Controls").Translated; + string printerControlsLabel = LocalizedString.Get("Controls"); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(manualPrinterControlsScrollArea, printerControlsLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - string sliceSettingsLabel = new LocalizedString("Slice Settings").Translated; + string sliceSettingsLabel = LocalizedString.Get("Slice Settings"); sliceSettingsWidget = new SliceSettingsWidget(sliceSettingsUiState); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(sliceSettingsWidget, sliceSettingsLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - string configurationLabel = new LocalizedString("Configuration").Translated; + string configurationLabel = LocalizedString.Get("Configuration"); ScrollableWidget configurationControls = new ConfigurationPage(); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(configurationControls, configurationLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); @@ -435,7 +435,7 @@ namespace MatterHackers.MatterControl void NumQueueItemsChanged(object sender, EventArgs widgetEvent) { - string queueStringBeg = new LocalizedString("Queue").Translated; + string queueStringBeg = LocalizedString.Get("Queue"); string queueString = string.Format("{1} ({0})", PrintQueue.PrintQueueControl.Instance.Count, queueStringBeg); QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count); } diff --git a/PartPreviewWindow/GcodeViewBasic.cs b/PartPreviewWindow/GcodeViewBasic.cs index b23ed3271..5a1ec3f4b 100644 --- a/PartPreviewWindow/GcodeViewBasic.cs +++ b/PartPreviewWindow/GcodeViewBasic.cs @@ -103,7 +103,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow buttonBottomPanel.Padding = new BorderDouble(3, 3); buttonBottomPanel.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; - generateGCodeButton = textImageButtonFactory.Generate(new LocalizedString("Generate").Translated); + generateGCodeButton = textImageButtonFactory.Generate(LocalizedString.Get("Generate")); generateGCodeButton.Click += new ButtonBase.ButtonEventHandler(generateButton_Click); buttonBottomPanel.AddChild(generateGCodeButton); @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow layerSelectionButtonsPannel.HAnchor = HAnchor.ParentLeftRight; layerSelectionButtonsPannel.Padding = new BorderDouble(0); - closeButton = textImageButtonFactory.Generate(new LocalizedString("Close").Translated); + closeButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); layerSelectionButtonsPannel.AddChild(closeButton); @@ -120,10 +120,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow gcodeDispalyWidget = new GuiWidget(HAnchor.ParentLeftRight, Agg.UI.VAnchor.ParentBottomTop); - string startingMessage = new LocalizedString("No GCode Available...").Translated; + string startingMessage = LocalizedString.Get("No GCode Available..."); if (printItem != null) { - startingMessage = new LocalizedString("Loading GCode...").Translated; + startingMessage = LocalizedString.Get("Loading GCode..."); if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE") { gcodeDispalyWidget.AddChild(CreateGCodeViewWidget(printItem.FileLocation)); @@ -137,11 +137,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (gcodeProcessingStateInfoText != null && gcodeProcessingStateInfoText.Text == "Slicing Error") { - startingMessage = new LocalizedString("Slicing Error. Please review your slice settings.").Translated; + startingMessage = LocalizedString.Get("Slicing Error. Please review your slice settings."); } else { - startingMessage = new LocalizedString("Press 'generate' to view layers").Translated; + startingMessage = LocalizedString.Get("Press 'generate' to view layers"); } if (File.Exists(gcodePathAndFileName) && gcodeFileIsComplete) @@ -155,7 +155,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } else { - startingMessage = string.Format("{0}\n'{1}'", new LocalizedString("File not found on disk.").Translated, printItem.Name); + startingMessage = string.Format("{0}\n'{1}'", LocalizedString.Get("File not found on disk."), printItem.Name); } } } @@ -221,7 +221,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { BorderDouble buttonMargin = new BorderDouble(top: 3); - expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Model").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandModelOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Model"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandModelOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandModelOptions); expandModelOptions.Checked = true; @@ -231,7 +231,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow //modelOptionsContainer.Visible = false; buttonRightPanel.AddChild(modelOptionsContainer); - expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Layer").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandLayerOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Layer"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandLayerOptions.Margin = new BorderDouble(bottom: 2); //buttonRightPanel.AddChild(expandLayerOptions); @@ -240,7 +240,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow layerOptionsContainer.Visible = false; buttonRightPanel.AddChild(layerOptionsContainer); - expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Display").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandDisplayOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Display"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandDisplayOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandDisplayOptions); expandDisplayOptions.Checked = true; @@ -278,7 +278,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow modelInfoContainer.HAnchor = HAnchor.ParentLeftRight; modelInfoContainer.Padding = new BorderDouble(5); - string printTimeLbl = new LocalizedString ("Print Time").Translated; + string printTimeLbl = LocalizedString.Get ("Print Time"); string printTimeLblFull = string.Format ("{0}:", printTimeLbl); // put in the print time modelInfoContainer.AddChild(new TextWidget(printTimeLblFull, textColor: RGBA_Bytes.White)); @@ -309,7 +309,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow //modelInfoContainer.AddChild(new TextWidget("Size:", textColor: RGBA_Bytes.White)); - string filamentLengthLbl = new LocalizedString ("Filament Length").Translated; + string filamentLengthLbl = LocalizedString.Get ("Filament Length"); string filamentLengthLblFull = string.Format ("{0}:", filamentLengthLbl); // show the filament used modelInfoContainer.AddChild(new TextWidget(filamentLengthLblFull, textColor: RGBA_Bytes.White)); @@ -322,7 +322,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow modelInfoContainer.AddChild(estimatedPrintTime); } - string filamentVolumeLbl = new LocalizedString ("Filament Volume").Translated; + string filamentVolumeLbl = LocalizedString.Get ("Filament Volume"); string filamentVolumeLblFull = string.Format("{0}:", filamentVolumeLbl); modelInfoContainer.AddChild(new TextWidget(filamentVolumeLblFull, textColor: RGBA_Bytes.White)); { @@ -345,7 +345,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow modelInfoContainer.AddChild(estimatedPrintTime); } - string weightLbl = new LocalizedString("Weight").Translated; + string weightLbl = LocalizedString.Get("Weight"); string weightLblFull = string.Format("{0}:", weightLbl); modelInfoContainer.AddChild(new TextWidget(weightLblFull, textColor: RGBA_Bytes.White)); { @@ -407,7 +407,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow layerInfoContainer.Padding = new BorderDouble(5); // put in a show grid check box - CheckBox showGrid = new CheckBox(new LocalizedString("Show Grid").Translated, textColor: RGBA_Bytes.White); + CheckBox showGrid = new CheckBox(LocalizedString.Get("Show Grid"), textColor: RGBA_Bytes.White); showGrid.Checked = gcodeViewWidget.RenderGrid; showGrid.CheckedStateChanged += (sender, e) => { @@ -416,7 +416,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow layerInfoContainer.AddChild(showGrid); // put in a show moves checkbox - CheckBox showMoves = new CheckBox(new LocalizedString("Show Moves").Translated, textColor: RGBA_Bytes.White); + CheckBox showMoves = new CheckBox(LocalizedString.Get("Show Moves"), textColor: RGBA_Bytes.White); showMoves.Checked = gcodeViewWidget.RenderMoves; showMoves.CheckedStateChanged += (sender, e) => { @@ -425,7 +425,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow layerInfoContainer.AddChild(showMoves); // put in a show Retractions checkbox - CheckBox showRetractions = new CheckBox(new LocalizedString("Show Retractions").Translated, textColor: RGBA_Bytes.White); + CheckBox showRetractions = new CheckBox(LocalizedString.Get("Show Retractions"), textColor: RGBA_Bytes.White); showRetractions.Checked = gcodeViewWidget.RenderRetractions; showRetractions.CheckedStateChanged += (sender, e) => { @@ -685,7 +685,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow this.AddChild(editCurrentLayerIndex); gcodeViewWidget.ActiveLayerChanged += new EventHandler(gcodeViewWidget_ActiveLayerChanged); - setLayerButton = textImageButtonFactory.Generate(new LocalizedString("Go").Translated); + setLayerButton = textImageButtonFactory.Generate(LocalizedString.Get("Go")); setLayerButton.VAnchor = Agg.UI.VAnchor.ParentCenter; setLayerButton.Click += new Button.ButtonEventHandler(layerCountTextWidget_EditComplete); this.AddChild(setLayerButton); diff --git a/PartPreviewWindow/PartPreviewMainWindow.cs b/PartPreviewWindow/PartPreviewMainWindow.cs index 8a5da6af6..b872e6d4e 100644 --- a/PartPreviewWindow/PartPreviewMainWindow.cs +++ b/PartPreviewWindow/PartPreviewMainWindow.cs @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public PartPreviewMainWindow(PrintItemWrapper printItem) : base(690, 340) { - string partPreviewTitle = new LocalizedString ("MatterControl").Translated; + string partPreviewTitle = LocalizedString.Get ("MatterControl"); Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name); BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; @@ -63,13 +63,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow double buildHeight = ActiveSliceSettings.Instance.BuildHeight; string part3DViewLblBeg = ("3D"); - string part3DViewLblEnd = new LocalizedString ("View").Translated; + string part3DViewLblEnd = LocalizedString.Get ("View"); string part3DViewLblFull = string.Format("{0} {1} ", part3DViewLblBeg, part3DViewLblEnd); part3DView = new View3DTransformPart(printItem, new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight), ActiveSliceSettings.Instance.BedShape); TabPage partPreview3DView = new TabPage(part3DView, part3DViewLblFull); partGcodeView = new GcodeViewBasic(printItem, ActiveSliceSettings.Instance.GetBedSize, ActiveSliceSettings.Instance.GetBedCenter); - TabPage layerView = new TabPage(partGcodeView, new LocalizedString("Layer View").Translated); + TabPage layerView = new TabPage(partGcodeView, LocalizedString.Get("Layer View")); //part3DGcodeView = new PartPreview3DGcode(printItem.FileLocation, bedXSize, bedYSize); diff --git a/PartPreviewWindow/View3DTransfromPart.cs b/PartPreviewWindow/View3DTransfromPart.cs index c9f93a420..4deb62717 100644 --- a/PartPreviewWindow/View3DTransfromPart.cs +++ b/PartPreviewWindow/View3DTransfromPart.cs @@ -296,7 +296,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { FlowLayoutWidget editToolBar = new FlowLayoutWidget(); - string progressFindPartsLbl = new LocalizedString("Finding Parts").Translated; + string progressFindPartsLbl = LocalizedString.Get("Finding Parts"); string progressFindPartsLblFull = string.Format("{0}:", progressFindPartsLbl); processingProgressControl = new ProgressControl(progressFindPartsLblFull); @@ -307,7 +307,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow enterEditButtonsContainer = new FlowLayoutWidget(); { - Button addButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png"); + Button addButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addButton.Margin = new BorderDouble(right: 10); enterEditButtonsContainer.AddChild(addButton); addButton.Click += (sender, e) => @@ -320,7 +320,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }); }; - Button enterEdittingButton = textImageButtonFactory.Generate(new LocalizedString("Edit").Translated); + Button enterEdittingButton = textImageButtonFactory.Generate(LocalizedString.Get("Edit")); enterEdittingButton.Click += (sender, e) => { enterEditButtonsContainer.Visible = false; @@ -336,7 +336,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow doEdittingButtonsContainer.Visible = false; { - Button addButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png"); + Button addButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addButton.Margin = new BorderDouble(right: 10); doEdittingButtonsContainer.AddChild(addButton); addButton.Click += (sender, e) => @@ -350,14 +350,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }); }; - Button copyButton = textImageButtonFactory.Generate(new LocalizedString("Copy").Translated); + Button copyButton = textImageButtonFactory.Generate(LocalizedString.Get("Copy")); doEdittingButtonsContainer.AddChild(copyButton); copyButton.Click += (sender, e) => { MakeCopyOfMesh(); }; - Button deleteButton = textImageButtonFactory.Generate(new LocalizedString("Delete").Translated); + Button deleteButton = textImageButtonFactory.Generate(LocalizedString.Get("Delete")); deleteButton.Margin = new BorderDouble(left: 20); doEdittingButtonsContainer.AddChild(deleteButton); deleteButton.Click += (sender, e) => @@ -410,7 +410,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow leftRightSpacer.HAnchor = HAnchor.ParentLeftRight; buttonBottomPanel.AddChild(leftRightSpacer); - closeButton = textImageButtonFactory.Generate(new LocalizedString("Close").Translated); + closeButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); buttonBottomPanel.AddChild(closeButton); mainContainerTopToBottom.AddChild(buttonBottomPanel); @@ -435,7 +435,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (Meshes.Count > 0) { - string makingCopyLabel = new LocalizedString("Making Copy").Translated; + string makingCopyLabel = LocalizedString.Get("Making Copy"); string makingCopyLabelFull = string.Format ("{0}:", makingCopyLabel); processingProgressControl.textWidget.Text = makingCopyLabelFull; processingProgressControl.Visible = true; @@ -502,7 +502,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (Meshes.Count > 0) { - string progressArrangeParts = new LocalizedString ("Arranging Parts").Translated; + string progressArrangeParts = LocalizedString.Get ("Arranging Parts"); string progressArrangePartsFull = string.Format ("{0}:", progressArrangeParts); processingProgressControl.textWidget.Text = progressArrangePartsFull; processingProgressControl.Visible = true; @@ -605,7 +605,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (Meshes.Count > 0) { - string loadingPartLabel = new LocalizedString("Loading Parts").Translated; + string loadingPartLabel = LocalizedString.Get("Loading Parts"); string loadingPartLabelFull = string.Format("{0}:", loadingPartLabel); processingProgressControl.textWidget.Text = loadingPartLabelFull; processingProgressControl.Visible = true; @@ -927,7 +927,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { BorderDouble buttonMargin = new BorderDouble(top: 3); - expandRotateOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Rotate").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandRotateOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Rotate"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandRotateOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandRotateOptions); @@ -936,7 +936,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow rotateOptionContainer.Visible = false; buttonRightPanel.AddChild(rotateOptionContainer); - expandScaleOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Scale").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandScaleOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Scale"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandScaleOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandScaleOptions); @@ -947,7 +947,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the mirror options { - CheckBox expandMirrorOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Mirror").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + CheckBox expandMirrorOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Mirror"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandMirrorOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandMirrorOptions); @@ -967,7 +967,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the part info display if(false) { - CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Part Info").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Part Info"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandPartInfoOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandPartInfoOptions); @@ -982,7 +982,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }; PartInfoOptionContainer.Margin = new BorderDouble(8, 3); - string sizeInfoLbl = new LocalizedString("Size").Translated; + string sizeInfoLbl = LocalizedString.Get("Size"); string sizeInfoLblFull = string.Format("{0}:", sizeInfoLbl); TextWidget sizeInfo = new TextWidget(sizeInfoLblFull, textColor: RGBA_Bytes.White); PartInfoOptionContainer.AddChild(sizeInfo); @@ -1001,7 +1001,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow // put in the view options { - expandViewOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Display").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); + expandViewOptions = expandMenuOptionFactory.GenerateCheckBoxButton(LocalizedString.Get("Display"), "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png"); expandViewOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandViewOptions); @@ -1009,27 +1009,27 @@ namespace MatterHackers.MatterControl.PartPreviewWindow viewOptionContainer.HAnchor = HAnchor.ParentLeftRight; viewOptionContainer.Visible = false; { - showBedCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(new LocalizedString("Show Print Bed").Translated); + showBedCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(LocalizedString.Get("Show Print Bed")); showBedCheckBox.Checked = true; showBedCheckBox.Margin = buttonMargin; viewOptionContainer.AddChild(showBedCheckBox); if (buildHeight > 0) { - showBuildVolumeCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(new LocalizedString("Show Print Area").Translated); + showBuildVolumeCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(LocalizedString.Get("Show Print Area")); showBuildVolumeCheckBox.Checked = false; showBuildVolumeCheckBox.Margin = buttonMargin; viewOptionContainer.AddChild(showBuildVolumeCheckBox); } - showWireframeCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(new LocalizedString("Show Wireframe").Translated); + showWireframeCheckBox = checkboxButtonFactory.GenerateCheckBoxButton(LocalizedString.Get("Show Wireframe")); showWireframeCheckBox.Margin = buttonMargin; viewOptionContainer.AddChild(showWireframeCheckBox); } buttonRightPanel.AddChild(viewOptionContainer); } - autoArrangeButton = whiteButtonFactory.Generate(new LocalizedString("Auto-Arrange").Translated, centerText: true); + autoArrangeButton = whiteButtonFactory.Generate(LocalizedString.Get("Auto-Arrange"), centerText: true); autoArrangeButton.Visible = false; autoArrangeButton.Cursor = Cursors.Hand; buttonRightPanel.AddChild(autoArrangeButton); @@ -1038,7 +1038,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow verticalSpacer.VAnchor = VAnchor.ParentBottomTop; buttonRightPanel.AddChild(verticalSpacer); - saveButton = whiteButtonFactory.Generate(new LocalizedString("Save").Translated, centerText: true); + saveButton = whiteButtonFactory.Generate(LocalizedString.Get("Save"), centerText: true); saveButton.Visible = false; saveButton.Cursor = Cursors.Hand; buttonRightPanel.AddChild(saveButton); @@ -1070,7 +1070,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow scaleRatioContainer.HAnchor = HAnchor.ParentLeftRight; scaleRatioContainer.Padding = new BorderDouble(5); - string scaleRatioLblTxt = new LocalizedString("Ratio").Translated; + string scaleRatioLblTxt = LocalizedString.Get("Ratio"); string scaleRatioLblTxtFull = string.Format("{0}:", scaleRatioLblTxt); TextWidget scaleRatioLabel = new TextWidget(scaleRatioLblTxtFull, textColor: RGBA_Bytes.White); scaleRatioLabel.VAnchor = VAnchor.ParentCenter; @@ -1103,7 +1103,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow ApplyScaleFromEditField(); }; - DropDownMenu presetScaleMenu = new DropDownMenu(new LocalizedString("Conversions").Translated, Direction.Down); + DropDownMenu presetScaleMenu = new DropDownMenu(LocalizedString.Get("Conversions"), Direction.Down); RectangleDouble presetBounds = presetScaleMenu.LocalBounds; presetBounds.Inflate(new BorderDouble(5, 10, 10, 10)); presetScaleMenu.LocalBounds = presetBounds; @@ -1114,7 +1114,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow presetScaleMenu.AddItem("in to mm (25.4)"); presetScaleMenu.AddItem("mm to cm (.1)"); presetScaleMenu.AddItem("cm to mm (10)"); - string resetLbl = new LocalizedString ("reset").Translated; + string resetLbl = LocalizedString.Get ("reset"); string resetLblFull = string.Format("{0} (1)",resetLbl); presetScaleMenu.AddItem(resetLblFull); @@ -1147,7 +1147,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow buttonPanel.AddChild(presetScaleMenu); - applyScaleButton = whiteButtonFactory.Generate(new LocalizedString("Apply Scale").Translated, centerText: true); + applyScaleButton = whiteButtonFactory.Generate(LocalizedString.Get("Apply Scale"), centerText: true); applyScaleButton.Visible = false; applyScaleButton.Cursor = Cursors.Hand; buttonPanel.AddChild(applyScaleButton); @@ -1200,7 +1200,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private void AddRotateControls(FlowLayoutWidget buttonPanel) { List rotateControls = new List(); - transformControls.Add(new LocalizedString("Rotate").Translated, rotateControls); + transformControls.Add(LocalizedString.Get("Rotate"), rotateControls); textImageButtonFactory.FixedWidth = 44; @@ -1211,7 +1211,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow GuiWidget horizontalSpacer = new GuiWidget(); horizontalSpacer.HAnchor = HAnchor.ParentLeftRight; - string degreesLabelTxt = new LocalizedString("Degrees").Translated; + string degreesLabelTxt = LocalizedString.Get("Degrees"); string degreesLabelTxtFull = string.Format("{0}:", degreesLabelTxt); TextWidget degreesLabel = new TextWidget(degreesLabelTxt, textColor: RGBA_Bytes.White); degreesContainer.AddChild(degreesLabel); @@ -1297,7 +1297,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow buttonPanel.AddChild(rotateButtonContainer); - Button layFlatButton = whiteButtonFactory.Generate(new LocalizedString("Align to Bed").Translated, centerText: true); + Button layFlatButton = whiteButtonFactory.Generate(LocalizedString.Get("Align to Bed"), centerText: true); layFlatButton.Cursor = Cursors.Hand; buttonPanel.AddChild(layFlatButton); @@ -1413,7 +1413,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { partSelectButtonWasClicked = partSelectButton.Checked; - string progressSavingPartslbl = new LocalizedString ("Saving").Translated; + string progressSavingPartslbl = LocalizedString.Get ("Saving"); string progressSavingPartsLblFull = string.Format("{0}:",progressSavingPartslbl); processingProgressControl.textWidget.Text = progressSavingPartsLblFull; processingProgressControl.Visible = true; diff --git a/PrintLibrary/ExportLibraryItemWindow.cs b/PrintLibrary/ExportLibraryItemWindow.cs index 5f0038f26..6b695ca36 100644 --- a/PrintLibrary/ExportLibraryItemWindow.cs +++ b/PrintLibrary/ExportLibraryItemWindow.cs @@ -32,8 +32,8 @@ namespace MatterHackers.MatterControl.PrintLibrary partIsGCode = true; } - string exportLibraryFileTitle = new LocalizedString("MatterControl").Translated; - string exportLibraryFileTitleFull = new LocalizedString("Export File").Translated; + string exportLibraryFileTitle = LocalizedString.Get("MatterControl"); + string exportLibraryFileTitleFull = LocalizedString.Get("Export File"); this.Title = string.Format("{0}: {1}", exportLibraryFileTitle, exportLibraryFileTitleFull); this.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; @@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.PrintLibrary topToBottom.Padding = new BorderDouble(10); topToBottom.AnchorAll(); - string fileExportLabelTxt = new LocalizedString("File export options").Translated; + string fileExportLabelTxt = LocalizedString.Get("File export options"); TextWidget exportLabel = new TextWidget(string.Format("{0}:", fileExportLabelTxt)); exportLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; topToBottom.AddChild(exportLabel); @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.PrintLibrary if (!partIsGCode) { - string exportSTLTxt = new LocalizedString ("Export as").Translated; + string exportSTLTxt = LocalizedString.Get("Export as"); string exportSTLTxtFull = string.Format ("{0} STL", exportSTLTxt); Button exportAsSTLButton = textImageButtonFactory.Generate(exportSTLTxtFull); @@ -80,7 +80,7 @@ namespace MatterHackers.MatterControl.PrintLibrary if (showExportGCodeButton) { - string exportGCodeText = new LocalizedString("Export as").Translated; + string exportGCodeText = LocalizedString.Get("Export as"); string exportGCodeTextFull = string.Format ("{0} GCode", exportGCodeText); Button exportGCode = textImageButtonFactory.Generate(exportGCodeTextFull); @@ -96,8 +96,8 @@ namespace MatterHackers.MatterControl.PrintLibrary if (!showExportGCodeButton) { - string noGCodeMessageText = new LocalizedString("Note").Translated; - string noGCodeMessageTextFull = new LocalizedString("To enable GCode export, select a printer profile").Translated; + string noGCodeMessageText = LocalizedString.Get("Note"); + string noGCodeMessageTextFull = LocalizedString.Get("To enable GCode export, select a printer profile"); TextWidget noGCodeMessage = new TextWidget(string.Format("{0}: {1}.", noGCodeMessageText, noGCodeMessageTextFull), textColor: RGBA_Bytes.White, pointSize: 10); topToBottom.AddChild(noGCodeMessage); } @@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.PrintLibrary // TODO: make this work on the mac and then delete this if if (MatterHackers.Agg.UI.WindowsFormsAbstract.GetOSType() == WindowsFormsAbstract.OSType.Windows) { - showInFolderAfterSave = new CheckBox(new LocalizedString("Show file in folder after save").Translated, RGBA_Bytes.White, 10); + showInFolderAfterSave = new CheckBox(LocalizedString.Get("Show file in folder after save"), RGBA_Bytes.White, 10); showInFolderAfterSave.Margin = new BorderDouble(top: 10); topToBottom.AddChild(showInFolderAfterSave); } diff --git a/PrintLibrary/PluginChooserWindow.cs b/PrintLibrary/PluginChooserWindow.cs index 362c2d7bf..f07adbe4c 100644 --- a/PrintLibrary/PluginChooserWindow.cs +++ b/PrintLibrary/PluginChooserWindow.cs @@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.PrintLibrary public PluginChooserWindow() : base(360, 300) { - Title = new LocalizedString("Installed Plugins").Translated; + Title = LocalizedString.Get("Installed Plugins"); FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom); topToBottom.AnchorAll(); @@ -71,7 +71,7 @@ namespace MatterHackers.MatterControl.PrintLibrary headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string elementHeaderLblBeg = new LocalizedString("Select a Design Tool").Translated; + string elementHeaderLblBeg = LocalizedString.Get("Select a Design Tool"); string elementHeaderLblFull = string.Format("{0}:", elementHeaderLblBeg); string elementHeaderLbl = elementHeaderLblFull; TextWidget elementHeader = new TextWidget(string.Format(elementHeaderLbl), pointSize: 14); @@ -149,7 +149,7 @@ namespace MatterHackers.MatterControl.PrintLibrary //ShowAsSystemWindow(); - Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); cancelPresetsButton.Click += (sender, e) => { Close(); }; FlowLayoutWidget buttonRow = new FlowLayoutWidget(); diff --git a/PrintLibrary/PrintLibraryListItem.cs b/PrintLibrary/PrintLibraryListItem.cs index b55ba67be..a9728be67 100644 --- a/PrintLibrary/PrintLibraryListItem.cs +++ b/PrintLibrary/PrintLibraryListItem.cs @@ -359,7 +359,7 @@ namespace MatterHackers.MatterControl.PrintLibrary buttonContainer.Margin = new BorderDouble(0,6); buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; { - addToQueueLink = linkButtonFactory.Generate(new LocalizedString("Add to Queue").Translated); + addToQueueLink = linkButtonFactory.Generate(LocalizedString.Get("Add to Queue")); addToQueueLink.Margin = new BorderDouble(left: 0, right: 10); addToQueueLink.VAnchor = VAnchor.ParentCenter; @@ -369,11 +369,11 @@ namespace MatterHackers.MatterControl.PrintLibrary PrintQueueControl.Instance.AddChild(queueItem); }; - viewLink = linkButtonFactory.Generate(new LocalizedString("View").Translated); + viewLink = linkButtonFactory.Generate(LocalizedString.Get("View")); viewLink.Margin = new BorderDouble(left: 0, right:10); viewLink.VAnchor = VAnchor.ParentCenter; - exportLink = linkButtonFactory.Generate(new LocalizedString("Export").Translated); + exportLink = linkButtonFactory.Generate(LocalizedString.Get("Export")); exportLink.Margin = new BorderDouble(left: 0, right: 10); exportLink.VAnchor = VAnchor.ParentCenter; @@ -382,7 +382,7 @@ namespace MatterHackers.MatterControl.PrintLibrary OpenExportWindow(); }; - removeLink = linkButtonFactory.Generate(new LocalizedString("Remove").Translated); + removeLink = linkButtonFactory.Generate(LocalizedString.Get("Remove")); removeLink.Margin = new BorderDouble(left: 10, right: 10); removeLink.VAnchor = VAnchor.ParentCenter; diff --git a/PrintLibrary/PrintLibraryWidget.cs b/PrintLibrary/PrintLibraryWidget.cs index 2e427fab7..ad33f8af8 100644 --- a/PrintLibrary/PrintLibraryWidget.cs +++ b/PrintLibrary/PrintLibraryWidget.cs @@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.PrintLibrary searchInput.HAnchor = HAnchor.ParentLeftRight; searchInput.VAnchor = VAnchor.ParentCenter; - searchButton = searchButtonFactory.Generate(new LocalizedString("Search").Translated); + searchButton = searchButtonFactory.Generate(LocalizedString.Get("Search")); searchButton.Margin = new BorderDouble(right:9); searchPanel.AddChild(searchInput); @@ -96,12 +96,12 @@ namespace MatterHackers.MatterControl.PrintLibrary buttonPanel.HAnchor = HAnchor.ParentLeftRight; buttonPanel.Padding = new BorderDouble(0, 3); { - Button addToLibrary = textImageButtonFactory.Generate(new LocalizedString("Import").Translated, "icon_import_white_32x32.png"); + Button addToLibrary = textImageButtonFactory.Generate(LocalizedString.Get("Import"), "icon_import_white_32x32.png"); buttonPanel.AddChild(addToLibrary); addToLibrary.Margin = new BorderDouble(0, 0, 3, 0); addToLibrary.Click += new ButtonBase.ButtonEventHandler(loadFile_Click); - Button runCreator = textImageButtonFactory.Generate(new LocalizedString("Create").Translated, "icon_creator_white_32x32.png"); + Button runCreator = textImageButtonFactory.Generate(LocalizedString.Get("Create"), "icon_creator_white_32x32.png"); buttonPanel.AddChild(runCreator); runCreator.Margin = new BorderDouble(0, 0, 3, 0); runCreator.Click += (sender, e) => diff --git a/PrintQueue/PrintQueueItem.cs b/PrintQueue/PrintQueueItem.cs index c00ace4b4..5c9ec23d5 100644 --- a/PrintQueue/PrintQueueItem.cs +++ b/PrintQueue/PrintQueueItem.cs @@ -90,8 +90,8 @@ namespace MatterHackers.MatterControl.PrintQueue partLabel.TextColor = WidgetTextColor; partLabel.MinimumSize = new Vector2(1, 16); - string partStatusLblTxt = new LocalizedString ("Status").Translated; - string partStatusLblTxtTest = new LocalizedString ("Queued to Print").Translated; + string partStatusLblTxt = LocalizedString.Get ("Status"); + string partStatusLblTxtTest = LocalizedString.Get ("Queued to Print"); string partStatusLblTxtFull = string.Format("{0}: {1}", partStatusLblTxt,partStatusLblTxtTest); partStatus = new TextWidget(partStatusLblTxtFull, pointSize: 10); @@ -175,7 +175,7 @@ namespace MatterHackers.MatterControl.PrintQueue // view button { - Button viewLink = linkButtonFactory.Generate(new LocalizedString("View").Translated); + Button viewLink = linkButtonFactory.Generate(LocalizedString.Get("View")); viewLink.Click += (sender, e) => { @@ -194,7 +194,7 @@ namespace MatterHackers.MatterControl.PrintQueue // copy button { - Button copyLink = linkButtonFactory.Generate(new LocalizedString("Copy").Translated); + Button copyLink = linkButtonFactory.Generate(LocalizedString.Get("Copy")); copyLink.Click += (sender, e) => { CreateCopyInQueue(); @@ -212,7 +212,7 @@ namespace MatterHackers.MatterControl.PrintQueue // the export menu { - Button exportLink = linkButtonFactory.Generate(new LocalizedString("Export").Translated); + Button exportLink = linkButtonFactory.Generate(LocalizedString.Get("Export")); exportLink.Click += (sender, e) => { OpenExportWindow(); @@ -228,7 +228,7 @@ namespace MatterHackers.MatterControl.PrintQueue // delete button { - Button deleteLink = linkButtonFactory.Generate(new LocalizedString("Remove").Translated); + Button deleteLink = linkButtonFactory.Generate(LocalizedString.Get("Remove")); deleteLink.Click += (sender, e) => { DeletePartFromQueue(); @@ -421,10 +421,10 @@ namespace MatterHackers.MatterControl.PrintQueue string end = maxLengthName.Substring(maxLengthName.Length - amountRemaining, amountRemaining); maxLengthName = start + end; } - string notFoundMessage = new LocalizedString("Oops! Could not find this file").Translated; - string notFoundMessageEnd = new LocalizedString("Would you like to remove it from the queue").Translated; + string notFoundMessage = LocalizedString.Get("Oops! Could not find this file"); + string notFoundMessageEnd = LocalizedString.Get("Would you like to remove it from the queue"); string message = String.Format("{0}:\n'{1}'\n\n{2}?",notFoundMessage, maxLengthName,notFoundMessageEnd); - string titleLbl = new LocalizedString("Item not Found").Translated; + string titleLbl = LocalizedString.Get("Item not Found"); if (StyledMessageBox.ShowMessageBox(message, titleLbl, StyledMessageBox.MessageType.YES_NO)) { PrintQueueControl.Instance.RemoveIndex(PrintQueueControl.Instance.GetIndex(printItem)); diff --git a/PrintQueue/PrintQueueMenu.cs b/PrintQueue/PrintQueueMenu.cs index 407bf9f22..b5e8841de 100644 --- a/PrintQueue/PrintQueueMenu.cs +++ b/PrintQueue/PrintQueueMenu.cs @@ -26,7 +26,7 @@ namespace MatterHackers.MatterControl.PrintQueue public PrintQueueMenu() { - MenuDropList = new DropDownMenu(new LocalizedString("Queue Options").Translated, Direction.Up); + MenuDropList = new DropDownMenu(LocalizedString.Get("Queue Options"), Direction.Up); MenuDropList.HAnchor |= HAnchor.ParentLeft; MenuDropList.VAnchor |= VAnchor.ParentTop; SetMenuItems(); @@ -64,10 +64,10 @@ namespace MatterHackers.MatterControl.PrintQueue menuItems = new TupleList> { {"STL", null}, - {new LocalizedString(" Import from Zip").Translated, importQueueFromZipMenu_Click}, - {new LocalizedString(" Export to Zip").Translated, exportQueueToZipMenu_Click}, + {LocalizedString.Get(" Import from Zip"), importQueueFromZipMenu_Click}, + {LocalizedString.Get(" Export to Zip"), exportQueueToZipMenu_Click}, {"GCode", null}, - {new LocalizedString(" Export to Folder").Translated, exportGCodeToFolderButton_Click}, + {LocalizedString.Get(" Export to Folder"), exportGCodeToFolderButton_Click}, }; } else @@ -76,12 +76,12 @@ namespace MatterHackers.MatterControl.PrintQueue menuItems = new TupleList> { {"STL", null}, - {new LocalizedString(" Import from Zip").Translated, importQueueFromZipMenu_Click}, - {new LocalizedString(" Export to Zip").Translated, exportQueueToZipMenu_Click}, + {LocalizedString.Get(" Import from Zip"), importQueueFromZipMenu_Click}, + {LocalizedString.Get(" Export to Zip"), exportQueueToZipMenu_Click}, {"GCode", null}, - {new LocalizedString(" Export to Folder").Translated, exportGCodeToFolderButton_Click}, - {new LocalizedString("Extra").Translated, null}, - {new LocalizedString(" Create Part Sheet").Translated, createPartsSheetsButton_Click}, + {LocalizedString.Get(" Export to Folder"), exportGCodeToFolderButton_Click}, + {LocalizedString.Get("Extra"), null}, + {LocalizedString.Get(" Create Part Sheet"), createPartsSheetsButton_Click}, }; } @@ -117,9 +117,9 @@ namespace MatterHackers.MatterControl.PrintQueue { SaveFileDialogParams saveParams = new SaveFileDialogParams("Save Parts Sheet|*.pdf"); - saveParams.ActionButtonLabel = new LocalizedString("Save Parts Sheet").Translated; - string saveParamsTitleLbl = new LocalizedString("MatterContol").Translated; - string saveParamsTitleLblFull = new LocalizedString ("Save").Translated; + saveParams.ActionButtonLabel = LocalizedString.Get("Save Parts Sheet"); + string saveParamsTitleLbl = LocalizedString.Get("MatterContol"); + string saveParamsTitleLblFull = LocalizedString.Get ("Save"); saveParams.Title = string.Format("{0}: {1}",saveParamsTitleLbl,saveParamsTitleLblFull); System.IO.Stream streamToSaveTo = FileDialog.SaveFileDialog(ref saveParams); @@ -170,7 +170,7 @@ namespace MatterHackers.MatterControl.PrintQueue private void SelectLocationToExportGCode(object state) { SelectFolderDialogParams selectParams = new SelectFolderDialogParams("Select Location To Save Files"); - selectParams.ActionButtonLabel = new LocalizedString("Export").Translated; + selectParams.ActionButtonLabel = LocalizedString.Get("Export"); selectParams.Title = "MatterControl: Select A Folder"; string path = FileDialog.SelectFolderDialog(ref selectParams); diff --git a/PrintQueue/QueueControlsWidget.cs b/PrintQueue/QueueControlsWidget.cs index ef8f9576d..7799c6803 100644 --- a/PrintQueue/QueueControlsWidget.cs +++ b/PrintQueue/QueueControlsWidget.cs @@ -46,12 +46,12 @@ namespace MatterHackers.MatterControl.PrintQueue buttonPanel1.Padding = new BorderDouble(0, 3); { - Button addToQueueButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png"); + Button addToQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); buttonPanel1.AddChild(addToQueueButton); addToQueueButton.Margin = new BorderDouble(0, 0, 3, 0); addToQueueButton.Click += new ButtonBase.ButtonEventHandler(loadFile_Click); - Button deleteAllFromQueueButton = textImageButtonFactory.Generate(new LocalizedString("Remove All").Translated); + Button deleteAllFromQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Remove All")); deleteAllFromQueueButton.Margin = new BorderDouble(3, 0); deleteAllFromQueueButton.Click += new ButtonBase.ButtonEventHandler(deleteAllFromQueueButton_Click); buttonPanel1.AddChild(deleteAllFromQueueButton); diff --git a/PrinterCommunication/PrinterCommunication.cs b/PrinterCommunication/PrinterCommunication.cs index cab175870..fc3872592 100644 --- a/PrinterCommunication/PrinterCommunication.cs +++ b/PrinterCommunication/PrinterCommunication.cs @@ -488,26 +488,26 @@ namespace MatterHackers.MatterControl switch (CommunicationState) { case CommunicationStates.Disconnected: - return new LocalizedString("Not Connected").Translated; + return LocalizedString.Get("Not Connected"); case CommunicationStates.Disconnecting: - return new LocalizedString("Disconnecting").Translated; + return LocalizedString.Get("Disconnecting"); case CommunicationStates.AttemptingToConnect: - string connectingMessageTxt = new LocalizedString ("Connecting").Translated; + string connectingMessageTxt = LocalizedString.Get ("Connecting"); return string.Format("{0}...",connectingMessageTxt); case CommunicationStates.ConnectionLost: - return new LocalizedString("Connection Lost").Translated; + return LocalizedString.Get("Connection Lost"); case CommunicationStates.FailedToConnect: return string.Format("Unable to Connect"); case CommunicationStates.Connected: - return new LocalizedString("Connected").Translated; + return LocalizedString.Get("Connected"); case CommunicationStates.PreparingToPrint: - return new LocalizedString("Preparing To Print").Translated; + return LocalizedString.Get("Preparing To Print"); case CommunicationStates.Printing: - return new LocalizedString("Printing").Translated; + return LocalizedString.Get("Printing"); case CommunicationStates.Paused: - return new LocalizedString("Paused").Translated; + return LocalizedString.Get("Paused"); case CommunicationStates.FinishedPrint: - return new LocalizedString("Finished Print").Translated; + return LocalizedString.Get("Finished Print"); default: throw new NotImplementedException("Make sure very satus returns the correct connected state."); } diff --git a/PrinterControls/EditMacrosWindow.cs b/PrinterControls/EditMacrosWindow.cs index 2470b7af1..4b9d6da06 100644 --- a/PrinterControls/EditMacrosWindow.cs +++ b/PrinterControls/EditMacrosWindow.cs @@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string editMacroLabel = new LocalizedString("Edit Macro").Translated; + string editMacroLabel = LocalizedString.Get("Edit Macro"); string editMacroLabelFull = string.Format("{0}:", editMacroLabel); TextWidget elementHeader = new TextWidget(editMacroLabelFull, pointSize: 14); elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -100,10 +100,10 @@ namespace MatterHackers.MatterControl presetsFormContainer.AddChild(createMacroCommandContainer()); - Button addMacroButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated); + Button addMacroButton = textImageButtonFactory.Generate(LocalizedString.Get("Save")); addMacroButton.Click += new ButtonBase.ButtonEventHandler(saveMacro_Click); - Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); cancelPresetsButton.Click += (sender, e) => { UiThread.RunOnIdle((state) => @@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - string macroNameLabelTxt = new LocalizedString("Macro Name").Translated; + string macroNameLabelTxt = LocalizedString.Get("Macro Name"); string macroNameLabelTxtFull = string.Format("{0}:", macroNameLabelTxt); TextWidget macroNameLabel = new TextWidget( macroNameLabelTxtFull, 0, 0, 12); macroNameLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -144,7 +144,7 @@ namespace MatterHackers.MatterControl macroNameInput = new MHTextEditWidget(windowController.ActiveMacro.Name); macroNameInput.HAnchor = HAnchor.ParentLeftRight; - string giveMacroANameLbl = new LocalizedString("Give your macro a name").Translated; + string giveMacroANameLbl = LocalizedString.Get("Give your macro a name"); string giveMacroANameLblFull = string.Format ("{0}.", giveMacroANameLbl); macroNameError = new TextWidget(giveMacroANameLblFull, 0, 0, 10); macroNameError.TextColor = RGBA_Bytes.White; @@ -164,7 +164,7 @@ namespace MatterHackers.MatterControl container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - string macroCommandLblTxt = new LocalizedString("Macro Commands").Translated; + string macroCommandLblTxt = LocalizedString.Get("Macro Commands"); string macroCommandLblTxtFull = string.Format ("{0}:", macroCommandLblTxt); TextWidget macroCommandLabel = new TextWidget(macroCommandLblTxtFull, 0, 0, 12); macroCommandLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -174,7 +174,7 @@ namespace MatterHackers.MatterControl macroCommandInput = new MHTextEditWidget(windowController.ActiveMacro.Value, pixelHeight: 120, multiLine: true); macroCommandInput.HAnchor = HAnchor.ParentLeftRight; - string shouldBeGCodeLbl = new LocalizedString("This should be in 'Gcode'").Translated; + string shouldBeGCodeLbl = LocalizedString.Get("This should be in 'Gcode'"); string shouldBeGCodeLblFull = string.Format("{0}.", shouldBeGCodeLbl); macroCommandError = new TextWidget(shouldBeGCodeLblFull, 0, 0, 10); macroCommandError.TextColor = RGBA_Bytes.White; @@ -270,7 +270,7 @@ namespace MatterHackers.MatterControl headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string macroPresetsLabel = new LocalizedString("Macro Presets").Translated; + string macroPresetsLabel = LocalizedString.Get("Macro Presets"); string macroPresetsLabelFull = string.Format("{0}:", macroPresetsLabel); TextWidget elementHeader = new TextWidget(macroPresetsLabelFull, pointSize: 14); elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -309,7 +309,7 @@ namespace MatterHackers.MatterControl hSpacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight; macroRow.AddChild(hSpacer); - Button editLink = linkButtonFactory.Generate(new LocalizedString("edit").Translated); + Button editLink = linkButtonFactory.Generate(LocalizedString.Get("edit")); editLink.Margin = new BorderDouble(right: 5); editLink.Click += (sender, e) => { @@ -317,7 +317,7 @@ namespace MatterHackers.MatterControl }; macroRow.AddChild(editLink); - Button removeLink = linkButtonFactory.Generate(new LocalizedString("remove").Translated); + Button removeLink = linkButtonFactory.Generate(LocalizedString.Get("remove")); removeLink.Click += (sender, e) => { m.Delete(); @@ -331,10 +331,10 @@ namespace MatterHackers.MatterControl } - Button addMacroButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png"); + Button addMacroButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addMacroButton.Click += new ButtonBase.ButtonEventHandler(addMacro_Click); - Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Close").Translated); + Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); cancelPresetsButton.Click += (sender, e) => { UiThread.RunOnIdle((state) => { @@ -387,7 +387,7 @@ namespace MatterHackers.MatterControl public EditMacrosWindow(IEnumerable macros, EventHandler functionToCallOnSave) : base(360, 420) { - Title = new LocalizedString("Macro Editor").Translated; + Title = LocalizedString.Get("Macro Editor"); this.functionToCallOnSave = functionToCallOnSave; BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor; ChangeToMacroList(); diff --git a/PrinterControls/EditManualMovementSpeedsWindow.cs b/PrinterControls/EditManualMovementSpeedsWindow.cs index 43b764fae..8e7ed4004 100644 --- a/PrinterControls/EditManualMovementSpeedsWindow.cs +++ b/PrinterControls/EditManualMovementSpeedsWindow.cs @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl public EditManualMovementSpeedsWindow(string windowTitle, string movementSpeedsString, EventHandler functionToCallOnSave) : base(260, 300) { - Title = new LocalizedString(windowTitle).Translated; + Title = LocalizedString.Get(windowTitle); FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom); topToBottom.AnchorAll(); @@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string movementSpeedsLbl = new LocalizedString("Movement Speeds Presets").Translated; + string movementSpeedsLbl = LocalizedString.Get("Movement Speeds Presets"); TextWidget elementHeader = new TextWidget(string.Format("{0}:",movementSpeedsLbl), pointSize: 14); elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor; elementHeader.HAnchor = HAnchor.ParentLeftRight; @@ -133,12 +133,12 @@ namespace MatterHackers.MatterControl if (settingsArray[i].StartsWith("e")) { int extruderIndex = (int)double.Parse(settingsArray[i].Substring(1)) + 1; - string extruderLblTxt = new LocalizedString ("Extruder").Translated; + string extruderLblTxt = LocalizedString.Get("Extruder"); axisLabel = new TextWidget(string.Format("{0} {1}",extruderLblTxt ,extruderIndex), textColor: ActiveTheme.Instance.PrimaryTextColor); } else { - string axisLblText = new LocalizedString("Axis").Translated; + string axisLblText = LocalizedString.Get("Axis"); axisLabel = new TextWidget(string.Format("{0} {1}",axisLblText, settingsArray[i]), textColor: ActiveTheme.Instance.PrimaryTextColor); } axisLabel.VAnchor = VAnchor.ParentCenter; @@ -169,10 +169,10 @@ namespace MatterHackers.MatterControl ShowAsSystemWindow(); - Button savePresetsButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated); + Button savePresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Save")); savePresetsButton.Click += new ButtonBase.ButtonEventHandler(save_Click); - Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); cancelPresetsButton.Click += (sender, e) => { UiThread.RunOnIdle((state) => { diff --git a/PrinterControls/EditTemperaturePresetsWindow.cs b/PrinterControls/EditTemperaturePresetsWindow.cs index 0c25ce036..5513d2a92 100644 --- a/PrinterControls/EditTemperaturePresetsWindow.cs +++ b/PrinterControls/EditTemperaturePresetsWindow.cs @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl public EditTemperaturePresetsWindow(string windowTitle, string temperatureSettings, EventHandler functionToCallOnSave) : base(360, 300) { - Title = new LocalizedString(windowTitle).Translated; + Title = LocalizedString.Get(windowTitle); FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom); topToBottom.AnchorAll(); @@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string tempShortcutPresetLbl = new LocalizedString("Temperature Shortcut Presets").Translated; + string tempShortcutPresetLbl = LocalizedString.Get("Temperature Shortcut Presets"); string tempShortcutPresetLblFull = string.Format ("{0}:", tempShortcutPresetLbl); TextWidget elementHeader = new TextWidget(tempShortcutPresetLblFull, pointSize: 14); elementHeader.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -111,7 +111,7 @@ namespace MatterHackers.MatterControl labelLabelContainer.Height = 16; labelLabelContainer.Margin = new BorderDouble(3, 0); - string labelLabelTxt = new LocalizedString("Label").Translated; + string labelLabelTxt = LocalizedString.Get("Label"); TextWidget labelLabel = new TextWidget(string.Format(labelLabelTxt), textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 10); labelLabel.HAnchor = HAnchor.ParentLeft; labelLabel.VAnchor = VAnchor.ParentCenter; @@ -145,7 +145,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget leftRightEdit = new FlowLayoutWidget(); leftRightEdit.Padding = new BorderDouble(3); leftRightEdit.HAnchor |= Agg.UI.HAnchor.ParentLeftRight; - string presetLabelTxt = new LocalizedString ("Preset").Translated; + string presetLabelTxt = LocalizedString.Get("Preset"); TextWidget label = new TextWidget(string.Format("{1} {0}.", preset_count,presetLabelTxt ), textColor: ActiveTheme.Instance.PrimaryTextColor); label.VAnchor = VAnchor.ParentCenter; leftRightEdit.AddChild(label); @@ -181,7 +181,7 @@ namespace MatterHackers.MatterControl GuiWidget hSpacer = new GuiWidget(); hSpacer.HAnchor = HAnchor.ParentLeftRight; - TextWidget maxWidgetLabel = new TextWidget(new LocalizedString("Max Temp.").Translated, textColor: ActiveTheme.Instance.PrimaryTextColor); + TextWidget maxWidgetLabel = new TextWidget(LocalizedString.Get("Max Temp."), textColor: ActiveTheme.Instance.PrimaryTextColor); maxWidgetLabel.VAnchor = VAnchor.ParentCenter; leftRightEdit.AddChild(maxWidgetLabel); leftRightEdit.AddChild(hSpacer); @@ -200,10 +200,10 @@ namespace MatterHackers.MatterControl ShowAsSystemWindow(); - Button savePresetsButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated); + Button savePresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Save")); savePresetsButton.Click += new ButtonBase.ButtonEventHandler(save_Click); - Button cancelPresetsButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + Button cancelPresetsButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); cancelPresetsButton.Click += (sender, e) => { CloseOnIdle(); }; FlowLayoutWidget buttonRow = new FlowLayoutWidget(); diff --git a/PrinterControls/MacroControls.cs b/PrinterControls/MacroControls.cs index 5a3c45643..762289e78 100644 --- a/PrinterControls/MacroControls.cs +++ b/PrinterControls/MacroControls.cs @@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl void AddChildElements() { Button editButton; - GroupBox groupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(new LocalizedString("Macros").Translated, out editButton)); + GroupBox groupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(LocalizedString.Get("Macros"), out editButton)); editButton.Click += (sender, e) => { if (editSettingsWindow == null) @@ -151,7 +151,7 @@ namespace MatterHackers.MatterControl } if (buttonCount == 0) { - TextWidget noMacrosFound = new TextWidget(new LocalizedString("No macros are currently setup for this printer.").Translated); + TextWidget noMacrosFound = new TextWidget(LocalizedString.Get("No macros are currently setup for this printer.")); noMacrosFound.TextColor = ActiveTheme.Instance.PrimaryTextColor; macroButtonContainer.AddChild(noMacrosFound); } diff --git a/PrinterControls/ManualPrinterControls.cs b/PrinterControls/ManualPrinterControls.cs index 3aebce143..4ed2aeaa5 100644 --- a/PrinterControls/ManualPrinterControls.cs +++ b/PrinterControls/ManualPrinterControls.cs @@ -198,7 +198,7 @@ namespace MatterHackers.MatterControl private void AddFanControls(FlowLayoutWidget controlsTopToBottomLayout) { - GroupBox fanControlsGroupBox = new GroupBox(new LocalizedString("Fan Controls").Translated); + GroupBox fanControlsGroupBox = new GroupBox(LocalizedString.Get("Fan Controls")); fanControlsGroupBox.Margin = new BorderDouble(0); fanControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -230,7 +230,7 @@ namespace MatterHackers.MatterControl private void AddEePromControls(FlowLayoutWidget controlsTopToBottomLayout) { - GroupBox eePromControlsGroupBox = new GroupBox(new LocalizedString("EEProm Settings").Translated); + GroupBox eePromControlsGroupBox = new GroupBox(LocalizedString.Get("EEProm Settings")); eePromControlsGroupBox.Margin = new BorderDouble(0); eePromControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -251,7 +251,7 @@ namespace MatterHackers.MatterControl ImageWidget eePromIcon = new ImageWidget(eePromImage); eePromIcon.Margin = new BorderDouble (right: 6); - Button openEePromWindow = textImageButtonFactory.Generate(new LocalizedString("CONFIGURE").Translated); + Button openEePromWindow = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE")); openEePromWindow.Click += (sender, e) => { #if false // This is to force the creation of the repetier window for testing when we don't have repetier firmware. @@ -270,7 +270,7 @@ namespace MatterHackers.MatterControl default: UiThread.RunOnIdle((state) => { - string message = new LocalizedString("Oops! There is no eeprom mapping for your printer's firmware.").Translated; + string message = LocalizedString.Get("Oops! There is no eeprom mapping for your printer's firmware."); StyledMessageBox.ShowMessageBox(message, "Warning no eeprom mapping", StyledMessageBox.MessageType.OK); } ); @@ -294,7 +294,7 @@ namespace MatterHackers.MatterControl private void AddMovementControls(FlowLayoutWidget controlsTopToBottomLayout) { Button editButton; - GroupBox movementControlsGroupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(new LocalizedString("Movement Controls").Translated, out editButton)); + GroupBox movementControlsGroupBox = new GroupBox(textImageButtonFactory.GenerateGroupBoxLableWithEdit(LocalizedString.Get("Movement Controls"), out editButton)); editButton.Click += (sender, e) => { if (editSettingsWindow == null) @@ -365,7 +365,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget leftToRight = new FlowLayoutWidget(); leftToRight.Padding = new BorderDouble(3, 0, 0, 5); - TextWidget fanSpeedDescription = new TextWidget(new LocalizedString("Fan Speed:").Translated, textColor: RGBA_Bytes.White); + TextWidget fanSpeedDescription = new TextWidget(LocalizedString.Get("Fan Speed:"), textColor: RGBA_Bytes.White); fanSpeedDescription.VAnchor = Agg.UI.VAnchor.ParentCenter; leftToRight.AddChild(fanSpeedDescription); @@ -404,7 +404,7 @@ namespace MatterHackers.MatterControl private void AddAdjustmentControls(FlowLayoutWidget controlsTopToBottomLayout) { - GroupBox adjustmentControlsGroupBox = new GroupBox(new LocalizedString("Tuning Adjustment (while printing)").Translated); + GroupBox adjustmentControlsGroupBox = new GroupBox(LocalizedString.Get("Tuning Adjustment (while printing)")); adjustmentControlsGroupBox.Margin = new BorderDouble(0); adjustmentControlsGroupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; adjustmentControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; @@ -424,7 +424,7 @@ namespace MatterHackers.MatterControl feedRateLeftToRight = new FlowLayoutWidget(); - feedRateDescription = new TextWidget(new LocalizedString("Speed Multiplier").Translated); + feedRateDescription = new TextWidget(LocalizedString.Get("Speed Multiplier")); feedRateDescription.TextColor = RGBA_Bytes.White; feedRateLeftToRight.AddChild(feedRateDescription); feedRateRatioSlider = new Slider(new Vector2(), 300, minFeedRateRatio, maxFeedRateRatio); @@ -446,7 +446,7 @@ namespace MatterHackers.MatterControl feedRateLeftToRight.AddChild(feedRateValue); feedRateValue.Margin = new BorderDouble(0, 0, 5, 0); textImageButtonFactory.FixedHeight = (int)feedRateValue.Height + 1; - feedRateLeftToRight.AddChild(textImageButtonFactory.Generate(new LocalizedString("Set").Translated)); + feedRateLeftToRight.AddChild(textImageButtonFactory.Generate(LocalizedString.Get("Set"))); } TextWidget extrusionDescription; @@ -455,7 +455,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget leftToRight = new FlowLayoutWidget(); - extrusionDescription = new TextWidget(new LocalizedString("Extrusion Multiplier").Translated); + extrusionDescription = new TextWidget(LocalizedString.Get("Extrusion Multiplier")); extrusionDescription.TextColor = RGBA_Bytes.White; leftToRight.AddChild(extrusionDescription); extrusionRatioSlider = new Slider(new Vector2(), 300, minExtrutionRatio, maxExtrusionRatio); @@ -476,7 +476,7 @@ namespace MatterHackers.MatterControl leftToRight.AddChild(extrusionValue); extrusionValue.Margin = new BorderDouble(0, 0, 5, 0); textImageButtonFactory.FixedHeight = (int)extrusionValue.Height + 1; - leftToRight.AddChild(textImageButtonFactory.Generate(new LocalizedString("Set").Translated)); + leftToRight.AddChild(textImageButtonFactory.Generate(LocalizedString.Get("Set"))); } feedRateDescription.Width = extrusionDescription.Width; @@ -520,7 +520,7 @@ namespace MatterHackers.MatterControl private GuiWidget CreatePrintLevelingControlsContainer() { GroupBox printLevelingControlsContainer; - printLevelingControlsContainer = new GroupBox(new LocalizedString("Automatic Calibration").Translated); + printLevelingControlsContainer = new GroupBox(LocalizedString.Get("Automatic Calibration")); printLevelingControlsContainer.Margin = new BorderDouble(0); printLevelingControlsContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -537,7 +537,7 @@ namespace MatterHackers.MatterControl this.textImageButtonFactory.FixedHeight = TallButtonHeight; - Button runPrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("CONFIGURE").Translated); + Button runPrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("CONFIGURE")); runPrintLevelingButton.Margin = new BorderDouble(left:6); runPrintLevelingButton.VAnchor = VAnchor.ParentCenter; runPrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(runPrintLeveling_Click); @@ -547,17 +547,17 @@ namespace MatterHackers.MatterControl ImageWidget levelingIcon = new ImageWidget(levelingImage); levelingIcon.Margin = new BorderDouble (right: 6); - enablePrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("ENABLE").Translated); + enablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("ENABLE")); enablePrintLevelingButton.Margin = new BorderDouble(left:6); enablePrintLevelingButton.VAnchor = VAnchor.ParentCenter; enablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(enablePrintLeveling_Click); - disablePrintLevelingButton = textImageButtonFactory.Generate(new LocalizedString("DISABLE").Translated); + disablePrintLevelingButton = textImageButtonFactory.Generate(LocalizedString.Get("DISABLE")); disablePrintLevelingButton.Margin = new BorderDouble(left:6); disablePrintLevelingButton.VAnchor = VAnchor.ParentCenter; disablePrintLevelingButton.Click += new ButtonBase.ButtonEventHandler(disablePrintLeveling_Click); - CheckBox doLevelingCheckBox = new CheckBox(new LocalizedString("Enable Automatic Print Leveling").Translated); + CheckBox doLevelingCheckBox = new CheckBox(LocalizedString.Get("Enable Automatic Print Leveling")); doLevelingCheckBox.Margin = new BorderDouble(left: 3); doLevelingCheckBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; doLevelingCheckBox.VAnchor = VAnchor.ParentCenter; @@ -614,7 +614,7 @@ namespace MatterHackers.MatterControl private GuiWidget CreateTerminalControlsContainer() { GroupBox terminalControlsContainer; - terminalControlsContainer = new GroupBox(new LocalizedString("Communications").Translated); + terminalControlsContainer = new GroupBox(LocalizedString.Get("Communications")); terminalControlsContainer.Margin = new BorderDouble(0); terminalControlsContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -638,7 +638,7 @@ namespace MatterHackers.MatterControl ImageWidget terminalIcon = new ImageWidget(terminalImage); terminalIcon.Margin = new BorderDouble (right: 6); - Button showTerminal = textImageButtonFactory.Generate(new LocalizedString("SHOW TERMINAL").Translated); + Button showTerminal = textImageButtonFactory.Generate(LocalizedString.Get("SHOW TERMINAL")); showTerminal.Margin = new BorderDouble(0); showTerminal.Click += (sender, e) => { @@ -805,7 +805,7 @@ namespace MatterHackers.MatterControl homeIconImageWidget.OriginRelativeParent += new Vector2(0, 2); RGBA_Bytes oldColor = this.textImageButtonFactory.normalFillColor; textImageButtonFactory.normalFillColor = new RGBA_Bytes(190, 190, 190); - homeAllButton = textImageButtonFactory.Generate(new LocalizedString("ALL").Translated); + homeAllButton = textImageButtonFactory.Generate(LocalizedString.Get("ALL")); this.textImageButtonFactory.normalFillColor = oldColor; homeAllButton.Margin = new BorderDouble(0, 0, 6, 0); homeAllButton.Click += new ButtonBase.ButtonEventHandler(homeAll_Click); @@ -829,7 +829,7 @@ namespace MatterHackers.MatterControl GuiWidget spacer = new GuiWidget(); spacer.HAnchor = HAnchor.ParentLeftRight; - disableMotors = textImageButtonFactory.Generate(new LocalizedString("UNLOCK").Translated); + disableMotors = textImageButtonFactory.Generate(LocalizedString.Get("UNLOCK")); disableMotors.Margin = new BorderDouble(0); disableMotors.Click += new ButtonBase.ButtonEventHandler(disableMotors_Click); @@ -938,11 +938,11 @@ namespace MatterHackers.MatterControl disablePrintLevelingButton.Visible = ActivePrinterProfile.Instance.DoPrintLeveling; if (ActivePrinterProfile.Instance.DoPrintLeveling) { - printLevelingStatusLabel.Text = new LocalizedString ("Automatic Print Leveling (enabled)").Translated; + printLevelingStatusLabel.Text = LocalizedString.Get ("Automatic Print Leveling (enabled)"); } else { - printLevelingStatusLabel.Text = new LocalizedString ("Automatic Print Leveling (disabled)").Translated; + printLevelingStatusLabel.Text = LocalizedString.Get ("Automatic Print Leveling (disabled)"); } } diff --git a/PrinterControls/OutputScrollWindow.cs b/PrinterControls/OutputScrollWindow.cs index 0bccfa0be..3864123c4 100644 --- a/PrinterControls/OutputScrollWindow.cs +++ b/PrinterControls/OutputScrollWindow.cs @@ -97,7 +97,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget OutputWindowsLayout = new FlowLayoutWidget(FlowDirection.LeftToRight); OutputWindowsLayout.HAnchor |= HAnchor.ParentLeft; - string filterOutputChkTxt = new LocalizedString("Filter Output").Translated; + string filterOutputChkTxt = LocalizedString.Get("Filter Output"); filterOutput = new CheckBox(filterOutputChkTxt); filterOutput.Margin = new BorderDouble(5, 5, 5, 2); @@ -106,7 +106,7 @@ namespace MatterHackers.MatterControl filterOutput.CheckedStateChanged += new CheckBox.CheckedStateChangedEventHandler(SetCorrectFilterOutputBehavior); OutputWindowsLayout.AddChild(filterOutput); - string autoUpperCaseChkTxt = new LocalizedString("Auto Uppercase").Translated; + string autoUpperCaseChkTxt = LocalizedString.Get("Auto Uppercase"); autoUppercase = new CheckBox(autoUpperCaseChkTxt); autoUppercase.Margin = new BorderDouble(5, 5, 5, 2); @@ -151,7 +151,7 @@ namespace MatterHackers.MatterControl manualCommandTextEdit.ActualTextEditWidget.KeyDown += new KeyEventHandler(manualCommandTextEdit_KeyDown); manualEntryLayout.AddChild(manualCommandTextEdit); - sendCommand = controlButtonFactory.Generate(new LocalizedString("Send").Translated); + sendCommand = controlButtonFactory.Generate(LocalizedString.Get("Send")); sendCommand.Margin = new BorderDouble(5, 0); sendCommand.Click += new ButtonBase.ButtonEventHandler(sendManualCommandToPrinter_Click); manualEntryLayout.AddChild(sendCommand); @@ -169,7 +169,7 @@ namespace MatterHackers.MatterControl SetCorrectFilterOutputBehavior(this, null); this.AnchorAll(); - Title = new LocalizedString("MatterControl - Terminal").Translated; + Title = LocalizedString.Get("MatterControl - Terminal"); this.ShowAsSystemWindow(); MinimumSize = new Vector2(Width, Height); } diff --git a/PrinterControls/PrinterConnections/AddConnectionWidget.cs b/PrinterControls/PrinterConnections/AddConnectionWidget.cs index 6e378ae83..ea4401def 100644 --- a/PrinterControls/PrinterConnections/AddConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/AddConnectionWidget.cs @@ -81,7 +81,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections else { this.ActivePrinter = activePrinter; - string editHeaderTitleTxt = new LocalizedString ("Edit").Translated; + string editHeaderTitleTxt = LocalizedString.Get("Edit"); headerTitle = string.Format("{1} - {0}", this.ActivePrinter.Name, editHeaderTitleTxt); if (this.ActivePrinter.BaudRate == null) { @@ -117,7 +117,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections ConnectionControlContainer.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor; ConnectionControlContainer.HAnchor = HAnchor.ParentLeftRight; { - TextWidget printerNameLabel = new TextWidget(new LocalizedString("Printer Name").Translated, 0, 0, 10); + TextWidget printerNameLabel = new TextWidget(LocalizedString.Get("Printer Name"), 0, 0, 10); printerNameLabel.TextColor = this.defaultTextColor; printerNameLabel.HAnchor = HAnchor.ParentLeftRight; printerNameLabel.Margin = new BorderDouble(0, 0, 0, 1); @@ -128,12 +128,12 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections comPortLabelWidget = new FlowLayoutWidget(); - Button refreshComPorts = linkButtonFactory.Generate(new LocalizedString("(refresh)").Translated); + Button refreshComPorts = linkButtonFactory.Generate(LocalizedString.Get("(refresh)")); refreshComPorts.Margin = new BorderDouble(left: 5); refreshComPorts.VAnchor = VAnchor.ParentBottom; - refreshComPorts.Click += new ButtonBase.ButtonEventHandler(RefreshComPorts); + refreshComPorts.Click += new ButtonBase.ButtonEventHandler(RefreshComPorts); - TextWidget comPortLabel = new TextWidget(new LocalizedString("Serial Port").Translated, 0, 0, 10); + TextWidget comPortLabel = new TextWidget(LocalizedString.Get("Serial Port"), 0, 0, 10); comPortLabel.TextColor = this.defaultTextColor; comPortLabelWidget.AddChild(comPortLabel); @@ -183,14 +183,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections //If there are still no com ports show a message to that effect if (portIndex == 0) { - TextWidget comPortOption = new TextWidget(new LocalizedString("No COM ports available").Translated); + TextWidget comPortOption = new TextWidget(LocalizedString.Get("No COM ports available")); comPortOption.Margin = new BorderDouble(3, 6, 5, 6); comPortOption.TextColor = this.subContainerTextColor; comPortContainer.AddChild(comPortOption); } - TextWidget baudRateLabel = new TextWidget(new LocalizedString("Baud Rate").Translated, 0, 0, 10); + TextWidget baudRateLabel = new TextWidget(LocalizedString.Get("Baud Rate"), 0, 0, 10); baudRateLabel.TextColor = this.defaultTextColor; baudRateLabel.Margin = new BorderDouble(0, 0, 0, 10); baudRateLabel.HAnchor = HAnchor.ParentLeftRight; @@ -201,7 +201,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections FlowLayoutWidget printerMakeContainer = createPrinterMakeContainer(); FlowLayoutWidget printerModelContainer = createPrinterModelContainer(); - enableAutoconnect = new CheckBox(new LocalizedString("Auto Connect").Translated); + enableAutoconnect = new CheckBox(LocalizedString.Get("Auto Connect")); enableAutoconnect.TextColor = RGBA_Bytes.White; enableAutoconnect.Margin = new BorderDouble(top: 10); enableAutoconnect.HAnchor = HAnchor.ParentLeft; @@ -228,10 +228,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections buttonContainer.Margin = new BorderDouble(0, 3); { //Construct buttons - saveButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated); + saveButton = textImageButtonFactory.Generate(LocalizedString.Get("Save")); //saveButton.VAnchor = VAnchor.Bottom; - cancelButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + cancelButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); //cancelButton.VAnchor = VAnchor.Bottom; cancelButton.Click += new ButtonBase.ButtonEventHandler(CancelButton_Click); @@ -258,7 +258,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - TextWidget printerManufacturerLabel = new TextWidget(new LocalizedString("Printer Make").Translated, 0, 0, 10); + TextWidget printerManufacturerLabel = new TextWidget(LocalizedString.Get("Printer Make"), 0, 0, 10); printerManufacturerLabel.TextColor = this.defaultTextColor; printerManufacturerLabel.HAnchor = HAnchor.ParentLeftRight; printerManufacturerLabel.Margin = elementMargin; @@ -286,7 +286,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - TextWidget printerModelLabel = new TextWidget(new LocalizedString("Printer Model").Translated, 0, 0, 10); + TextWidget printerModelLabel = new TextWidget(LocalizedString.Get("Printer Model"), 0, 0, 10); printerModelLabel.TextColor = this.defaultTextColor; printerModelLabel.HAnchor = HAnchor.ParentLeftRight; printerModelLabel.Margin = elementMargin; @@ -330,7 +330,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections baudRateContainer.AddChild(baudOption); } - otherBaudRateRadioButton = new RadioButton(new LocalizedString("Other").Translated); + otherBaudRateRadioButton = new RadioButton(LocalizedString.Get("Other")); otherBaudRateRadioButton.Margin = baudRateMargin; otherBaudRateRadioButton.TextColor = this.subContainerTextColor; @@ -485,7 +485,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections return otherBaudRateInput.Text; } - throw new Exception(new LocalizedString("Could not find a selected button.").Translated); + throw new Exception(LocalizedString.Get("Could not find a selected button.")); } void InstallDriver() @@ -534,7 +534,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections } } - throw new Exception(new LocalizedString("Could not find a selected button.").Translated); + throw new Exception(LocalizedString.Get("Could not find a selected button.")); } } } diff --git a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs index 3b8c60ce7..f9faad5d3 100644 --- a/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs +++ b/PrinterControls/PrinterConnections/ChooseConnectionWidget.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections headerRow.Padding = new BorderDouble(0, 3, 0, 3); { - string chooseThreeDPrinterConfigLabel = new LocalizedString("Choose a 3D Printer Configuration").Translated; + string chooseThreeDPrinterConfigLabel = LocalizedString.Get("Choose a 3D Printer Configuration"); string chooseThreeDPrinterConfigFull = string.Format ("{0}:", chooseThreeDPrinterConfigLabel); TextWidget elementHeader = new TextWidget(string.Format(chooseThreeDPrinterConfigFull), pointSize: 14); @@ -63,11 +63,11 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections ActionLink editModeLink; if (!this.editMode) { - editModeLink = actionLinkFactory.Generate(new LocalizedString("Edit").Translated, 12, EditModeOnLink_Click); + editModeLink = actionLinkFactory.Generate(LocalizedString.Get("Edit"), 12, EditModeOnLink_Click); } else { - editModeLink = actionLinkFactory.Generate(new LocalizedString("Done").Translated, 12, EditModeOffLink_Click); + editModeLink = actionLinkFactory.Generate(LocalizedString.Get("Done"), 12, EditModeOffLink_Click); } editModeLink.TextColor = new RGBA_Bytes(250, 250, 250); @@ -107,12 +107,12 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections buttonContainer.HAnchor = HAnchor.ParentLeft | HAnchor.ParentRight; buttonContainer.Margin = new BorderDouble(0, 3); { - closeButton = textImageButtonFactory.Generate(new LocalizedString("Close").Translated); + closeButton = textImageButtonFactory.Generate(LocalizedString.Get("Close")); - Button addPrinterButton = textImageButtonFactory.Generate(new LocalizedString("Add").Translated, "icon_circle_plus.png"); + Button addPrinterButton = textImageButtonFactory.Generate(LocalizedString.Get("Add"), "icon_circle_plus.png"); addPrinterButton.Click += new ButtonBase.ButtonEventHandler(AddConnectionLink_Click); - Button refreshListButton = textImageButtonFactory.Generate(new LocalizedString("Refresh").Translated); + Button refreshListButton = textImageButtonFactory.Generate(LocalizedString.Get("Refresh")); refreshListButton.Click += new ButtonBase.ButtonEventHandler(EditModeOffLink_Click); GuiWidget spacer = new GuiWidget(); diff --git a/PrinterControls/PrinterConnections/ConnectionWindow.cs b/PrinterControls/PrinterConnections/ConnectionWindow.cs index b15b36d2f..c499a735a 100644 --- a/PrinterControls/PrinterConnections/ConnectionWindow.cs +++ b/PrinterControls/PrinterConnections/ConnectionWindow.cs @@ -23,9 +23,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections public ConnectionWindow() : base(350, 600) - { - string connectToPrinterTitle = new LocalizedString("MatterControl").Translated; - string connectToPrinterTitleEnd = new LocalizedString ("Connect to Printer").Translated; + { + string connectToPrinterTitle = LocalizedString.Get("MatterControl"); + string connectToPrinterTitleEnd = LocalizedString.Get("Connect to Printer"); Title = string.Format("{0} - {1}",connectToPrinterTitle,connectToPrinterTitleEnd); if (GetPrinterRecordCount() > 0) diff --git a/PrinterControls/PrinterConnections/PrinterChooser.cs b/PrinterControls/PrinterConnections/PrinterChooser.cs index 3f369a01c..888ad3af5 100644 --- a/PrinterControls/PrinterConnections/PrinterChooser.cs +++ b/PrinterControls/PrinterConnections/PrinterChooser.cs @@ -17,7 +17,7 @@ namespace MatterHackers.MatterControl public PrinterChooser(string selectedMake = null) { - string defaultManufacturerLbl = new LocalizedString ("Select Make").Translated; + string defaultManufacturerLbl = LocalizedString.Get ("Select Make"); string defaultManufacturerLblFull = string.Format ("- {0} -", defaultManufacturerLbl); ManufacturerDropList = new StyledDropDownList(defaultManufacturerLblFull); bool addOther = false; @@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl { preselectIndex = index; } - ManufacturerDropList.AddItem(new LocalizedString("Other").Translated); + ManufacturerDropList.AddItem(LocalizedString.Get("Other")); } if (preselectIndex != -1) { @@ -82,7 +82,7 @@ namespace MatterHackers.MatterControl public ModelChooser(string manufacturer) { - string defaultModelDropDownLbl = new LocalizedString("Select Model").Translated; + string defaultModelDropDownLbl = LocalizedString.Get("Select Model"); string defaultModelDropDownLblFull = string.Format("- {0} -", defaultModelDropDownLbl); ModelDropList = new StyledDropDownList(defaultModelDropDownLblFull); string pathToModels = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "PrinterSettings", manufacturer); @@ -94,7 +94,7 @@ namespace MatterHackers.MatterControl ModelDropList.AddItem(model); } } - ModelDropList.AddItem(new LocalizedString("Other").Translated); + ModelDropList.AddItem(LocalizedString.Get("Other")); AddChild(ModelDropList); diff --git a/PrinterControls/PrinterConnections/PrinterListItems.cs b/PrinterControls/PrinterConnections/PrinterListItems.cs index b69d29719..b17b589cb 100644 --- a/PrinterControls/PrinterConnections/PrinterListItems.cs +++ b/PrinterControls/PrinterConnections/PrinterListItems.cs @@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerName.TextColor = this.defaultTextColor; printerName.HAnchor = HAnchor.ParentLeftRight; - string availableText = new LocalizedString("Unavailable").Translated; + string availableText = LocalizedString.Get("Unavailable"); RGBA_Bytes availableColor = new RGBA_Bytes(158, 18, 0); if (portIsAvailable) { @@ -146,10 +146,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerName.TextColor = this.defaultTextColor; printerName.HAnchor = HAnchor.ParentLeftRight; - editLink = linkButtonFactory.Generate(new LocalizedString("edit").Translated); + editLink = linkButtonFactory.Generate(LocalizedString.Get("edit")); editLink.VAnchor = VAnchor.ParentCenter; - removeLink = linkButtonFactory.Generate(new LocalizedString("remove").Translated); + removeLink = linkButtonFactory.Generate(LocalizedString.Get("remove")); removeLink.VAnchor = VAnchor.ParentCenter; this.AddChild(printerName); diff --git a/PrinterControls/PrinterConnections/SetupConnectionWidgetBase.cs b/PrinterControls/PrinterConnections/SetupConnectionWidgetBase.cs index b2b0b8ceb..19a60a311 100644 --- a/PrinterControls/PrinterConnections/SetupConnectionWidgetBase.cs +++ b/PrinterControls/PrinterConnections/SetupConnectionWidgetBase.cs @@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections } - cancelButton = textImageButtonFactory.Generate(new LocalizedString("Cancel").Translated); + cancelButton = textImageButtonFactory.Generate(LocalizedString.Get("Cancel")); cancelButton.Click += new ButtonBase.ButtonEventHandler(CancelButton_Click); //Create the main container @@ -135,7 +135,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections headerRow.Padding = new BorderDouble(0, 3, 0, 3); headerRow.HAnchor = HAnchor.ParentLeftRight; { - string defaultHeaderTitle = new LocalizedString("3D Printer Setup").Translated; + string defaultHeaderTitle = LocalizedString.Get("3D Printer Setup"); headerLabel = new TextWidget(defaultHeaderTitle, pointSize: 14); headerLabel.AutoExpandBoundsToText = true; headerLabel.TextColor = this.defaultTextColor; diff --git a/PrinterControls/PrinterConnections/SetupStepBaudRate.cs b/PrinterControls/PrinterConnections/SetupStepBaudRate.cs index cf9025642..46751ea2c 100644 --- a/PrinterControls/PrinterConnections/SetupStepBaudRate.cs +++ b/PrinterControls/PrinterConnections/SetupStepBaudRate.cs @@ -37,7 +37,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerBaudRateContainer = createPrinterBaudRateContainer(); contentRow.AddChild(printerBaudRateContainer); { - nextButton = textImageButtonFactory.Generate(new LocalizedString("Continue").Translated); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Continue")); nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click); GuiWidget hSpacer = new GuiWidget(); @@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.VAnchor = VAnchor.ParentBottomTop; BorderDouble elementMargin = new BorderDouble(top: 3); - string baudRateLabelText = new LocalizedString ("Baud Rate").Translated; + string baudRateLabelText = LocalizedString.Get ("Baud Rate"); string baudRateLabelTextFull = string.Format ("{0}:", baudRateLabelText); TextWidget baudRateLabel = new TextWidget(baudRateLabelTextFull, 0, 0, 12); @@ -73,16 +73,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections baudRateMessageContainer.Margin = elementMargin; baudRateMessageContainer.HAnchor = HAnchor.ParentLeftRight; - printerBaudRateError = new TextWidget(new LocalizedString("Select the baud rate.").Translated, 0, 0, 10); + printerBaudRateError = new TextWidget(LocalizedString.Get("Select the baud rate."), 0, 0, 10); printerBaudRateError.TextColor = RGBA_Bytes.White; printerBaudRateError.AutoExpandBoundsToText = true; - printerBaudRateHelpLink = linkButtonFactory.Generate(new LocalizedString("What's this?").Translated); + printerBaudRateHelpLink = linkButtonFactory.Generate(LocalizedString.Get("What's this?")); printerBaudRateHelpLink.Margin = new BorderDouble(left: 5); printerBaudRateHelpLink.VAnchor = VAnchor.ParentBottom; printerBaudRateHelpLink.Click += new ButtonBase.ButtonEventHandler(printerBaudRateHelp_Click); - printerBaudRateHelpMessage = new TextWidget(new LocalizedString("The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000.").Translated, 0, 0, 10); + printerBaudRateHelpMessage = new TextWidget(LocalizedString.Get("The term 'Baud Rate' roughly means the speed at which\ndata is transmitted. Baud rates may differ from printer to\nprinter. Refer to your printer manual for more info.\n\nTip: If you are uncertain - try 250000."), 0, 0, 10); printerBaudRateHelpMessage.TextColor = RGBA_Bytes.White; printerBaudRateHelpMessage.Margin = new BorderDouble(top: 10); printerBaudRateHelpMessage.Visible = false; @@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections baudRateContainer.AddChild(baudOption); } - otherBaudRateRadioButton = new RadioButton(new LocalizedString("Other").Translated); + otherBaudRateRadioButton = new RadioButton(LocalizedString.Get("Other")); otherBaudRateRadioButton.Margin = baudRateMargin; otherBaudRateRadioButton.TextColor = this.subContainerTextColor; @@ -229,7 +229,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { printerBaudRateHelpLink.Visible = false; printerBaudRateError.TextColor = RGBA_Bytes.Red; - printerBaudRateError.Text = new LocalizedString("Oops! Please select a baud rate.").Translated; + printerBaudRateError.Text = LocalizedString.Get("Oops! Please select a baud rate."); } if (baudRate != null) @@ -244,7 +244,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { printerBaudRateHelpLink.Visible = false; printerBaudRateError.TextColor = RGBA_Bytes.Red; - printerBaudRateError.Text = new LocalizedString("Oops! Baud Rate must be an integer.").Translated; + printerBaudRateError.Text = LocalizedString.Get("Oops! Baud Rate must be an integer."); return false; } } @@ -268,7 +268,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections return otherBaudRateInput.Text; } - throw new Exception(new LocalizedString("Could not find a selected button.").Translated); + throw new Exception(LocalizedString.Get("Could not find a selected button.")); } } } diff --git a/PrinterControls/PrinterConnections/SetupStepComPortManual.cs b/PrinterControls/PrinterConnections/SetupStepComPortManual.cs index b81b25369..a158ff0b8 100644 --- a/PrinterControls/PrinterConnections/SetupStepComPortManual.cs +++ b/PrinterControls/PrinterConnections/SetupStepComPortManual.cs @@ -38,16 +38,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections contentRow.AddChild(printerComPortContainer); { //Construct buttons - nextButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Done")); nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click); nextButton.Visible = false; - connectButton = textImageButtonFactory.Generate(new LocalizedString("Connect").Translated); + connectButton = textImageButtonFactory.Generate(LocalizedString.Get("Connect")); connectButton.Click += new ButtonBase.ButtonEventHandler(ConnectButton_Click); PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); - refreshButton = textImageButtonFactory.Generate(new LocalizedString("Refresh").Translated); + refreshButton = textImageButtonFactory.Generate(LocalizedString.Get("Refresh")); refreshButton.Click += new ButtonBase.ButtonEventHandler(RefreshButton_Click); GuiWidget hSpacer = new GuiWidget(); @@ -79,7 +79,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.VAnchor = VAnchor.ParentBottomTop; BorderDouble elementMargin = new BorderDouble(top: 3); - string serialPortLabel = new LocalizedString("Serial Port").Translated; + string serialPortLabel = LocalizedString.Get("Serial Port"); string serialPortLabelFull = string.Format("{0}:", serialPortLabel); TextWidget comPortLabel = new TextWidget(serialPortLabelFull, 0, 0, 12); @@ -94,16 +94,16 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections comPortMessageContainer.Margin = elementMargin; comPortMessageContainer.HAnchor = HAnchor.ParentLeftRight; - printerComPortError = new TextWidget(new LocalizedString("Currently available serial ports.").Translated, 0, 0, 10); + printerComPortError = new TextWidget(LocalizedString.Get("Currently available serial ports."), 0, 0, 10); printerComPortError.TextColor = RGBA_Bytes.White; printerComPortError.AutoExpandBoundsToText = true; - printerComPortHelpLink = linkButtonFactory.Generate(new LocalizedString("What's this?").Translated); + printerComPortHelpLink = linkButtonFactory.Generate(LocalizedString.Get("What's this?")); printerComPortHelpLink.Margin = new BorderDouble(left: 5); printerComPortHelpLink.VAnchor = VAnchor.ParentBottom; printerComPortHelpLink.Click += new ButtonBase.ButtonEventHandler(printerComPortHelp_Click); - printerComPortHelpMessage = new TextWidget(new LocalizedString("The 'Serial Port' identifies which connected device is\nyour printer. Changing which usb plug you use may\nchange the associated serial port.\n\nTip: If you are uncertain, plug-in in your printer and hit\nrefresh. The new port that appears should be your\nprinter.").Translated, 0, 0, 10); + printerComPortHelpMessage = new TextWidget(LocalizedString.Get("The 'Serial Port' identifies which connected device is\nyour printer. Changing which usb plug you use may\nchange the associated serial port.\n\nTip: If you are uncertain, plug-in in your printer and hit\nrefresh. The new port that appears should be your\nprinter."), 0, 0, 10); printerComPortHelpMessage.TextColor = RGBA_Bytes.White; printerComPortHelpMessage.Margin = new BorderDouble(top: 10); printerComPortHelpMessage.Visible = false; @@ -162,7 +162,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections //If there are still no com ports show a message to that effect if (portIndex == 0) { - TextWidget comPortOption = new TextWidget(new LocalizedString("No COM ports available").Translated); + TextWidget comPortOption = new TextWidget(LocalizedString.Get("No COM ports available")); comPortOption.Margin = new BorderDouble(3, 6, 5, 6); comPortOption.TextColor = this.subContainerTextColor; container.AddChild(comPortOption); @@ -207,7 +207,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { printerComPortHelpLink.Visible = false; printerComPortError.TextColor = RGBA_Bytes.Red; - printerComPortError.Text = new LocalizedString("Uh-oh! Could not connect to printer.").Translated; + printerComPortError.Text = LocalizedString.Get("Uh-oh! Could not connect to printer."); connectButton.Visible = true; nextButton.Visible = false; } @@ -216,7 +216,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { printerComPortHelpLink.Visible = false; printerComPortError.TextColor = RGBA_Bytes.White; - printerComPortError.Text = new LocalizedString("Connection succeeded!").Translated; + printerComPortError.Text = LocalizedString.Get("Connection succeeded!"); nextButton.Visible = true; connectButton.Visible = false; } @@ -264,7 +264,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections this.ActivePrinter.Commit(); printerComPortHelpLink.Visible = false; printerComPortError.TextColor = RGBA_Bytes.White; - string printerComPortErrorLbl = new LocalizedString("Attempting to connect").Translated; + string printerComPortErrorLbl = LocalizedString.Get("Attempting to connect"); string printerComPortErrorLblFull = string.Format("{0}...",printerComPortErrorLbl); printerComPortError.Text = printerComPortErrorLblFull; ActivePrinterProfile.Instance.ActivePrinter = this.ActivePrinter; @@ -276,7 +276,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { printerComPortHelpLink.Visible = false; printerComPortError.TextColor = RGBA_Bytes.Red; - printerComPortError.Text = new LocalizedString("Oops! Please select a serial port.").Translated; + printerComPortError.Text = LocalizedString.Get("Oops! Please select a serial port."); } } @@ -295,7 +295,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections return button.PortValue; } } - throw new Exception(new LocalizedString("Could not find a selected button.").Translated); + throw new Exception(LocalizedString.Get("Could not find a selected button.")); } } } diff --git a/PrinterControls/PrinterConnections/SetupStepComPortOne.cs b/PrinterControls/PrinterConnections/SetupStepComPortOne.cs index b9fe112c1..7236364d0 100644 --- a/PrinterControls/PrinterConnections/SetupStepComPortOne.cs +++ b/PrinterControls/PrinterConnections/SetupStepComPortOne.cs @@ -28,7 +28,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections contentRow.AddChild(createPrinterConnectionMessageContainer()); { //Construct buttons - nextButton = textImageButtonFactory.Generate(new LocalizedString("Continue").Translated); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Continue")); nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click); GuiWidget hSpacer = new GuiWidget(); @@ -50,22 +50,22 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(5); BorderDouble elementMargin = new BorderDouble(top: 5); - TextWidget printerMessageOne = new TextWidget(new LocalizedString("MatterControl will now attempt to auto-detect printer.").Translated, 0, 0, 10); + TextWidget printerMessageOne = new TextWidget(LocalizedString.Get("MatterControl will now attempt to auto-detect printer."), 0, 0, 10); printerMessageOne.Margin = new BorderDouble(0, 10, 0,5); printerMessageOne.TextColor = RGBA_Bytes.White; printerMessageOne.HAnchor = HAnchor.ParentLeftRight; printerMessageOne.Margin = elementMargin; - string printerMessageTwoTxt = new LocalizedString("Disconnect printer").Translated; - string printerMessageTwoTxtEnd = new LocalizedString("if currently connected").Translated; + string printerMessageTwoTxt = LocalizedString.Get("Disconnect printer"); + string printerMessageTwoTxtEnd = LocalizedString.Get("if currently connected"); string printerMessageTwoTxtFull = string.Format ("1.) {0} ({1}).", printerMessageTwoTxt, printerMessageTwoTxtEnd); TextWidget printerMessageTwo = new TextWidget(printerMessageTwoTxtFull, 0, 0, 12); printerMessageTwo.TextColor = RGBA_Bytes.White; printerMessageTwo.HAnchor = HAnchor.ParentLeftRight; printerMessageTwo.Margin = elementMargin; - string printerMessageThreeTxt = new LocalizedString("Press").Translated; - string printerMessageThreeTxtEnd = new LocalizedString ("Continue").Translated; + string printerMessageThreeTxt = LocalizedString.Get("Press"); + string printerMessageThreeTxtEnd = LocalizedString.Get ("Continue"); string printerMessageThreeFull = string.Format ("2.) {0} '{1}'.", printerMessageThreeTxt, printerMessageThreeTxtEnd); TextWidget printerMessageThree = new TextWidget(printerMessageThreeFull, 0, 0, 12); printerMessageThree.TextColor = RGBA_Bytes.White; @@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections GuiWidget vSpacer = new GuiWidget(); vSpacer.VAnchor = VAnchor.ParentBottomTop; - Button manualLink = linkButtonFactory.Generate(new LocalizedString("Manual Configuration").Translated); + Button manualLink = linkButtonFactory.Generate(LocalizedString.Get("Manual Configuration")); manualLink.Margin = new BorderDouble(0, 5); manualLink.Click += new ButtonBase.ButtonEventHandler(ManualLink_Click); diff --git a/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs b/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs index 651bbfa74..4b53a36a0 100644 --- a/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs +++ b/PrinterControls/PrinterConnections/SetupStepComPortTwo.cs @@ -34,11 +34,11 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections contentRow.AddChild(createPrinterConnectionMessageContainer()); { //Construct buttons - nextButton = textImageButtonFactory.Generate(new LocalizedString("Done").Translated); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Done")); nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click); nextButton.Visible = false; - connectButton = textImageButtonFactory.Generate(new LocalizedString("Connect").Translated); + connectButton = textImageButtonFactory.Generate(LocalizedString.Get("Connect")); connectButton.Click += new ButtonBase.ButtonEventHandler(ConnectButton_Click); PrinterCommunication.Instance.ConnectionStateChanged.RegisterEvent(onPrinterStatusChanged, ref unregisterEvents); @@ -71,38 +71,38 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(5); BorderDouble elementMargin = new BorderDouble(top: 5); - string printerMessageOneText = new LocalizedString ("MatterControl will now attempt to auto-detect printer.").Translated; + string printerMessageOneText = LocalizedString.Get ("MatterControl will now attempt to auto-detect printer."); TextWidget printerMessageOne = new TextWidget(printerMessageOneText, 0, 0, 10); printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5); printerMessageOne.TextColor = RGBA_Bytes.White; printerMessageOne.HAnchor = HAnchor.ParentLeftRight; printerMessageOne.Margin = elementMargin; - string printerMessageTwoTxtBeg = new LocalizedString ("Disconnect printer").Translated; - string printerMessageTwoTxtEnd = new LocalizedString ("if currently connected").Translated; + string printerMessageTwoTxtBeg = LocalizedString.Get ("Disconnect printer"); + string printerMessageTwoTxtEnd = LocalizedString.Get ("if currently connected"); string printerMessageTwoTxtFull = string.Format ("1.) {0} ({1}).", printerMessageTwoTxtBeg, printerMessageTwoTxtEnd); TextWidget printerMessageTwo = new TextWidget(printerMessageTwoTxtFull, 0, 0, 12); printerMessageTwo.TextColor = RGBA_Bytes.White; printerMessageTwo.HAnchor = HAnchor.ParentLeftRight; printerMessageTwo.Margin = elementMargin; - string printerMessageThreeTxtBeg = new LocalizedString ("Press").Translated; - string printerMessageThreeTxtEnd = new LocalizedString ("Continue").Translated; + string printerMessageThreeTxtBeg = LocalizedString.Get ("Press"); + string printerMessageThreeTxtEnd = LocalizedString.Get ("Continue"); string printerMessageThreeTxtFull = string.Format ("2.) {0} '{1}'.", printerMessageThreeTxtBeg, printerMessageThreeTxtEnd); TextWidget printerMessageThree = new TextWidget(printerMessageThreeTxtFull, 0, 0, 12); printerMessageThree.TextColor = RGBA_Bytes.White; printerMessageThree.HAnchor = HAnchor.ParentLeftRight; printerMessageThree.Margin = elementMargin; - string printerMessageFourBeg = new LocalizedString ("Power on and connect printer").Translated; + string printerMessageFourBeg = LocalizedString.Get ("Power on and connect printer"); string printerMessageFourFull = string.Format ("3.) {0}.", printerMessageFourBeg); TextWidget printerMessageFour = new TextWidget(printerMessageFourFull, 0, 0, 12); printerMessageFour.TextColor = RGBA_Bytes.White; printerMessageFour.HAnchor = HAnchor.ParentLeftRight; printerMessageFour.Margin = elementMargin; - string printerMessageFiveTxtBeg = new LocalizedString ("Press").Translated; - string printerMessageFiveTxtEnd = new LocalizedString ("Connect").Translated; + string printerMessageFiveTxtBeg = LocalizedString.Get ("Press"); + string printerMessageFiveTxtEnd = LocalizedString.Get ("Connect"); string printerMessageFiveTxtFull = string.Format ("4.) {0} '{1}'.", printerMessageFiveTxtBeg, printerMessageFiveTxtEnd); TextWidget printerMessageFive = new TextWidget(printerMessageFiveTxtFull, 0, 0, 12); printerMessageFive.TextColor = RGBA_Bytes.White; @@ -112,7 +112,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections GuiWidget vSpacer = new GuiWidget(); vSpacer.VAnchor = VAnchor.ParentBottomTop; - Button manualLink = linkButtonFactory.Generate(new LocalizedString("Manual Configuration").Translated); + Button manualLink = linkButtonFactory.Generate(LocalizedString.Get("Manual Configuration")); manualLink.Margin = new BorderDouble(0, 5); manualLink.Click += new ButtonBase.ButtonEventHandler(ManualLink_Click); @@ -161,14 +161,14 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections if (candidatePort == null) { printerErrorMessage.TextColor = RGBA_Bytes.Red; - string printerErrorMessageLblFull = new LocalizedString ("Oops! Printer could not be detected ").Translated; + string printerErrorMessageLblFull = LocalizedString.Get ("Oops! Printer could not be detected "); printerErrorMessage.Text = printerErrorMessageLblFull; } else { ActivePrinter.ComPort = candidatePort; printerErrorMessage.TextColor = RGBA_Bytes.White; - string printerErrorMessageLblTwo = new LocalizedString ("Attempting to connect").Translated; + string printerErrorMessageLblTwo = LocalizedString.Get ("Attempting to connect"); string printerErrorMessageLblTwoFull = string.Format("{0}...",printerErrorMessageLblTwo); printerErrorMessage.Text = printerErrorMessageLblTwoFull; this.ActivePrinter.Commit(); @@ -194,7 +194,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections void onConnectionFailed() { printerErrorMessage.TextColor = RGBA_Bytes.Red; - printerErrorMessage.Text = new LocalizedString("Uh-oh! Could not connect to printer.").Translated; + printerErrorMessage.Text = LocalizedString.Get("Uh-oh! Could not connect to printer."); connectButton.Visible = true; nextButton.Visible = false; } @@ -202,7 +202,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections void onConnectionSuccess() { printerErrorMessage.TextColor = RGBA_Bytes.White; - string printerErrorMessageLblThree = new LocalizedString ("Connection succeeded").Translated; + string printerErrorMessageLblThree = LocalizedString.Get ("Connection succeeded"); string printerErrorMessageLblThreeFull = string.Format ("{0}!", printerErrorMessageLblThree); printerErrorMessage.Text = printerErrorMessageLblThreeFull; nextButton.Visible = true; diff --git a/PrinterControls/PrinterConnections/SetupStepInstallDriver.cs b/PrinterControls/PrinterConnections/SetupStepInstallDriver.cs index 26a8a16a5..dc7e11ab5 100644 --- a/PrinterControls/PrinterConnections/SetupStepInstallDriver.cs +++ b/PrinterControls/PrinterConnections/SetupStepInstallDriver.cs @@ -33,15 +33,15 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { this.printerDriverFilePath = this.PrinterSetupStatus.DriverFilePath; - headerLabel.Text = string.Format(new LocalizedString("Install Communication Driver").Translated); + headerLabel.Text = string.Format(LocalizedString.Get("Install Communication Driver")); printerDriverContainer = createPrinterDriverContainer(); contentRow.AddChild(printerDriverContainer); { //Construct buttons - installButton = textImageButtonFactory.Generate(new LocalizedString("Install Driver").Translated); + installButton = textImageButtonFactory.Generate(LocalizedString.Get("Install Driver")); installButton.Click += new ButtonBase.ButtonEventHandler(installButton_Click); - skipButton = textImageButtonFactory.Generate(new LocalizedString("Skip").Translated); + skipButton = textImageButtonFactory.Generate(LocalizedString.Get("Skip")); skipButton.Click += new ButtonBase.ButtonEventHandler(skipButton_Click); GuiWidget hSpacer = new GuiWidget(); @@ -76,12 +76,12 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - printerDriverMessage = new TextWidget(new LocalizedString("This printer requires a driver for communication.").Translated, 0, 0, 10); + printerDriverMessage = new TextWidget(LocalizedString.Get("This printer requires a driver for communication."), 0, 0, 10); printerDriverMessage.TextColor = RGBA_Bytes.White; printerDriverMessage.HAnchor = HAnchor.ParentLeftRight; printerDriverMessage.Margin = elementMargin; - TextWidget printerDriverMessageTwo = new TextWidget(new LocalizedString("Driver located. Would you like to install?").Translated, 0, 0, 10); + TextWidget printerDriverMessageTwo = new TextWidget(LocalizedString.Get("Driver located. Would you like to install?"), 0, 0, 10); printerDriverMessageTwo.TextColor = RGBA_Bytes.White; printerDriverMessageTwo.HAnchor = HAnchor.ParentLeftRight; printerDriverMessageTwo.Margin = elementMargin; @@ -161,7 +161,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections { try { - string printerDriverMessageLbl = new LocalizedString("Installing").Translated; + string printerDriverMessageLbl = LocalizedString.Get("Installing"); string printerDriverMessageLblFull = string.Format("{0}...", printerDriverMessageLbl); printerDriverMessage.Text = printerDriverMessageLblFull; InstallDriver(this.printerDriverFilePath); @@ -169,7 +169,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections } catch { - printerDriverMessage.Text = new LocalizedString("Sorry, we were unable to install the driver.").Translated; + printerDriverMessage.Text = LocalizedString.Get("Sorry, we were unable to install the driver."); return false; } } diff --git a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs index cca9d40ca..b3bfed280 100644 --- a/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs +++ b/PrinterControls/PrinterConnections/SetupStepMakeModelName.cs @@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections contentRow.AddChild(printerModelContainer); //Construct buttons - nextButton = textImageButtonFactory.Generate(new LocalizedString("Save & Continue").Translated); + nextButton = textImageButtonFactory.Generate(LocalizedString.Get("Save & Continue")); nextButton.Click += new ButtonBase.ButtonEventHandler(NextButton_Click); GuiWidget hSpacer = new GuiWidget(); @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - string printerNameLabelTxt = new LocalizedString("Printer Name").Translated; + string printerNameLabelTxt = LocalizedString.Get("Printer Name"); string printerNameLabelTxtFull = string.Format ("{0}:", printerNameLabelTxt); TextWidget printerNameLabel = new TextWidget(printerNameLabelTxtFull, 0, 0, 12); printerNameLabel.TextColor = this.defaultTextColor; @@ -87,7 +87,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerNameInput = new MHTextEditWidget(this.ActivePrinter.Name); printerNameInput.HAnchor = HAnchor.ParentLeftRight; - printerNameError = new TextWidget(new LocalizedString("Give your printer a name.").Translated, 0, 0, 10); + printerNameError = new TextWidget(LocalizedString.Get("Give your printer a name."), 0, 0, 10); printerNameError.TextColor = RGBA_Bytes.White; printerNameError.HAnchor = HAnchor.ParentLeftRight; printerNameError.Margin = elementMargin; @@ -105,7 +105,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - string printerManufacturerLabelTxt = new LocalizedString("Select Make").Translated; + string printerManufacturerLabelTxt = LocalizedString.Get("Select Make"); string printerManufacturerLabelTxtFull = string.Format("{0}:", printerManufacturerLabelTxt); TextWidget printerManufacturerLabel = new TextWidget(printerManufacturerLabelTxtFull, 0, 0, 12); printerManufacturerLabel.TextColor = this.defaultTextColor; @@ -117,7 +117,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerManufacturerSelector.Margin = elementMargin; printerManufacturerSelector.ManufacturerDropList.SelectionChanged += new EventHandler(ManufacturerDropList_SelectionChanged); - printerMakeError = new TextWidget(new LocalizedString("Select the printer manufacturer").Translated, 0, 0, 10); + printerMakeError = new TextWidget(LocalizedString.Get("Select the printer manufacturer"), 0, 0, 10); printerMakeError.TextColor = RGBA_Bytes.White; printerMakeError.HAnchor = HAnchor.ParentLeftRight; printerMakeError.Margin = elementMargin; @@ -136,7 +136,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections container.Margin = new BorderDouble(0, 5); BorderDouble elementMargin = new BorderDouble(top: 3); - string printerModelLabelTxt = new LocalizedString("Select Model").Translated; + string printerModelLabelTxt = LocalizedString.Get("Select Model"); string printerModelLabelTxtFull = string.Format ("{0}:", printerModelLabelTxt); TextWidget printerModelLabel = new TextWidget(printerModelLabelTxtFull, 0, 0, 12); printerModelLabel.TextColor = this.defaultTextColor; @@ -148,7 +148,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections printerModelSelector.Margin = elementMargin; printerModelSelector.ModelDropList.SelectionChanged += new EventHandler(ModelDropList_SelectionChanged); - printerModelError = new TextWidget(new LocalizedString("Select the printer model").Translated, 0, 0, 10); + printerModelError = new TextWidget(LocalizedString.Get("Select the printer model"), 0, 0, 10); printerModelError.TextColor = RGBA_Bytes.White; printerModelError.HAnchor = HAnchor.ParentLeftRight; printerModelError.Margin = elementMargin; diff --git a/PrinterControls/TemperatureIndicator.cs b/PrinterControls/TemperatureIndicator.cs index e4690d822..12ba7201e 100644 --- a/PrinterControls/TemperatureIndicator.cs +++ b/PrinterControls/TemperatureIndicator.cs @@ -156,7 +156,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget extruderActualIndicator = new FlowLayoutWidget(Agg.UI.FlowDirection.LeftToRight); extruderActualIndicator.Margin = new BorderDouble(3, 0); - string extruderActualLabelTxt = new LocalizedString ("Actual").Translated; + string extruderActualLabelTxt = LocalizedString.Get ("Actual"); string extruderActualLabelTxtFull = string.Format ("{0}: ", extruderActualLabelTxt); TextWidget extruderActualLabel = new TextWidget(extruderActualLabelTxtFull, pointSize: 10); extruderActualLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; @@ -170,7 +170,7 @@ namespace MatterHackers.MatterControl extruderActualIndicator.AddChild(extruderActualLabel); extruderActualIndicator.AddChild(actualTempIndicator); - string extruderAboutLabelTxt = new LocalizedString ("Target").Translated; + string extruderAboutLabelTxt = LocalizedString.Get ("Target"); string extruderAboutLabelTxtFull = string.Format ("{0}: ", extruderAboutLabelTxt); TextWidget extruderTargetLabel = new TextWidget(extruderAboutLabelTxtFull, pointSize: 10); @@ -224,7 +224,7 @@ namespace MatterHackers.MatterControl FlowLayoutWidget presetsContainer = new FlowLayoutWidget(); presetsContainer.Margin = new BorderDouble(3, 0); - string presetsLabelTxt = new LocalizedString ("Presets").Translated; + string presetsLabelTxt = LocalizedString.Get ("Presets"); string presetsLabelTxtFull = string.Format ("{0}: ", presetsLabelTxt); TextWidget presetsLabel = new TextWidget(presetsLabelTxtFull, pointSize: 10); diff --git a/PrinterControls/XYZJogControls.cs b/PrinterControls/XYZJogControls.cs index 386790244..f4695bb52 100644 --- a/PrinterControls/XYZJogControls.cs +++ b/PrinterControls/XYZJogControls.cs @@ -187,7 +187,7 @@ namespace MatterHackers.MatterControl eMinusControl = moveButtonFactory.Generate("E-", PrinterCommunication.Axis.E, ManualPrinterControls.EFeedRate(0)); eMinusControl.Margin = new BorderDouble(0, 0, 5, 0); eMinusButtonAndText.AddChild(eMinusControl); - TextWidget eMinusControlLabel = new TextWidget(new LocalizedString("Retract").Translated); + TextWidget eMinusControlLabel = new TextWidget(LocalizedString.Get("Retract")); eMinusControlLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; eMinusControlLabel.VAnchor = Agg.UI.VAnchor.ParentCenter; eMinusButtonAndText.AddChild(eMinusControlLabel); @@ -207,7 +207,7 @@ namespace MatterHackers.MatterControl ePlusControl = moveButtonFactory.Generate("E+", PrinterCommunication.Axis.E, ManualPrinterControls.EFeedRate(0)); ePlusControl.Margin = new BorderDouble(0, 0, 5, 0); ePlusButtonAndText.AddChild(ePlusControl); - TextWidget ePlusControlLabel = new TextWidget(new LocalizedString("Extrude").Translated); + TextWidget ePlusControlLabel = new TextWidget(LocalizedString.Get("Extrude")); ePlusControlLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor; ePlusControlLabel.VAnchor = Agg.UI.VAnchor.ParentCenter; ePlusButtonAndText.AddChild(ePlusControlLabel); diff --git a/SlicerConfiguration/ActiveSliceSettings.cs b/SlicerConfiguration/ActiveSliceSettings.cs index 07b0036ee..aa9c30f44 100644 --- a/SlicerConfiguration/ActiveSliceSettings.cs +++ b/SlicerConfiguration/ActiveSliceSettings.cs @@ -590,15 +590,15 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { if (LayerHeight > NozzleDiameter) { - string error = new LocalizedString("'Layer Height' must be less than or equal to the 'Nozzle Diameter'.").Translated; + string error = LocalizedString.Get("'Layer Height' must be less than or equal to the 'Nozzle Diameter'."); string details = string.Format("Layer Height = {0}\nNozzle Diameter = {1}", LayerHeight, NozzleDiameter); - string location = new LocalizedString("Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'").Translated; + string location = LocalizedString.Get("Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'"); StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error"); return false; } else if (FirstLayerHeight > NozzleDiameter) { - string error = new LocalizedString("First Layer Height' must be less than or equal to the 'Nozzle Diameter'.").Translated; + string error = LocalizedString.Get("First Layer Height' must be less than or equal to the 'Nozzle Diameter'."); string details = string.Format("First Layer Height = {0}\nNozzle Diameter = {1}", FirstLayerHeight, NozzleDiameter); string location = "Location: 'Advanced Controls' -> 'Slice Settings' -> 'Print' -> 'Layers/Perimeters'"; StyledMessageBox.ShowMessageBox(string.Format("{0}\n\n{1}\n\n{2}", error, details, location), "Slice Error"); diff --git a/SlicerConfiguration/SettingsControlBar.cs b/SlicerConfiguration/SettingsControlBar.cs index e061aa10c..f142d51cd 100644 --- a/SlicerConfiguration/SettingsControlBar.cs +++ b/SlicerConfiguration/SettingsControlBar.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop; settingsStatusLabelContainer.Margin = new BorderDouble(0); { - string activeSettingsLabelText = new LocalizedString ("Active Settings").Translated; + string activeSettingsLabelText = LocalizedString.Get ("Active Settings"); string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText); @@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration settingsStatusDescription.AutoExpandBoundsToText = true; settingsStatusDescription.TextColor = ActiveTheme.Instance.PrimaryTextColor; - string unsavedChangesTxtBeg = new LocalizedString("unsaved changes").Translated; + string unsavedChangesTxtBeg = LocalizedString.Get("unsaved changes"); string unsavedChangesTxtFull = string.Format ("({0})", unsavedChangesTxtBeg); unsavedChangesIndicator = new TextWidget(unsavedChangesTxtFull, pointSize: 10); unsavedChangesIndicator.AutoExpandBoundsToText = true; @@ -77,19 +77,19 @@ namespace MatterHackers.MatterControl.SlicerConfiguration settingsStatusLabelContainer.AddChild(unsavedChangesIndicator); } - saveButton = textImageButtonFactory.Generate(new LocalizedString("Save").Translated); + saveButton = textImageButtonFactory.Generate(LocalizedString.Get("Save")); saveButton.VAnchor = VAnchor.ParentTop; saveButton.Visible = false; saveButton.Margin = new BorderDouble(0, 0, 0, 10); saveButton.Click += new ButtonBase.ButtonEventHandler(saveButton_Click); - revertbutton = textImageButtonFactory.Generate(new LocalizedString("Revert").Translated); + revertbutton = textImageButtonFactory.Generate(LocalizedString.Get("Revert")); revertbutton.VAnchor = VAnchor.ParentTop; revertbutton.Visible = false; revertbutton.Margin = new BorderDouble(0,0,0,10); revertbutton.Click += new ButtonBase.ButtonEventHandler(revertbutton_Click); - SliceOptionsMenuDropList = new DropDownMenu(new LocalizedString("Options ").Translated); + SliceOptionsMenuDropList = new DropDownMenu(LocalizedString.Get("Options ")); SliceOptionsMenuDropList.Margin = new BorderDouble(top: 11); SliceOptionsMenuDropList.VAnchor |= VAnchor.ParentTop; SliceOptionsMenuDropList.HoverColor = new RGBA_Bytes(0, 0, 0, 50); @@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration sliceEngineContainer.Margin = new BorderDouble(0,0,10,0); sliceEngineContainer.VAnchor |= VAnchor.ParentTop; { - string sliceEngineLabelText = new LocalizedString ("Slice Engine").Translated; + string sliceEngineLabelText = LocalizedString.Get ("Slice Engine"); string sliceEngineLabelTextFull = string.Format ("{0}:", sliceEngineLabelText); TextWidget sliceEngineLabel = new TextWidget(string.Format(sliceEngineLabelTextFull), pointSize: 10); sliceEngineLabel.Margin = new BorderDouble(0); @@ -210,9 +210,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration void SetMenuItems() { - string importTxt = new LocalizedString ("Import").Translated; + string importTxt = LocalizedString.Get ("Import"); string importTxtFull = string.Format ("{0}", importTxt); - string exportTxt = new LocalizedString("Export").Translated; + string exportTxt = LocalizedString.Get("Export"); string exportTxtFull = string.Format ("{0}", exportTxt); //Set the name and callback function of the menu items slicerOptionsMenuItems = new TupleList> diff --git a/SlicerConfiguration/SliceSettingsOrganizer.cs b/SlicerConfiguration/SliceSettingsOrganizer.cs index 88590d00a..4aa1adcfb 100644 --- a/SlicerConfiguration/SliceSettingsOrganizer.cs +++ b/SlicerConfiguration/SliceSettingsOrganizer.cs @@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration this.SlicerConfigName = slicerConfigName; this.PresentationName = presentationName; this.DataEditType = dataEditType; - this.HelpText = new LocalizedString(helpText).Translated; + this.HelpText = LocalizedString.Get(helpText); } } diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 85dd73617..2e1b707da 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -124,10 +124,10 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { int minSettingNameWidth = 220; - showHelpBox = new CheckBox(new LocalizedString("Show Help").Translated); + showHelpBox = new CheckBox(LocalizedString.Get("Show Help")); showHelpBox.Checked = uiState.showHelp; - showAllDetails = new CheckBox(new LocalizedString("Show All Settings").Translated); + showAllDetails = new CheckBox(LocalizedString.Get("Show All Settings")); showAllDetails.Checked = uiState.userLevel == "Advanced"; FlowLayoutWidget pageTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom, vAnchor: Agg.UI.VAnchor.ParentTop); @@ -138,14 +138,14 @@ namespace MatterHackers.MatterControl.SlicerConfiguration settingsControlBar = new SettingsControlBar(); pageTopToBottomLayout.AddChild(settingsControlBar); - noConnectionMessageContainer = new GroupBox(new LocalizedString("No Printer Selected").Translated); + noConnectionMessageContainer = new GroupBox(LocalizedString.Get("No Printer Selected")); noConnectionMessageContainer.Margin = new BorderDouble(top: 10); noConnectionMessageContainer.TextColor = ActiveTheme.Instance.PrimaryTextColor; noConnectionMessageContainer.BorderColor = ActiveTheme.Instance.PrimaryTextColor; noConnectionMessageContainer.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth; noConnectionMessageContainer.Height = 80; - TextWidget noConnectionMessage = new TextWidget(new LocalizedString("No printer is currently selected. Select printer to edit slice settings.").Translated); + TextWidget noConnectionMessage = new TextWidget(LocalizedString.Get("No printer is currently selected. Select printer to edit slice settings.")); noConnectionMessage.Margin = new BorderDouble(5); noConnectionMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor; noConnectionMessage.VAnchor = VAnchor.ParentCenter; @@ -161,7 +161,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration for (int categoryIndex = 0; categoryIndex < SliceSettingsOrganizer.Instance.UserLevels[UserLevel].CategoriesList.Count; categoryIndex++) { OrganizerCategory category = SliceSettingsOrganizer.Instance.UserLevels[UserLevel].CategoriesList[categoryIndex]; - string categoryPageLbl = new LocalizedString (category.Name).Translated; + string categoryPageLbl = LocalizedString.Get (category.Name); TabPage categoryPage = new TabPage(categoryPageLbl); SimpleTextTabWidget textTabWidget = new SimpleTextTabWidget(categoryPage, 16, ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()); @@ -308,7 +308,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration foreach (OrganizerGroup group in category.GroupsList) { tabIndexForItem = 0; - string groupTabLbl = new LocalizedString (group.Name).Translated; + string groupTabLbl = LocalizedString.Get (group.Name); TabPage groupTabPage = new TabPage(groupTabLbl); SimpleTextTabWidget groupTabWidget = new SimpleTextTabWidget(groupTabPage, 14, ActiveTheme.Instance.TabLabelSelected, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes()); @@ -341,7 +341,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration if (addedSettingToSubGroup) { needToAddSubGroup = true; - string groupBoxLbl = new LocalizedString (subGroup.Name).Translated; + string groupBoxLbl = LocalizedString.Get (subGroup.Name); GroupBox groupBox = new GroupBox (groupBoxLbl); groupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; groupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; @@ -428,7 +428,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - GroupBox groupBox = new GroupBox(new LocalizedString("Extra").Translated); + GroupBox groupBox = new GroupBox(LocalizedString.Get("Extra")); groupBox.TextColor = ActiveTheme.Instance.PrimaryTextColor; groupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor; groupBox.AddChild(topToBottomSettings); @@ -473,7 +473,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration { string convertedNewLines = settingData.PresentationName.Replace("\\n ", "\n"); convertedNewLines = convertedNewLines.Replace("\\n", "\n"); - convertedNewLines = new LocalizedString (convertedNewLines).Translated; + convertedNewLines = LocalizedString.Get (convertedNewLines); TextWidget settingName = new TextWidget(convertedNewLines); settingName.TextColor = ActiveTheme.Instance.PrimaryTextColor; settingName.Width = minSettingNameWidth; diff --git a/SlicerConfiguration/SlicingQueue.cs b/SlicerConfiguration/SlicingQueue.cs index fba4bd8c9..ea0df6488 100644 --- a/SlicerConfiguration/SlicingQueue.cs +++ b/SlicerConfiguration/SlicingQueue.cs @@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration public void QueuePartForSlicing(PrintItemWrapper itemToQueue) { itemToQueue.DoneSlicing = false; - string preparingToSliceModelTxt = new LocalizedString("Preparing to slice model").Translated; + string preparingToSliceModelTxt = LocalizedString.Get("Preparing to slice model"); string peparingToSliceModelFull = string.Format ("{0}...", preparingToSliceModelTxt); itemToQueue.OnSlicingOutputMessage(new StringEventArgs(peparingToSliceModelFull)); using (TimedLock.Lock(listOfSlicingItems, "QueuePartForSlicing")) diff --git a/StaticData/Translations/Master.txt b/StaticData/Translations/Master.txt index 773fd1a89..c169519da 100644 --- a/StaticData/Translations/Master.txt +++ b/StaticData/Translations/Master.txt @@ -862,3 +862,6 @@ Translated:View Manual Printer Controls and Slicing Settings English:View Queue and Library Translated:View Queue and Library +English:Bed Temperature +Translated:Bed Temperature + diff --git a/StaticData/Translations/fr/Translation.txt b/StaticData/Translations/fr/Translation.txt index fe514c0a5..4f910ce96 100644 --- a/StaticData/Translations/fr/Translation.txt +++ b/StaticData/Translations/fr/Translation.txt @@ -862,3 +862,6 @@ Translated:View Manual Printer Controls and Slicing Settings English:View Queue and Library Translated:View Queue and Library +English:Bed Temperature +Translated:Bed Temperature + diff --git a/ToolsPage/ToolsWidget.cs b/ToolsPage/ToolsWidget.cs index a4da581e4..ba3f69de2 100644 --- a/ToolsPage/ToolsWidget.cs +++ b/ToolsPage/ToolsWidget.cs @@ -66,18 +66,18 @@ namespace MatterHackers.MatterControl.ToolsPage buttonPanel.HAnchor = HAnchor.ParentLeftRight; buttonPanel.Padding = new BorderDouble(0, 3); { - Button addToLibrary = textImageButtonFactory.Generate(new LocalizedString("Import").Translated, "icon_import_white_32x32.png"); + Button addToLibrary = textImageButtonFactory.Generate(LocalizedString.Get("Import"), "icon_import_white_32x32.png"); buttonPanel.AddChild(addToLibrary); addToLibrary.Margin = new BorderDouble(0, 0, 3, 0); addToLibrary.Click += new ButtonBase.ButtonEventHandler(loadFile_Click); - deleteFromLibraryButton = textImageButtonFactory.Generate(new LocalizedString("Delete").Translated); + deleteFromLibraryButton = textImageButtonFactory.Generate(LocalizedString.Get("Delete")); deleteFromLibraryButton.Margin = new BorderDouble(3, 0); deleteFromLibraryButton.Click += new ButtonBase.ButtonEventHandler(deleteFromQueueButton_Click); deleteFromLibraryButton.Visible = false; buttonPanel.AddChild(deleteFromLibraryButton); - addToQueueButton = textImageButtonFactory.Generate(new LocalizedString("Add to Queue").Translated); + addToQueueButton = textImageButtonFactory.Generate(LocalizedString.Get("Add to Queue")); addToQueueButton.Margin = new BorderDouble(3, 0); addToQueueButton.Click += new ButtonBase.ButtonEventHandler(addToQueueButton_Click); addToQueueButton.Visible = false; diff --git a/WidescreenPanel.cs b/WidescreenPanel.cs index 650ed7012..27aacde1d 100644 --- a/WidescreenPanel.cs +++ b/WidescreenPanel.cs @@ -222,16 +222,16 @@ namespace MatterHackers.MatterControl manualPrinterControlsScrollArea.AddChild(manualPrinterControls); //Add the tab contents for 'Advanced Controls' - string printerControlsLabel = new LocalizedString("Controls").Translated; + string printerControlsLabel = LocalizedString.Get("Controls"); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(manualPrinterControlsScrollArea, printerControlsLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - string sliceSettingsLabel = new LocalizedString("Slice Settings").Translated; + string sliceSettingsLabel = LocalizedString.Get("Slice Settings"); sliceSettingsWidget = new SliceSettingsWidget(sliceSettingsUiState); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(sliceSettingsWidget, sliceSettingsLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); - string configurationLabel = new LocalizedString("Configuration").Translated; + string configurationLabel = LocalizedString.Get("Configuration"); ScrollableWidget configurationControls = new ConfigurationPage(); advancedControls.AddTab(new SimpleTextTabWidget(new TabPage(configurationControls, configurationLabel), 18, ActiveTheme.Instance.PrimaryTextColor, new RGBA_Bytes(), unselectedTextColor, new RGBA_Bytes())); @@ -390,7 +390,7 @@ namespace MatterHackers.MatterControl void NumQueueItemsChanged(object sender, EventArgs widgetEvent) { - string queueStringBeg = new LocalizedString("Queue").Translated; + string queueStringBeg = LocalizedString.Get("Queue"); string queueString = string.Format("{1} ({0})", PrintQueue.PrintQueueControl.Instance.Count, queueStringBeg); QueueTabPage.Text = string.Format(queueString, PrintQueue.PrintQueueControl.Instance.Count); }