Improve tranlsation support

Move lines to resx
This commit is contained in:
L1Q 2019-04-04 22:22:16 +03:00
parent e3e54bf720
commit c62d8556c6
11 changed files with 98 additions and 11 deletions

View file

@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.MediaLib.Properties;
using System;
using System.Drawing;
using System.IO;
@ -182,8 +183,7 @@ private void btnGenerate_Click(object sender, EventArgs e)
}
Cursor = Cursors.Default;
// TODO: Translate
MessageBox.Show("Thumbnails successfully generated.", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Resources.ThumbnailsSuccessfullyGenerated, Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{

View file

@ -60,6 +60,15 @@ internal Resources() {
}
}
/// <summary>
/// Looks up a localized string similar to Thumbnails successfully generated..
/// </summary>
internal static string ThumbnailsSuccessfullyGenerated {
get {
return ResourceManager.GetString("ThumbnailsSuccessfullyGenerated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Browse for media file.
/// </summary>

View file

@ -101,4 +101,7 @@
<data name="VideoThumbnailerForm_btnBrowse_Click_Browse_for_media_file" xml:space="preserve">
<value>Browse for media file</value>
</data>
<data name="ThumbnailsSuccessfullyGenerated" xml:space="preserve">
<value>Thumbnails successfully generated.</value>
</data>
</root>

View file

@ -480,8 +480,7 @@ private void CheckDataGridView(DataGridView dgv, bool checkDuplicate)
if (isDuplicate)
{
// TODO: Translate
cell.ErrorText = "Duplicate name not allowed.";
cell.ErrorText = Resources.DuplicateNameNotAllowed;
}
else
{

View file

@ -186,6 +186,15 @@ internal static System.Drawing.Icon Dropbox {
}
}
/// <summary>
/// Looks up a localized string similar to Duplicate name not allowed..
/// </summary>
internal static string DuplicateNameNotAllowed {
get {
return ResourceManager.GetString("DuplicateNameNotAllowed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>

View file

@ -401,4 +401,7 @@ Created folders:</value>
<data name="Teknik" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Favicons\Teknik.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DuplicateNameNotAllowed" xml:space="preserve">
<value>Duplicate name not allowed.</value>
</data>
</root>

View file

@ -224,7 +224,7 @@ private void ChangeLanguage(SupportedLanguage language)
if (LanguageHelper.ChangeLanguage(Program.Settings.Language) &&
MessageBox.Show(Resources.ApplicationSettingsForm_cbLanguage_SelectedIndexChanged_Language_Restart,
"ShareX - Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
Resources.ShareXConfirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Program.Restart();
}
@ -502,9 +502,8 @@ private void btnPersonalFolderPathApply_Click(object sender, EventArgs e)
{
lastPersonalPath = currentPersonalPath;
btnPersonalFolderPathApply.Enabled = false;
// TODO: Translate
if (MessageBox.Show("ShareX needs to be restarted for the personal folder changes to apply.\r\n\r\nWould you like to restart ShareX?", "ShareX - Confirmation",
if (MessageBox.Show(Resources.ShareXNeedsToBeRestartedForThePersonalFolderChangesToApply, Resources.ShareXConfirmation,
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Program.Restart();

View file

@ -1073,7 +1073,7 @@ private void SetScreenshotDelay(decimal delay)
break;
}
tsmiScreenshotDelay.Text = tsmiTrayScreenshotDelay.Text = string.Format("Screenshot delay: {0}s", delay.ToString("0.#"));
tsmiScreenshotDelay.Text = tsmiTrayScreenshotDelay.Text = string.Format(Resources.ScreenshotDelay0S, delay.ToString("0.#"));
tsmiScreenshotDelay.Checked = tsmiTrayScreenshotDelay.Checked = delay > 0;
}

View file

@ -1944,6 +1944,16 @@ public static System.Drawing.Bitmap pipette {
}
}
/// <summary>
/// Looks up a localized string similar to Please note that ShareX is using OCR.Space&apos;s online API to perform optical character recognition. Do you give permission to ShareX to upload images to this service?.
/// </summary>
public static string PleaseNoteThatShareXIsUsingOCRSpaceSOnlineAPIToPerformOpticalCharacterRecognitionDoYouGivePermissionToShareXToUploadImagesToThisService {
get {
return ResourceManager.GetString("PleaseNoteThatShareXIsUsingOCRSpaceSOnlineAPIToPerformOpticalCharacterRecognition" +
"DoYouGivePermissionToShareXToUploadImagesToThisService", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -2169,6 +2179,15 @@ public static string ScreenRecordForm_StartRecording_Waiting___ {
}
}
/// <summary>
/// Looks up a localized string similar to Screenshot delay: {0}s.
/// </summary>
public static string ScreenshotDelay0S {
get {
return ResourceManager.GetString("ScreenshotDelay0S", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -2179,6 +2198,35 @@ public static System.Drawing.Bitmap script__minus {
}
}
/// <summary>
/// Looks up a localized string similar to ShareX - Confirmation.
/// </summary>
public static string ShareXConfirmation {
get {
return ResourceManager.GetString("ShareXConfirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ShareX needs to be restarted for the personal folder changes to apply.
///
///Would you like to restart ShareX?.
/// </summary>
public static string ShareXNeedsToBeRestartedForThePersonalFolderChangesToApply {
get {
return ResourceManager.GetString("ShareXNeedsToBeRestartedForThePersonalFolderChangesToApply", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ShareX - Optical character recognition.
/// </summary>
public static string ShareXOpticalCharacterRecognition {
get {
return ResourceManager.GetString("ShareXOpticalCharacterRecognition", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -986,4 +986,21 @@ Middle click to close</value>
<data name="SupportUs_Button_02" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SupportUs_Button_02.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ShareXNeedsToBeRestartedForThePersonalFolderChangesToApply" xml:space="preserve">
<value>ShareX needs to be restarted for the personal folder changes to apply.
Would you like to restart ShareX?</value>
</data>
<data name="ShareXConfirmation" xml:space="preserve">
<value>ShareX - Confirmation</value>
</data>
<data name="ScreenshotDelay0S" xml:space="preserve">
<value>Screenshot delay: {0}s</value>
</data>
<data name="PleaseNoteThatShareXIsUsingOCRSpaceSOnlineAPIToPerformOpticalCharacterRecognitionDoYouGivePermissionToShareXToUploadImagesToThisService" xml:space="preserve">
<value>Please note that ShareX is using OCR.Space's online API to perform optical character recognition. Do you give permission to ShareX to upload images to this service?</value>
</data>
<data name="ShareXOpticalCharacterRecognition" xml:space="preserve">
<value>ShareX - Optical character recognition</value>
</data>
</root>

View file

@ -1153,8 +1153,8 @@ private static async Task OCRImage(Stream stream, string fileName, string filePa
if (!ocrOptions.Permission)
{
if (MessageBox.Show("Please note that ShareX is using OCR.Space's online API to perform optical character recognition. Do you give permission to ShareX to upload images to this service?",
"ShareX - Optical character recognition", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (MessageBox.Show(Resources.PleaseNoteThatShareXIsUsingOCRSpaceSOnlineAPIToPerformOpticalCharacterRecognitionDoYouGivePermissionToShareXToUploadImagesToThisService,
Resources.ShareXOpticalCharacterRecognition, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
taskSettings.CaptureSettingsReference.OCROptions.Permission = true;
}