From 8a4afdbdfcf7188cd13f0e9795ddffe39f5107c4 Mon Sep 17 00:00:00 2001 From: L1Q <0xL1Q@ex.ua> Date: Sun, 13 May 2018 06:19:16 +0300 Subject: [PATCH] Improve translation support - resize color picker form for better compatibility - move strings to resources - mark strings invariant --- ShareX.HelpersLib/Colors/ColorPickerForm.resx | 238 +++++++++--------- .../Forms/RegionCaptureForm.cs | 3 +- .../Properties/Resources.Designer.cs | 19 ++ .../Properties/Resources.resx | 7 + ShareX/Forms/ApplicationSettingsForm.cs | 5 +- ShareX/IntegrationHelpers.cs | 2 +- ShareX/Properties/Resources.Designer.cs | 27 ++ ShareX/Properties/Resources.resx | 9 + 8 files changed, 188 insertions(+), 122 deletions(-) diff --git a/ShareX.HelpersLib/Colors/ColorPickerForm.resx b/ShareX.HelpersLib/Colors/ColorPickerForm.resx index cadfb1e2f..8282e63c3 100644 --- a/ShareX.HelpersLib/Colors/ColorPickerForm.resx +++ b/ShareX.HelpersLib/Colors/ColorPickerForm.resx @@ -123,10 +123,10 @@ - 560, 288 + 582, 288 - 72, 32 + 94, 32 @@ -154,7 +154,7 @@ 480, 288 - 72, 32 + 94, 32 0 @@ -235,7 +235,7 @@ 25 - 560, 174 + 604, 174 9 @@ -295,7 +295,7 @@ 27 - 560, 142 + 604, 142 56, 20 @@ -319,7 +319,7 @@ 28 - 560, 108 + 604, 108 56, 20 @@ -343,7 +343,7 @@ 29 - 560, 78 + 604, 78 56, 20 @@ -367,7 +367,7 @@ 30 - 560, 46 + 604, 46 56, 20 @@ -964,7 +964,7 @@ 20 - 560, 204 + 604, 204 72, 20 @@ -1000,7 +1000,7 @@ NoControl - 618, 50 + 662, 50 19, 13 @@ -1033,7 +1033,7 @@ NoControl - 618, 82 + 662, 82 19, 13 @@ -1066,7 +1066,7 @@ NoControl - 618, 112 + 662, 112 19, 13 @@ -1099,7 +1099,7 @@ NoControl - 618, 146 + 662, 146 19, 13 @@ -1123,7 +1123,7 @@ 15 - 560, 14 + 604, 14 48, 20 @@ -1179,33 +1179,6 @@ 17, 17 - - NoControl - - - 612, 13 - - - 23, 23 - - - 39 - - - Transparent - - - cbTransparent - - - ShareX.HelpersLib.ColorButton, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 5 - 104, 17 @@ -1456,10 +1429,10 @@ NoControl - 560, 288 + 582, 288 - 72, 32 + 94, 32 43 @@ -1479,81 +1452,12 @@ 2 - - NoControl - - - 472, 288 - - - 80, 32 - - - 40 - - - Copy - - - mbCopy - - - ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 4 - - - 376, 208 - - - 80, 56 - - - 38 - - - pbColorPreview - - - ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 12 - - - True - - - 8, 8 - - - 292, 261 - - - 2 - - - colorPicker - - - ShareX.HelpersLib.ColorPicker, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null - - - $this - - - 21 - True + + NoControl + -3, 0 @@ -1620,6 +1524,105 @@ 1 + + NoControl + + + 472, 288 + + + 102, 32 + + + 40 + + + Copy + + + mbCopy + + + ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 4 + + + NoControl + + + 656, 13 + + + 23, 23 + + + 39 + + + Transparent + + + cbTransparent + + + ShareX.HelpersLib.ColorButton, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 5 + + + 376, 208 + + + 80, 56 + + + 38 + + + pbColorPreview + + + ShareX.HelpersLib.MyPictureBox, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 12 + + + True + + + 8, 8 + + + 292, 261 + + + 2 + + + colorPicker + + + ShareX.HelpersLib.ColorPicker, ShareX.HelpersLib, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 21 + True @@ -1627,7 +1630,10 @@ 6, 13 - 640, 328 + 684, 328 + + + NoControl CenterScreen diff --git a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs index c0683b386..79559960d 100644 --- a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs @@ -512,8 +512,7 @@ internal bool ShowExitConfirmation() if (ShapeManager != null && ShapeManager.IsAnnotated) { Pause(); - // TODO: Translate - result = MessageBox.Show(this, "There is unsaved changes.\r\nWould you like to close image editor?", "ShareX - Image editor", + result = MessageBox.Show(this, Resources.RegionCaptureForm_ShowExitConfirmation_Text, Resources.RegionCaptureForm_ShowExitConfirmation_ShareXImageEditor, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes; Resume(); } diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs index 72596c966..044d0919e 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs +++ b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs @@ -901,6 +901,25 @@ internal static string RegionCaptureForm_InitializeComponent_ImageEditor { } } + /// + /// Looks up a localized string similar to ShareX - Image editor. + /// + internal static string RegionCaptureForm_ShowExitConfirmation_ShareXImageEditor { + get { + return ResourceManager.GetString("RegionCaptureForm_ShowExitConfirmation_ShareXImageEditor", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are unsaved changes. + ///Would you like to close image editor?. + /// + internal static string RegionCaptureForm_ShowExitConfirmation_Text { + get { + return ResourceManager.GetString("RegionCaptureForm_ShowExitConfirmation_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to Tip: You can pan image by holding mouse middle button and dragging.. /// diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.resx b/ShareX.ScreenCaptureLib/Properties/Resources.resx index 4cb616303..1b2ea3d6b 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.resx +++ b/ShareX.ScreenCaptureLib/Properties/Resources.resx @@ -621,4 +621,11 @@ X: {4} Y: {5} ..\Resources\layout-center.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + There are unsaved changes. +Would you like to close image editor? + + + ShareX - Image editor + \ No newline at end of file diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index 04e95f514..8bf7883da 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -395,8 +395,7 @@ private void cbCheckPreReleaseUpdates_CheckedChanged(object sender, EventArgs e) private void btnCheckDevBuild_Click(object sender, EventArgs e) { - // TODO: Translate - if (MessageBox.Show("Dev builds can be unstable and must be used for testing purposes only. Do you want to install it?", "ShareX", + if (MessageBox.Show(Resources.ApplicationSettingsForm_btnCheckDevBuild_Click_DevBuilds_Warning, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { TaskHelpers.DownloadAppVeyorBuild(); @@ -618,7 +617,7 @@ private void btnImport_Click(object sender, EventArgs e) private void btnResetSettings_Click(object sender, EventArgs e) { - if (MessageBox.Show("Would you like to reset ShareX settings?", "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) + if (MessageBox.Show(Resources.ApplicationSettingsForm_btnResetSettings_Click_WouldYouLikeToResetShareXSettings, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { SettingManager.ResetSettings(); SettingManager.SaveAllSettings(); diff --git a/ShareX/IntegrationHelpers.cs b/ShareX/IntegrationHelpers.cs index 52bb92d96..79869221c 100644 --- a/ShareX/IntegrationHelpers.cs +++ b/ShareX/IntegrationHelpers.cs @@ -53,7 +53,7 @@ public static class IntegrationHelpers private static readonly string ShellExtEditName = "ShareXImageEditor"; private static readonly string ShellExtEditImage = $@"Software\Classes\SystemFileAssociations\image\shell\{ShellExtEditName}"; private static readonly string ShellExtEditImageCmd = $@"{ShellExtEditImage}\command"; - private static readonly string ShellExtEditDesc = "Edit with ShareX"; // TODO: Translate + private static readonly string ShellExtEditDesc = Resources.IntegrationHelpers_EditWithShareX; private static readonly string ShellExtEditIcon = $"{ApplicationPath},0"; private static readonly string ShellExtEditPath = $"{ApplicationPath} -ImageEditor \"%1\""; diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index 0a65d3e24..7dcab6447 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -454,6 +454,24 @@ public static string ApplicationSettingsForm_btnBrowsePersonalFolderPath_Click_C } } + /// + /// Looks up a localized string similar to Dev builds can be unstable and must be used for testing purposes only. Do you want to install it?. + /// + public static string ApplicationSettingsForm_btnCheckDevBuild_Click_DevBuilds_Warning { + get { + return ResourceManager.GetString("ApplicationSettingsForm_btnCheckDevBuild_Click_DevBuilds_Warning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Would you like to reset ShareX settings?. + /// + public static string ApplicationSettingsForm_btnResetSettings_Click_WouldYouLikeToResetShareXSettings { + get { + return ResourceManager.GetString("ApplicationSettingsForm_btnResetSettings_Click_WouldYouLikeToResetShareXSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to ShareX needs to be restarted for the language changes to apply. ///Would you like to restart ShareX?. @@ -1504,6 +1522,15 @@ public static System.Drawing.Bitmap information { } } + /// + /// Looks up a localized string similar to Edit with ShareX. + /// + public static string IntegrationHelpers_EditWithShareX { + get { + return ResourceManager.GetString("IntegrationHelpers_EditWithShareX", resourceCulture); + } + } + /// /// Looks up a localized string similar to Upload with ShareX. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index 72e62dbd0..9ec4e6643 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -970,4 +970,13 @@ Middle click to close ..\Resources\id.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Edit with ShareX + + + Dev builds can be unstable and must be used for testing purposes only. Do you want to install it? + + + Would you like to reset ShareX settings? + \ No newline at end of file