Initial support for loading translations. A big step for issue #1.

All controls and messageboxes appear to be translated now.
Branch_2.1.x
Nathan Crawford 2013-12-07 01:28:04 -05:00
rodzic e0ebf2d20c
commit 96c38379db
9 zmienionych plików z 409 dodań i 153 usunięć

Wyświetl plik

@ -56,6 +56,8 @@ namespace embroideryReader
private const String SETTING_DRAW_GRID = "draw background grid";
private const String SETTING_TRANSLATION = "translation";
// YES and NO are deprecated in favor of TRUE and FALSE
private const String VALUE_YES = "yes";
private const String VALUE_NO = "no";
@ -149,6 +151,12 @@ namespace embroideryReader
{
settings.setValue(SECTION_BACKGROUND_COLOR, SETTING_BACKGROUND_COLOR_ENABLED, VALUE_FALSE);
}
// Default language to english
if (String.IsNullOrWhiteSpace(settings.getValue(SETTING_TRANSLATION)))
{
settings.setValue(SETTING_TRANSLATION, "English (EN-US)");
}
}
// This is no longer in the settings file, but I'm keeping it here because
@ -354,5 +362,17 @@ namespace embroideryReader
settings.setValue(SETTING_DRAW_GRID, output);
}
}
public String translation
{
get
{
return settings.getValue(SETTING_TRANSLATION);
}
set
{
settings.setValue(SETTING_TRANSLATION, value);
}
}
}
}

Wyświetl plik

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NJCrawford;
namespace embroideryReader
{
public class Translation
{
private const string TRANSLATIONS_FOLDER = "translations";
private const string TRANSLATION_FILE_EXT = ".ini";
// String IDs
public enum StringID {
UNSUPPORTED_FORMAT,
COLOR_WARNING,
ERROR_FILE,
CORRUPT_FILE,
// File type descriptions
FILE_TYPE_PES,
FILE_TYPE_ALL,
FILE_TYPE_BMP,
FILE_TYPE_PNG,
FILE_TYPE_JPG,
FILE_TYPE_GIF,
FILE_TYPE_TIFF,
ABOUT_MESSAGE,
ERROR_UPDATE,
VERSION,
ERROR_WEBPAGE,
NO_UPDATE,
ERROR_DEBUG,
NO_DESIGN,
UNSUPPORTED_CLASS,
IMAGE_SAVED,
// Menu strings
MENU_FILE,
MENU_OPEN,
MENU_SAVE_IMAGE,
MENU_PRINT,
MENU_PRINT_PREVIEW,
MENU_EXIT,
MENU_EDIT,
MENU_COPY,
MENU_PREFS,
MENU_VIEW,
ROTATE_LEFT,
ROTATE_RIGHT,
MENU_RESET,
MENU_HELP,
CHECK_UPDATE,
SAVE_DEBUG,
SHOW_DEBUG,
MENU_ABOUT,
PICK_COLOR,
BACKGROUND_COLOR,
RESET_COLOR,
CANCEL,
THREAD_THICKNESS,
PIXELS,
BACKGROUND,
STITCH_DRAW,
REMOVE_UGLY_STITCHES,
UGLY_STITCH_LENGTH,
SETTINGS,
LATEST_VERSION,
NEW_VERSION_MESSAGE,
NEW_VERSION_QUESTION,
NEW_VERSION_TITLE,
DEBUG_INFO_SAVED,
DRAW_BACKGROUND_GRID,
};
IniFile translationFile;
public Translation(String name)
{
Load(name);
}
// Returns the names of available translations
// Names are just the file name without the extension
public List<String> GetAvailableTranslations()
{
List<String> retval = new List<string>();
foreach (String file in System.IO.Directory.EnumerateFiles(
System.IO.Path.Combine(Environment.CurrentDirectory, TRANSLATIONS_FOLDER),
"*" + TRANSLATION_FILE_EXT,
System.IO.SearchOption.TopDirectoryOnly))
{
retval.Add(System.IO.Path.GetFileNameWithoutExtension(file));
}
return retval;
}
// Load a translation file
// Names are just the file name without the extension
public void Load(String translationName)
{
translationFile = new IniFile(System.IO.Path.Combine(TRANSLATIONS_FOLDER, translationName + TRANSLATION_FILE_EXT));
}
// Returns the translated string, or a string representation of the
// string ID if the translation isn't available.
public String GetTranslatedString(StringID sid)
{
string retval;
retval = translationFile.getValue(sid.ToString());
if (retval == null)
{
retval = "%" + sid.ToString() + "%";
}
return retval;
}
}
}

Wyświetl plik

@ -90,6 +90,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Translation.cs" />
<EmbeddedResource Include="frmMain.resx">
<SubType>Designer</SubType>
<DependentUpon>frmMain.cs</DependentUpon>

Wyświetl plik

@ -45,6 +45,7 @@ namespace embroideryReader
private const String APP_TITLE = "Embroidery Reader";
private Translation translation;
public frmMain()
{
@ -67,6 +68,8 @@ namespace embroideryReader
{
openFile(args[1]);
}
loadTranslatedStrings(settings.translation);
}
public static bool checkColorFromStrings(string red, string green, string blue)
@ -134,11 +137,11 @@ namespace embroideryReader
if (design.getFormatWarning())
{
toolStripStatusLabel1.Text = "The format of this file is not completely supported";
toolStripStatusLabel1.Text = translation.GetTranslatedString(Translation.StringID.UNSUPPORTED_FORMAT); // "The format of this file is not completely supported";
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
toolStripStatusLabel1.Text = translation.GetTranslatedString(Translation.StringID.COLOR_WARNING); // "Colors shown for this design may be inaccurate"
}
else
{
@ -157,10 +160,11 @@ namespace embroideryReader
}
else
{
string message = "An error occured while reading the file:" + Environment.NewLine + design.getLastError();
string message = translation.GetTranslatedString(Translation.StringID.ERROR_FILE) + // "An error occured while reading the file:"
Environment.NewLine + design.getLastError();
if (design.getStatus() == PesFile.statusEnum.ParseError)
{
message += Environment.NewLine + "This file is either corrupt or not a valid PES file.";
message += Environment.NewLine + translation.GetTranslatedString(Translation.StringID.CORRUPT_FILE); // "This file is either corrupt or not a valid PES file."
}
MessageBox.Show(message);
copyToolStripMenuItem.Enabled = false;
@ -183,7 +187,8 @@ namespace embroideryReader
openFileDialog1.InitialDirectory = settings.lastOpenFileFolder;
}
openFileDialog1.FileName = "";
openFileDialog1.Filter = "Embroidery Files (*.pes)|*.pes|All Files (*.*)|*.*";
openFileDialog1.Filter = translation.GetTranslatedString(Translation.StringID.FILE_TYPE_PES) + " (*.pes)|*.pes|" + // "Embroidery Files (*.pes)|*.pes|
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_ALL) + " (*.*)|*.*"; // All Files (*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
filename = openFileDialog1.FileName;
@ -214,7 +219,7 @@ namespace embroideryReader
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("EmbroideryReader version " + currentVersion() + ". This program reads and displays embroidery designs from .PES files.");
MessageBox.Show(String.Format(translation.GetTranslatedString(Translation.StringID.ABOUT_MESSAGE), currentVersion())); // "EmbroideryReader version " + currentVersion() + ". This program reads and displays embroidery designs from .PES files."
}
private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e)
@ -224,11 +229,17 @@ namespace embroideryReader
if (updater.GetLastError() != "")
{
MessageBox.Show("Encountered an error while checking for updates: " + updater.GetLastError());
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.ERROR_UPDATE) + // "Encountered an error while checking for updates: "
updater.GetLastError());
}
else if (updater.IsUpdateAvailable())
{
if (MessageBox.Show("Version " + updater.VersionAvailable() + " was released on " + updater.getReleaseDate().ToShortDateString() + "." + Environment.NewLine + "You have version " + currentVersion() + ". Would you like to go to the Embroidery Reader website to download or find out more about the new version?", "New version available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (MessageBox.Show(String.Format(translation.GetTranslatedString(Translation.StringID.NEW_VERSION_MESSAGE),
updater.VersionAvailable(), updater.getReleaseDate().ToShortDateString(), currentVersion()) + // "Version " + updater.VersionAvailable() + " was released on " + updater.getReleaseDate().ToShortDateString() + ". You have version " + currentVersion() + "."
Environment.NewLine +
translation.GetTranslatedString(Translation.StringID.NEW_VERSION_QUESTION), // "Would you like to go to the Embroidery Reader website to download or find out more about the new version?",
translation.GetTranslatedString(Translation.StringID.NEW_VERSION_TITLE), // "New version available",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
@ -236,15 +247,18 @@ namespace embroideryReader
}
catch (Exception ex)
{
MessageBox.Show("An error occured while trying to open the webpage:" + Environment.NewLine + ex.ToString());
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.ERROR_WEBPAGE) + // "An error occured while trying to open the webpage:"
Environment.NewLine + ex.ToString());
}
}
}
else
{
MessageBox.Show("No updates are available right now." + Environment.NewLine + "(Latest version is " + updater.VersionAvailable() + ", you have version " + currentVersion() + ")");
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.NO_UPDATE) + // "No updates are available right now."
Environment.NewLine +
String.Format(translation.GetTranslatedString(Translation.StringID.LATEST_VERSION),
updater.VersionAvailable(), currentVersion())); // "(Latest version is " + updater.VersionAvailable() + ", you have version " + currentVersion() + ")");
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
@ -266,16 +280,18 @@ namespace embroideryReader
try
{
string debugFile = design.saveDebugInfo();
MessageBox.Show("Saved debug info to " + debugFile);
MessageBox.Show(String.Format(translation.GetTranslatedString(Translation.StringID.DEBUG_INFO_SAVED), // "Saved debug info to " + debugFile
debugFile));
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.ERROR_DEBUG) + // "There was an error while saving debug info:"
Environment.NewLine + ex.ToString());
}
}
else
{
MessageBox.Show("No design loaded.");
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.NO_DESIGN)); // "No design loaded."
}
}
@ -283,11 +299,13 @@ namespace embroideryReader
{
frmSettingsDialog tempForm = new frmSettingsDialog();
tempForm.settingsToModify = settings;
tempForm.setTranslation = translation;
if (tempForm.ShowDialog() == DialogResult.OK)
{
settings = tempForm.settingsToModify;
checkSettings();
}
loadTranslatedStrings(settings.translation);
}
private void printToolStripMenuItem_Click(object sender, EventArgs e)
@ -339,15 +357,15 @@ namespace embroideryReader
if (design.getClassWarning())
{
toolStripStatusLabel1.Text = "This file contains a class that is not yet supported";
toolStripStatusLabel1.Text = translation.GetTranslatedString(Translation.StringID.UNSUPPORTED_CLASS); // "This file contains a class that is not yet supported"
}
else if (design.getFormatWarning())
{
toolStripStatusLabel1.Text = "The format of this file is not completely supported";
toolStripStatusLabel1.Text = translation.GetTranslatedString(Translation.StringID.UNSUPPORTED_FORMAT); // "The format of this file is not completely supported"
}
else if (design.getColorWarning())
{
toolStripStatusLabel1.Text = "Colors shown for this design may be inaccurate";
toolStripStatusLabel1.Text = translation.GetTranslatedString(Translation.StringID.COLOR_WARNING); // "Colors shown for this design may be inaccurate"
}
else
{
@ -395,12 +413,13 @@ namespace embroideryReader
}
catch (Exception ex)
{
MessageBox.Show("There was an error while saving debug info:" + Environment.NewLine + ex.ToString());
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.ERROR_DEBUG) + // "There was an error while saving debug info:"
Environment.NewLine + ex.ToString());
}
}
else
{
MessageBox.Show("No design loaded.");
MessageBox.Show(translation.GetTranslatedString(Translation.StringID.NO_DESIGN)); // "No design loaded."
}
}
@ -415,7 +434,13 @@ namespace embroideryReader
tempGraph.DrawImageUnscaled(DrawArea, 0, 0);
tempGraph.Dispose();
saveFileDialog1.FileName = "";
saveFileDialog1.Filter = "Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif|All Files (*.*)|*.*";
// "Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif|All Files (*.*)|*.*"
saveFileDialog1.Filter = translation.GetTranslatedString(Translation.StringID.FILE_TYPE_BMP) + " (*.bmp)|*.bmp|" +
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_PNG) + " (*.png)|*.png|" +
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_JPG) + " (*.jpg)|*.jpg|" +
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_GIF) + " (*.gif)|*.gif|" +
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_TIFF) + " (*.tif)|*.tif|" +
translation.GetTranslatedString(Translation.StringID.FILE_TYPE_ALL) + " (*.*)|*.*";
if (settings.lastSaveImageLocation != null)
{
saveFileDialog1.InitialDirectory = settings.lastSaveImageLocation;
@ -435,7 +460,7 @@ namespace embroideryReader
default: format = System.Drawing.Imaging.ImageFormat.Bmp; break;
}
temp.Save(filename, format);
showStatus("Image saved", 5000);
showStatus(translation.GetTranslatedString(Translation.StringID.IMAGE_SAVED), 5000); // "Image saved"
settings.lastSaveImageLocation = System.IO.Path.GetDirectoryName(filename);
}
}
@ -452,5 +477,36 @@ namespace embroideryReader
{
toolStripStatusLabel2.Text = "";
}
private void loadTranslatedStrings(String translationName)
{
translation = new Translation(translationName);
// File menu
fileToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_FILE);
openToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_OPEN);
saveAsBitmapToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_SAVE_IMAGE);
printToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_PRINT);
printPreviewToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_PRINT_PREVIEW);
exitToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_EXIT);
// Edit menu
editToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_EDIT);
copyToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_COPY);
preferencesToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_PREFS);
// View menu
viewToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_VIEW);
rotateLeftToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.ROTATE_LEFT);
rotateRightToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.ROTATE_RIGHT);
refreshToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_RESET);
// Help menu
helpToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_HELP);
checkForUpdateToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.CHECK_UPDATE);
saveDebugInfoToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.SAVE_DEBUG);
showDebugInfoToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.SHOW_DEBUG);
aboutToolStripMenuItem.Text = translation.GetTranslatedString(Translation.StringID.MENU_ABOUT);
}
}
}

Wyświetl plik

@ -34,18 +34,21 @@ namespace embroideryReader
this.btnResetColor = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lblThreadThickness = new System.Windows.Forms.Label();
this.txtThreadThickness = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.lblPixelThick = new System.Windows.Forms.Label();
this.grpBackground = new System.Windows.Forms.GroupBox();
this.grpStitch = new System.Windows.Forms.GroupBox();
this.chkDrawGrid = new System.Windows.Forms.CheckBox();
this.lblUglyLength = new System.Windows.Forms.Label();
this.lblPixelLength = new System.Windows.Forms.Label();
this.txtThreshold = new System.Windows.Forms.TextBox();
this.chkUglyStitches = new System.Windows.Forms.CheckBox();
this.chkDrawGrid = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.cmbLanguage = new System.Windows.Forms.ComboBox();
this.grpLanguage = new System.Windows.Forms.GroupBox();
this.grpBackground.SuspendLayout();
this.grpStitch.SuspendLayout();
this.grpLanguage.SuspendLayout();
this.SuspendLayout();
//
// btnColor
@ -81,7 +84,7 @@ namespace embroideryReader
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Location = new System.Drawing.Point(171, 208);
this.btnOK.Location = new System.Drawing.Point(128, 284);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 3;
@ -92,7 +95,7 @@ namespace embroideryReader
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(252, 208);
this.btnCancel.Location = new System.Drawing.Point(209, 284);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 4;
@ -100,14 +103,14 @@ namespace embroideryReader
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// label1
// lblThreadThickness
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(92, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Thread thickness:";
this.lblThreadThickness.AutoSize = true;
this.lblThreadThickness.Location = new System.Drawing.Point(6, 16);
this.lblThreadThickness.Name = "lblThreadThickness";
this.lblThreadThickness.Size = new System.Drawing.Size(92, 13);
this.lblThreadThickness.TabIndex = 5;
this.lblThreadThickness.Text = "Thread thickness:";
//
// txtThreadThickness
//
@ -116,61 +119,71 @@ namespace embroideryReader
this.txtThreadThickness.Size = new System.Drawing.Size(32, 20);
this.txtThreadThickness.TabIndex = 6;
//
// label2
// lblPixelThick
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(142, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(33, 13);
this.label2.TabIndex = 7;
this.label2.Text = "pixels";
this.lblPixelThick.AutoSize = true;
this.lblPixelThick.Location = new System.Drawing.Point(142, 16);
this.lblPixelThick.Name = "lblPixelThick";
this.lblPixelThick.Size = new System.Drawing.Size(33, 13);
this.lblPixelThick.TabIndex = 7;
this.lblPixelThick.Text = "pixels";
//
// groupBox1
// grpBackground
//
this.groupBox1.Controls.Add(this.lblColor);
this.groupBox1.Controls.Add(this.btnColor);
this.groupBox1.Controls.Add(this.btnResetColor);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(315, 79);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Background";
this.grpBackground.Controls.Add(this.lblColor);
this.grpBackground.Controls.Add(this.btnColor);
this.grpBackground.Controls.Add(this.btnResetColor);
this.grpBackground.Location = new System.Drawing.Point(12, 12);
this.grpBackground.Name = "grpBackground";
this.grpBackground.Size = new System.Drawing.Size(271, 79);
this.grpBackground.TabIndex = 8;
this.grpBackground.TabStop = false;
this.grpBackground.Text = "Background";
//
// groupBox2
// grpStitch
//
this.groupBox2.Controls.Add(this.chkDrawGrid);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.txtThreshold);
this.groupBox2.Controls.Add(this.chkUglyStitches);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.txtThreadThickness);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Location = new System.Drawing.Point(12, 97);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(315, 105);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Stitch drawing";
this.grpStitch.Controls.Add(this.chkDrawGrid);
this.grpStitch.Controls.Add(this.lblUglyLength);
this.grpStitch.Controls.Add(this.lblPixelLength);
this.grpStitch.Controls.Add(this.txtThreshold);
this.grpStitch.Controls.Add(this.chkUglyStitches);
this.grpStitch.Controls.Add(this.lblThreadThickness);
this.grpStitch.Controls.Add(this.txtThreadThickness);
this.grpStitch.Controls.Add(this.lblPixelThick);
this.grpStitch.Location = new System.Drawing.Point(12, 97);
this.grpStitch.Name = "grpStitch";
this.grpStitch.Size = new System.Drawing.Size(271, 108);
this.grpStitch.TabIndex = 3;
this.grpStitch.TabStop = false;
this.grpStitch.Text = "Stitch drawing";
//
// label4
// chkDrawGrid
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(57, 58);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(67, 13);
this.label4.TabIndex = 11;
this.label4.Text = "Ugly Length:";
this.chkDrawGrid.AutoSize = true;
this.chkDrawGrid.Location = new System.Drawing.Point(9, 81);
this.chkDrawGrid.Name = "chkDrawGrid";
this.chkDrawGrid.Size = new System.Drawing.Size(131, 17);
this.chkDrawGrid.TabIndex = 12;
this.chkDrawGrid.Text = "Draw background grid";
this.chkDrawGrid.UseVisualStyleBackColor = true;
//
// label3
// lblUglyLength
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(168, 58);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(33, 13);
this.label3.TabIndex = 10;
this.label3.Text = "pixels";
this.lblUglyLength.AutoSize = true;
this.lblUglyLength.Location = new System.Drawing.Point(57, 58);
this.lblUglyLength.Name = "lblUglyLength";
this.lblUglyLength.Size = new System.Drawing.Size(67, 13);
this.lblUglyLength.TabIndex = 11;
this.lblUglyLength.Text = "Ugly Length:";
//
// lblPixelLength
//
this.lblPixelLength.AutoSize = true;
this.lblPixelLength.Location = new System.Drawing.Point(168, 58);
this.lblPixelLength.Name = "lblPixelLength";
this.lblPixelLength.Size = new System.Drawing.Size(33, 13);
this.lblPixelLength.TabIndex = 10;
this.lblPixelLength.Text = "pixels";
//
// txtThreshold
//
@ -189,15 +202,25 @@ namespace embroideryReader
this.chkUglyStitches.Text = "Remove \'ugly\' stitches";
this.chkUglyStitches.UseVisualStyleBackColor = true;
//
// chkDrawGrid
// cmbLanguage
//
this.chkDrawGrid.AutoSize = true;
this.chkDrawGrid.Location = new System.Drawing.Point(7, 79);
this.chkDrawGrid.Name = "chkDrawGrid";
this.chkDrawGrid.Size = new System.Drawing.Size(131, 17);
this.chkDrawGrid.TabIndex = 12;
this.chkDrawGrid.Text = "Draw background grid";
this.chkDrawGrid.UseVisualStyleBackColor = true;
this.cmbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbLanguage.FormattingEnabled = true;
this.cmbLanguage.Location = new System.Drawing.Point(14, 19);
this.cmbLanguage.Name = "cmbLanguage";
this.cmbLanguage.Size = new System.Drawing.Size(121, 21);
this.cmbLanguage.TabIndex = 10;
this.cmbLanguage.SelectedIndexChanged += new System.EventHandler(this.cmbLanguage_SelectedIndexChanged);
//
// grpLanguage
//
this.grpLanguage.Controls.Add(this.cmbLanguage);
this.grpLanguage.Location = new System.Drawing.Point(13, 212);
this.grpLanguage.Name = "grpLanguage";
this.grpLanguage.Size = new System.Drawing.Size(270, 56);
this.grpLanguage.TabIndex = 11;
this.grpLanguage.TabStop = false;
this.grpLanguage.Text = "Language";
//
// frmSettingsDialog
//
@ -205,9 +228,10 @@ namespace embroideryReader
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(339, 244);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.ClientSize = new System.Drawing.Size(296, 319);
this.Controls.Add(this.grpLanguage);
this.Controls.Add(this.grpStitch);
this.Controls.Add(this.grpBackground);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@ -216,9 +240,10 @@ namespace embroideryReader
this.Name = "frmSettingsDialog";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "Embroidery Reader Settings";
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.grpBackground.ResumeLayout(false);
this.grpStitch.ResumeLayout(false);
this.grpStitch.PerformLayout();
this.grpLanguage.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -231,15 +256,17 @@ namespace embroideryReader
private System.Windows.Forms.Button btnResetColor;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblThreadThickness;
private System.Windows.Forms.TextBox txtThreadThickness;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblPixelThick;
private System.Windows.Forms.GroupBox grpBackground;
private System.Windows.Forms.GroupBox grpStitch;
private System.Windows.Forms.Label lblPixelLength;
private System.Windows.Forms.TextBox txtThreshold;
private System.Windows.Forms.CheckBox chkUglyStitches;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblUglyLength;
private System.Windows.Forms.CheckBox chkDrawGrid;
private System.Windows.Forms.ComboBox cmbLanguage;
private System.Windows.Forms.GroupBox grpLanguage;
}
}

Wyświetl plik

@ -37,6 +37,8 @@ namespace embroideryReader
{
private bool colorChanged = false;
private EmbroideryReaderSettings settings;
private Translation translation;
public EmbroideryReaderSettings settingsToModify
{
get
@ -117,6 +119,46 @@ namespace embroideryReader
}
settings.drawBackgroundGrid = chkDrawGrid.Checked;
settings.translation = cmbLanguage.SelectedItem.ToString();
}
public Translation setTranslation
{
set
{
translation = value;
loadTranslatedStrings();
foreach (String s in translation.GetAvailableTranslations())
{
cmbLanguage.Items.Add(s);
}
if (cmbLanguage.Items.Count > 0)
{
cmbLanguage.SelectedItem = settings.translation;
}
}
}
private void loadTranslatedStrings()
{
grpBackground.Text = translation.GetTranslatedString(Translation.StringID.BACKGROUND);
lblColor.Text = translation.GetTranslatedString(Translation.StringID.BACKGROUND_COLOR);
btnColor.Text = translation.GetTranslatedString(Translation.StringID.PICK_COLOR);
btnResetColor.Text = translation.GetTranslatedString(Translation.StringID.RESET_COLOR);
grpStitch.Text = translation.GetTranslatedString(Translation.StringID.STITCH_DRAW);
lblThreadThickness.Text = translation.GetTranslatedString(Translation.StringID.THREAD_THICKNESS);
lblPixelThick.Text = translation.GetTranslatedString(Translation.StringID.PIXELS);
chkUglyStitches.Text = translation.GetTranslatedString(Translation.StringID.REMOVE_UGLY_STITCHES);
lblUglyLength.Text = translation.GetTranslatedString(Translation.StringID.UGLY_STITCH_LENGTH);
lblPixelLength.Text = translation.GetTranslatedString(Translation.StringID.PIXELS);
chkDrawGrid.Text = translation.GetTranslatedString(Translation.StringID.DRAW_BACKGROUND_GRID);
}
private void cmbLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
translation.Load(cmbLanguage.SelectedItem.ToString());
loadTranslatedStrings();
}
}
}

Wyświetl plik

@ -1,23 +1,15 @@
UPDATE_LOCATION=update location
BACKGROUND_COLOR=background color
ENABLED=enabled
RED=red
GREEN=green
BLUE=blue
FILTER_STITCHES=filter stitches
FILTER_STTCHES_THRESHOLD=filter stitches threshold
THREAD_THICKNESS=thread thickness
LAST_OPEN=last open file folder
LAST_SAVElast save image location
WINDOW_WIDTH=window width
WINDOW_HEIGHT=window height
YES=yes
# English language strings file. To translate Embroidery Reader to a new
# language, copy this file to a new name and translate each string.
# If you make a new translation, please contact me! I'd love to
# include your translation with Embroidery Reader.
# The best way to contact me is through http://www.njcrawford.com/contact/.
UNSUPPORTED_FORMAT=The format of this file is not completely supported
COLOR_WARNING=The format of this file is not completely supported
COLOR_WARNING=Colors shown for this design may be inaccurate
ERROR_FILE=An error occured while reading the file:
CORRUPT_FILE=This file is either corrupt or not a valid PES file.
FILE_TYPES=Embroidery Files (*.pes)|*.pes|All Files (*.*)|*.*
VERSION_MESSAGE=EmbroideryReader version
FILE_TYPE_PES=Embroidery Files
FILE_TYPE_ALL=All Files
ABOUT_MESSAGE=EmbroideryReader version {0}. This program reads and displays embroidery designs from .PES files.
ERROR_UPDATE=Encountered an error while checking for updates:
VERSION=Version
ERROR_WEBPAGE=An error occured while trying to open the webpage:
@ -25,8 +17,13 @@ NO_UPDATE=No updates are available right now.
ERROR_DEBUG=There was an error while saving debug info:
NO_DESIGN=No design loaded.
UNSUPPORTED_CLASS=This file contains a class that is not yet supported
IMAGE_FILE_TYPES=Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif|All Files (*.*)|*.*
FILE_TYPE_BMP=Bitmap
FILE_TYPE_PNG=PNG
FILE_TYPE_JPG=JPEG
FILE_TYPE_GIF=GIF
FILE_TYPE_TIFF=TIFF
IMAGE_SAVED=Image saved
MENU_FILE=File
MENU_OPEN=Open...
MENU_SAVE_IMAGE=Save as image...
MENU_PRINT=Print...
@ -38,12 +35,12 @@ MENU_PREFS=Preferences...
MENU_VIEW=View
ROTATE_LEFT=Rotate left
ROTATE_RIGHT=Rotate right
RESET=Reset
HELP=Help
MENU_RESET=Reset / Refresh
MENU_HELP=Help
CHECK_UPDATE=Check for update
SAVE_DEBUG=Save design debug info
SHOW_DEBUG=Show design debug info
ABOUT=About
MENU_ABOUT=About
PICK_COLOR=Pick Color...
BACKGROUND_COLOR=Background Color
RESET_COLOR=Reset Color
@ -55,8 +52,9 @@ STITCH_DRAW=Stitch drawing
REMOVE_UGLY_STITCHES=Remove 'ugly' stitches
UGLY_STITCH_LENGTH=Ugly Length:
SETTINGS=Embroidery Reader Settings
LATEST_VERSION=Latest versoin is
INSTALLED_VERSION=you have version
ABOUT_APP=This program reads and displays embroidery designs from .PES files
NEW_VERSION_MESSAGE="Version " + updater.VersionAvailable() + " was released on " + updater.getReleaseDate().ToShortDateString() + "." + Environment.NewLine + "You have version " + currentVersion() + ". Would you like to go to the Embroidery Reader website to download or find out more about the new version?"
LATEST_VERSION=(Latest version is {0}, you have version {1})
NEW_VERSION_MESSAGE=Version {0} was released on {1}. You have version {2}.
NEW_VERSION_QUESTION=Would you like to go to the Embroidery Reader website to download or find out more about the new version?
NEW_VERSION_TITLE=New version available
DEBUG_INFO_SAVED=Saved debug info to {0}
DRAW_BACKGROUND_GRID=Draw background grid

Wyświetl plik

@ -1,22 +1,7 @@
UPDATE_LOCATION=posizione dell'aggiornamento
BACKGROUND_COLOR=colore di sfondo
ENABLED=abilitato
RED=rosso
GREEN=verde
BLUE=blu
FILTER_STITCHES=filtra punti di ricamo
FILTER_STTCHES_THRESHOLD=filtra soglia punti di ricamo
THREAD_THICKNESS=spessore del filo
LAST_OPEN=cartella dell'ultimo file aperto
LAST_SAVElast save image location=posizione dell'ultima immagine salvata
WINDOW_WIDTH=larghezza della finestra
WINDOW_HEIGHT=altezza della finestra
YES=
UNSUPPORTED_FORMAT=Il formato di questo file non è pienamente supportato
UNSUPPORTED_FORMAT=Il formato di questo file non è pienamente supportato
COLOR_WARNING=I colori mostrati per questo progetto potrebbero non essere precisi
ERROR_FILE=Si è verificato un errore durante la lettura del file:
CORRUPT_FILE=Questo file è corrotto oppure non è un file PES valido.
FILE_TYPES=Files Embroidery (*.pes)|*.pes|Tutti i File (*.*)|*.*
VERSION_MESSAGE=Versione EmbroideryReader
ERROR_UPDATE=Si è verificato un errore durante il controllo degli aggiornamenti:
VERSION=Versione
@ -25,8 +10,15 @@ NO_UPDATE=Nessun aggiornamento disponibile al momento.
ERROR_DEBUG=Si è verificato un errore durante il salvataggio delle informazioni di debug:
NO_DESIGN=Nessun progetto caricato.
UNSUPPORTED_CLASS=Questo file contiene una classe che non è ancora supportata
IMAGE_FILE_TYPES=Bitmap (*.bmp)|*.bmp|PNG (*.png)|*.png|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif|Tutti i File (*.*)|*.*
FILE_TYPE_PES=Files Embroidery
FILE_TYPE_ALL=Tutti i File
FILE_TYPE_BMP=Bitmap
FILE_TYPE_PNG=PNG
FILE_TYPE_JPG=JPEG
FILE_TYPE_GIF=GIF
FILE_TYPE_TIFF=TIFF
IMAGE_SAVED=Immagine salvata
MENU_FILE=File
MENU_OPEN=Apri...
MENU_SAVE_IMAGE=Salva come immagine...
MENU_PRINT=Stampa...
@ -38,12 +30,12 @@ MENU_PREFS=Preferenze...
MENU_VIEW=Visualizza
ROTATE_LEFT=Ruota a destra
ROTATE_RIGHT=Ruota a sinistra
RESET=Reimposta
HELP=Aiuto
MENU_RESET=Reimposta
MENU_HELP=Aiuto
CHECK_UPDATE=Controlla aggiornamenti
SAVE_DEBUG=Salva le informazioni di debug del progetto
SHOW_DEBUG=Mostra le informazioni di debug del progetto
ABOUT=Informazioni su...
MENU_ABOUT=Informazioni su...
PICK_COLOR=Scegli colore...
BACKGROUND_COLOR=Colore di sfondo
RESET_COLOR=Reimposta colore
@ -55,10 +47,9 @@ STITCH_DRAW=Tracciamento dei punti di ricamo
REMOVE_UGLY_STITCHES=Rimuovi i punti di ricamo 'orrendi'
UGLY_STITCH_LENGTH=Lunghezza di un punto orrendo:
SETTINGS=Impostazioni di Embroidery Reader
LATEST_VERSION=L'ultima versione è la
INSTALLED_VERSION=stai utilizzando la versione
ABOUT_APP=Questo programma legge e visualizza progetti di ricamo da files .PES
LATEST_VERSION=(L'ultima versione è la {0}, stai utilizzando la versione {1})
NEW_VERSION_MESSAGE=Il {2} è stata rilasciata la versione {1}.
Stai utilizzando la versione {3}.
NEW_VERSION_QUESTION=Vuoi andare al sito di Embroidery Reader per scaricare la nuova versione o per saperne di più?
NEW_VERSION_TITLE=Nuova versione disponibile
ABOUT_MESSAGE=Versione Embroidery Reader {0}. Questo programma legge e visualizza progetti di ricamo da files .PES

Plik binarny nie jest wyświetlany.