-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Italian language support for the LessMSI GUI app (#205)
closes #203 * added English strings for the main form * added Italian texts to the main page * added Italian texts to the tabs section in main page * Added Italian text for error messages * Added Italian text for preferences form * Added Italian texts for the about window * Added final Italian texts for preferences form * Added final Italian texts for about form * Stopped tracking aboutbox.rtf file * added final Italian texts to GUI app * Deleted aboutbox.rtf file * Changed AboutBoxFilePath member to be a local variable * Amended locale strings values according to Scott’s comments * Deleted the Strings.it.Designer.cs file * Added GUI tests that check GUI strings in different locale settings * Unified locale tests into one to avoid issues while changing locale settings * Changing CurrentCulture variable as part of the locale change * Deleted unnecessary using statement * Reverted AboutBox logic to original implementation * added Copyright text * fix: build culture resources in gui project in msbuild * fix: build the gui resources for it lang in msbuild * fix: adds resources to the zip file in the culture-specific subdir in msbuild --------- Co-authored-by: Scott Willeke <[email protected]>
- Loading branch information
1 parent
82d6669
commit 18356d0
Showing
15 changed files
with
1,443 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,121 +1,120 @@ | ||
using LessMsi.Gui.Properties; | ||
using System; | ||
using System; | ||
using System.Diagnostics; | ||
using System.Reflection; | ||
using System.Windows.Forms; | ||
|
||
namespace LessMsi.Gui | ||
{ | ||
partial class AboutBox : Form | ||
{ | ||
public AboutBox() | ||
{ | ||
InitializeComponent(); | ||
this.Text = String.Format("About {0}", AssemblyTitle); | ||
this.labelProductName.Text = AssemblyProduct; | ||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); | ||
this.labelCopyright.Text = AssemblyCopyright; | ||
|
||
Icon = Resources.LessmsiIcon; | ||
} | ||
|
||
#region Assembly Attribute Accessors | ||
|
||
public string AssemblyTitle | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); | ||
if (attributes.Length > 0) | ||
{ | ||
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; | ||
if (titleAttribute.Title != "") | ||
{ | ||
return titleAttribute.Title; | ||
} | ||
} | ||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); | ||
} | ||
} | ||
|
||
public string AssemblyVersion | ||
{ | ||
get | ||
{ | ||
return Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||
} | ||
} | ||
|
||
public string AssemblyDescription | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyDescriptionAttribute)attributes[0]).Description; | ||
} | ||
} | ||
|
||
public string AssemblyProduct | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyProductAttribute)attributes[0]).Product; | ||
} | ||
} | ||
|
||
public string AssemblyCopyright | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; | ||
} | ||
} | ||
|
||
public string AssemblyCompany | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCompanyAttribute)attributes[0]).Company; | ||
} | ||
} | ||
#endregion | ||
|
||
private void AboutBox_Load(object sender, EventArgs e) | ||
{ | ||
var aboutRtf = GetType().Assembly.GetManifestResourceStream(GetType(), "aboutbox.rtf"); | ||
Debug.Assert(aboutRtf != null, "Failed to load aboutbox.rtf"); | ||
this.richTextBox.LoadFile(aboutRtf, RichTextBoxStreamType.RichText); | ||
} | ||
|
||
private void richTextBox_LinkClicked(object sender, LinkClickedEventArgs e) | ||
{ | ||
Process.Start(e.LinkText); | ||
} | ||
|
||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) | ||
{ | ||
namespace LessMsi.Gui | ||
{ | ||
partial class AboutBox : Form | ||
{ | ||
public AboutBox() | ||
{ | ||
InitializeComponent(); | ||
this.Text = String.Format("About {0}", AssemblyTitle); | ||
this.labelProductName.Text = AssemblyProduct; | ||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); | ||
this.labelCopyright.Text = $"Copyright Scott Willeke © 2004-{DateTime.Now.Year}"; | ||
|
||
Icon = Properties.Resources.LessmsiIcon; | ||
} | ||
|
||
#region Assembly Attribute Accessors | ||
|
||
public string AssemblyTitle | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); | ||
if (attributes.Length > 0) | ||
{ | ||
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; | ||
if (titleAttribute.Title != "") | ||
{ | ||
return titleAttribute.Title; | ||
} | ||
} | ||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); | ||
} | ||
} | ||
|
||
public string AssemblyVersion | ||
{ | ||
get | ||
{ | ||
return Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||
} | ||
} | ||
|
||
public string AssemblyDescription | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyDescriptionAttribute)attributes[0]).Description; | ||
} | ||
} | ||
|
||
public string AssemblyProduct | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyProductAttribute)attributes[0]).Product; | ||
} | ||
} | ||
|
||
public string AssemblyCopyright | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; | ||
} | ||
} | ||
|
||
public string AssemblyCompany | ||
{ | ||
get | ||
{ | ||
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); | ||
if (attributes.Length == 0) | ||
{ | ||
return ""; | ||
} | ||
return ((AssemblyCompanyAttribute)attributes[0]).Company; | ||
} | ||
} | ||
#endregion | ||
|
||
private void AboutBox_Load(object sender, EventArgs e) | ||
{ | ||
var aboutRtf = GetType().Assembly.GetManifestResourceStream(GetType(), "aboutbox.rtf"); | ||
Debug.Assert(aboutRtf != null, "Failed to load aboutbox.rtf"); | ||
this.richTextBox.LoadFile(aboutRtf, RichTextBoxStreamType.RichText); | ||
} | ||
|
||
private void richTextBox_LinkClicked(object sender, LinkClickedEventArgs e) | ||
{ | ||
Process.Start(e.LinkText); | ||
} | ||
|
||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) | ||
{ | ||
var text = ((LinkLabel) sender).Text; | ||
var link = text.Substring(e.Link.Start, e.Link.Length); | ||
Process.Start(link); | ||
} | ||
} | ||
var link = text.Substring(e.Link.Start, e.Link.Length); | ||
Process.Start(link); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.