Merge pull request #4 from gregory-diaz/master

More Localization
This commit is contained in:
Kevin Pope 2014-02-11 10:23:57 -08:00
commit 34c3d16fd7
14 changed files with 158 additions and 90 deletions

View file

@ -265,8 +265,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.HAnchor = HAnchor.ParentLeftRight;
modelInfoContainer.Padding = new BorderDouble(5);
string printTimeLbl = new LocalizedString ("Print Time").Translated;
string printTimeLblFull = string.Format ("{0}:", printTimeLbl);
// put in the print time
modelInfoContainer.AddChild(new TextWidget("Print Time:", textColor: RGBA_Bytes.White));
modelInfoContainer.AddChild(new TextWidget(printTimeLblFull, textColor: RGBA_Bytes.White));
{
string timeRemainingText = "---";
@ -294,8 +296,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
//modelInfoContainer.AddChild(new TextWidget("Size:", textColor: RGBA_Bytes.White));
string filamentLengthLbl = new LocalizedString ("Filament Length").Translated;
string filamentLengthLblFull = string.Format ("{0}:", filamentLengthLbl);
// show the filament used
modelInfoContainer.AddChild(new TextWidget("Filament Length:", textColor: RGBA_Bytes.White));
modelInfoContainer.AddChild(new TextWidget(filamentLengthLblFull, textColor: RGBA_Bytes.White));
{
double filamentUsed = gcodeViewWidget.LoadedGCode.GetFilamentUsedMm(ActiveSliceSettings.Instance.NozzleDiameter);
@ -305,7 +309,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.AddChild(estimatedPrintTime);
}
modelInfoContainer.AddChild(new TextWidget("Filament Volume:", textColor: RGBA_Bytes.White));
string filamentVolumeLbl = new LocalizedString ("Filament Volume").Translated;
string filamentVolumeLblFull = string.Format("{0}:", filamentVolumeLbl);
modelInfoContainer.AddChild(new TextWidget(filamentVolumeLblFull, textColor: RGBA_Bytes.White));
{
var density = 1.0;
string filamentType = "PLA";
@ -326,7 +332,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
modelInfoContainer.AddChild(estimatedPrintTime);
}
modelInfoContainer.AddChild(new TextWidget("Weight:", textColor: RGBA_Bytes.White));
string weightLbl = new LocalizedString("Weight").Translated;
string weightLblFull = string.Format("{0}:", weightLbl);
modelInfoContainer.AddChild(new TextWidget(weightLblFull, textColor: RGBA_Bytes.White));
{
var density = 1.0;
string filamentType = "PLA";
@ -386,7 +394,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layerInfoContainer.Padding = new BorderDouble(5);
// put in a show grid check box
CheckBox showGrid = new CheckBox("Show Grid", textColor: RGBA_Bytes.White);
CheckBox showGrid = new CheckBox(new LocalizedString("Show Grid").Translated, textColor: RGBA_Bytes.White);
showGrid.Checked = gcodeViewWidget.RenderGrid;
showGrid.CheckedStateChanged += (sender, e) =>
{
@ -395,7 +403,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
layerInfoContainer.AddChild(showGrid);
// put in a show moves checkbox
CheckBox showMoves = new CheckBox("Show Moves", textColor: RGBA_Bytes.White);
CheckBox showMoves = new CheckBox(new LocalizedString("Show Moves").Translated, textColor: RGBA_Bytes.White);
showMoves.Checked = gcodeViewWidget.RenderMoves;
showMoves.CheckedStateChanged += (sender, e) =>
{
@ -625,7 +633,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.AddChild(editCurrentLayerIndex);
gcodeViewWidget.ActiveLayerChanged += new EventHandler(gcodeViewWidget_ActiveLayerChanged);
setLayerButton = textImageButtonFactory.Generate("Go");
setLayerButton = textImageButtonFactory.Generate(new LocalizedString("Go").Translated);
setLayerButton.VAnchor = Agg.UI.VAnchor.ParentCenter;
setLayerButton.Click += new Button.ButtonEventHandler(layerCountTextWidget_EditComplete);
this.AddChild(setLayerButton);

View file

@ -419,7 +419,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (Meshes.Count > 0)
{
processingProgressControl.textWidget.Text = new LocalizedString("Making Copy:").Translated;
string makingCopyLabel = new LocalizedString("Making Copy").Translated;
string makingCopyLabelFull = string.Format ("{0}:", makingCopyLabel);
processingProgressControl.textWidget.Text = makingCopyLabelFull;
processingProgressControl.Visible = true;
processingProgressControl.PercentComplete = 0;
LockEditControls();
@ -587,7 +589,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
if (Meshes.Count > 0)
{
processingProgressControl.textWidget.Text = "Loading Parts:";
string loadingPartLabel = new LocalizedString("Loading Parts").Translated;
string loadingPartLabelFull = string.Format("{0}:", loadingPartLabel);
processingProgressControl.textWidget.Text = loadingPartLabelFull;
processingProgressControl.Visible = true;
processingProgressControl.PercentComplete = 0;
LockEditControls();
@ -938,7 +942,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// put in the part info display
if(false)
{
CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton("Part Info", "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
CheckBox expandPartInfoOptions = expandMenuOptionFactory.GenerateCheckBoxButton(new LocalizedString("Part Info").Translated, "icon_arrow_right_no_border_32x32.png", "icon_arrow_down_no_border_32x32.png");
expandPartInfoOptions.Margin = new BorderDouble(bottom: 2);
buttonRightPanel.AddChild(expandPartInfoOptions);
@ -953,7 +957,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
PartInfoOptionContainer.Margin = new BorderDouble(8, 3);
TextWidget sizeInfo = new TextWidget("Size:", textColor: RGBA_Bytes.White);
string sizeInfoLbl = new LocalizedString("Size").Translated;
string sizeInfoLblFull = string.Format("{0}:", sizeInfoLbl);
TextWidget sizeInfo = new TextWidget(sizeInfoLblFull, textColor: RGBA_Bytes.White);
PartInfoOptionContainer.AddChild(sizeInfo);
TextWidget xSizeInfo = new TextWidget(" x 10.1", pointSize: 10, textColor: RGBA_Bytes.White);
xSizeInfo.AutoExpandBoundsToText = true;
@ -1039,7 +1045,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
scaleRatioContainer.HAnchor = HAnchor.ParentLeftRight;
scaleRatioContainer.Padding = new BorderDouble(5);
TextWidget scaleRatioLabel = new TextWidget(new LocalizedString("Ratio:").Translated, textColor: RGBA_Bytes.White);
string scaleRatioLblTxt = new LocalizedString("Ratio").Translated;
string scaleRatioLblTxtFull = string.Format("{0}:", scaleRatioLblTxt);
TextWidget scaleRatioLabel = new TextWidget(scaleRatioLblTxtFull, textColor: RGBA_Bytes.White);
scaleRatioLabel.VAnchor = VAnchor.ParentCenter;
scaleRatioContainer.AddChild(scaleRatioLabel);
@ -1114,7 +1122,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
buttonPanel.AddChild(presetScaleMenu);
applyScaleButton = whiteButtonFactory.Generate("Apply Scale", centerText: true);
applyScaleButton = whiteButtonFactory.Generate(new LocalizedString("Apply Scale").Translated, centerText: true);
applyScaleButton.Visible = false;
applyScaleButton.Cursor = Cursors.Hand;
buttonPanel.AddChild(applyScaleButton);
@ -1178,7 +1186,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
GuiWidget horizontalSpacer = new GuiWidget();
horizontalSpacer.HAnchor = HAnchor.ParentLeftRight;
TextWidget degreesLabel = new TextWidget(new LocalizedString("Degrees:").Translated, textColor: RGBA_Bytes.White);
string degreesLabelTxt = new LocalizedString("Degrees").Translated;
string degreesLabelTxtFull = string.Format("{0}:", degreesLabelTxt);
TextWidget degreesLabel = new TextWidget(degreesLabelTxt, textColor: RGBA_Bytes.White);
degreesContainer.AddChild(degreesLabel);
degreesContainer.AddChild(horizontalSpacer);