diff --git a/ShareX/Enums.cs b/ShareX/Enums.cs
index bf7947fee..ff86a988a 100644
--- a/ShareX/Enums.cs
+++ b/ShareX/Enums.cs
@@ -63,6 +63,8 @@ public enum SupportedLanguage
Korean,
[Description("Español mexicano (Mexican Spanish)")]
MexicanSpanish,
+ [Description("فارسی (Persian)")]
+ Persian,
[Description("Português-Brasil (Portuguese-Brazil)")]
PortugueseBrazil,
[Description("Русский (Russian)")]
@@ -78,9 +80,7 @@ public enum SupportedLanguage
[Description("Українська (Ukrainian)")]
Ukrainian,
[Description("Tiếng Việt (Vietnamese)")]
- Vietnamese,
- [Description("فارسی (Iran)")]
- Persian
+ Vietnamese
}
public enum TaskJob
diff --git a/ShareX/LanguageHelper.cs b/ShareX/LanguageHelper.cs
index f3106f1ae..16ffd4235 100644
--- a/ShareX/LanguageHelper.cs
+++ b/ShareX/LanguageHelper.cs
@@ -104,6 +104,9 @@ public static Image GetLanguageIcon(SupportedLanguage language)
case SupportedLanguage.MexicanSpanish:
icon = Resources.mx;
break;
+ case SupportedLanguage.Persian:
+ icon = Resources.ir;
+ break;
case SupportedLanguage.PortugueseBrazil:
icon = Resources.br;
break;
@@ -128,9 +131,6 @@ public static Image GetLanguageIcon(SupportedLanguage language)
case SupportedLanguage.Vietnamese:
icon = Resources.vn;
break;
- case SupportedLanguage.Persian:
- icon = Resources.IR;
- break;
}
return icon;
@@ -170,6 +170,9 @@ public static string GetCultureName(SupportedLanguage language)
case SupportedLanguage.MexicanSpanish:
cultureName = "es-MX";
break;
+ case SupportedLanguage.Persian:
+ cultureName = "fa-IR";
+ break;
case SupportedLanguage.PortugueseBrazil:
cultureName = "pt-BR";
break;
@@ -194,9 +197,6 @@ public static string GetCultureName(SupportedLanguage language)
case SupportedLanguage.Vietnamese:
cultureName = "vi-VN";
break;
- case SupportedLanguage.Persian:
- cultureName = "fa-IR";
- break;
}
return cultureName;
diff --git a/ShareX/Program.cs b/ShareX/Program.cs
index c26b2e2c9..8e358dbfe 100644
--- a/ShareX/Program.cs
+++ b/ShareX/Program.cs
@@ -234,10 +234,16 @@ public static string ScreenshotsFolder
[STAThread]
private static void Main(string[] args)
{
-#if !DEBUG // Allow Visual Studio to break on exceptions in Debug builds.
+ // Allow Visual Studio to break on exceptions in Debug builds
+#if !DEBUG
+ // Add the event handler for handling UI thread exceptions to the event
Application.ThreadException += Application_ThreadException;
- AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
+
+ // Set the unhandled exception mode to force all Windows Forms errors to go through our handler
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+
+ // Add the event handler for handling non-UI thread exceptions to the event
+ AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
#endif
StartTimer = Stopwatch.StartNew(); // For be able to show startup time
diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs
index a9569e3ba..d004a1a81 100644
--- a/ShareX/Properties/Resources.Designer.cs
+++ b/ShareX/Properties/Resources.Designer.cs
@@ -1571,9 +1571,9 @@ public static string IntegrationHelpers_UploadWithShareX {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- public static System.Drawing.Bitmap IR {
+ public static System.Drawing.Bitmap ir {
get {
- object obj = ResourceManager.GetObject("IR", resourceCulture);
+ object obj = ResourceManager.GetObject("ir", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx
index 248e73413..47bf9ae04 100644
--- a/ShareX/Properties/Resources.resx
+++ b/ShareX/Properties/Resources.resx
@@ -1024,7 +1024,7 @@ Middle click to close
Switch to list view
-
- ..\Resources\IR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\ir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
\ No newline at end of file
diff --git a/ShareX/Resources/IR.png b/ShareX/Resources/IR.png
deleted file mode 100644
index 41468e062..000000000
Binary files a/ShareX/Resources/IR.png and /dev/null differ
diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj
index 98ebe1da8..612683513 100644
--- a/ShareX/ShareX.csproj
+++ b/ShareX/ShareX.csproj
@@ -1668,7 +1668,7 @@
-
+