Skip to content

Commit b7aafa0

Browse files
committed
Refactoring: renamed various localization strings to better match their intended purpose.
1 parent de24ea3 commit b7aafa0

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

src/mhed/AppStrings.Designer.cs

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/mhed/AppStrings.resx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="AHE_ExceptionDetected" xml:space="preserve">
120+
<data name="AHE_HostsLoadParseError" xml:space="preserve">
121121
<value>Warning! A parsing error was encountered. The file {0} was probably loaded with errors.</value>
122122
</data>
123-
<data name="AHE_HMessg" xml:space="preserve">
123+
<data name="AHE_HostsLocation" xml:space="preserve">
124124
<value>The active Hosts file is located in {0}. Show it in file manager?</value>
125125
</data>
126-
<data name="AHE_NoFileDetected" xml:space="preserve">
126+
<data name="AHE_HostsNotFound" xml:space="preserve">
127127
<value>The Hosts file {0} couldn't be found!</value>
128128
</data>
129-
<data name="AHE_RestDef" xml:space="preserve">
129+
<data name="AHE_RestoreDefaultsQuestion" xml:space="preserve">
130130
<value>Restore default Hosts file?</value>
131131
</data>
132132
<data name="AHE_Saved" xml:space="preserve">
133133
<value>Hosts file saved successfully!</value>
134134
</data>
135-
<data name="AHE_SaveException" xml:space="preserve">
135+
<data name="AHE_SaveError" xml:space="preserve">
136136
<value>Warning! An error occurred while writing to file {0}. Maybe you don't have enough rights to do this, or someone is blocking write attempts.</value>
137137
</data>
138138
<data name="AHE_NoAdminRights" xml:space="preserve">
@@ -249,7 +249,7 @@
249249
<data name="AHE_Exported" xml:space="preserve">
250250
<value>Hosts file has been successfully exported!</value>
251251
</data>
252-
<data name="AHE_ExportException" xml:space="preserve">
252+
<data name="AHE_ExportError" xml:space="preserve">
253253
<value>Warning! An error occurred while exporting to file. Maybe you don't have enough rights to do this, or someone is blocking write attempts.</value>
254254
</data>
255255
<data name="AHE_Imported" xml:space="preserve">
@@ -258,7 +258,7 @@
258258
<data name="AHE_ImportFileNotFound" xml:space="preserve">
259259
<value>The selected file to import was not found!</value>
260260
</data>
261-
<data name="AHE_ImportFileException" xml:space="preserve">
261+
<data name="AHE_ImportError" xml:space="preserve">
262262
<value>An error occurred while importing the selected file!</value>
263263
</data>
264264
<data name="AHE_ClipboardNonComment" xml:space="preserve">

src/mhed/AppStrings.ru.resx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="AHE_ExceptionDetected" xml:space="preserve">
120+
<data name="AHE_HostsLoadParseError" xml:space="preserve">
121121
<value>Во время открытия файла {0} произошла ошибка. Он мог быть загружен некорректно!</value>
122122
</data>
123-
<data name="AHE_HMessg" xml:space="preserve">
123+
<data name="AHE_HostsLocation" xml:space="preserve">
124124
<value>Активный файл Hosts расположен в {0}. Показать его в файловом менеджере?</value>
125125
</data>
126-
<data name="AHE_NoFileDetected" xml:space="preserve">
126+
<data name="AHE_HostsNotFound" xml:space="preserve">
127127
<value>Файл Hosts по пути {0} не найден!</value>
128128
</data>
129-
<data name="AHE_RestDef" xml:space="preserve">
129+
<data name="AHE_RestoreDefaultsQuestion" xml:space="preserve">
130130
<value>Восстановить стандартные значения файла Hosts?</value>
131131
</data>
132132
<data name="AHE_Saved" xml:space="preserve">
133133
<value>Изменения в файле hosts были успешно сохранены!</value>
134134
</data>
135-
<data name="AHE_SaveException" xml:space="preserve">
135+
<data name="AHE_SaveError" xml:space="preserve">
136136
<value>Внимание! Произошла ошибка во время записи в файл {0}. Возможно, у вас недостаточно для этого прав, либо кто-то блокирует попытку записи.</value>
137137
</data>
138138
<data name="AHE_NoAdminRights" xml:space="preserve">
@@ -249,7 +249,7 @@
249249
<data name="AHE_Exported" xml:space="preserve">
250250
<value>Содержимое файла Hosts было успешно экспортировано!</value>
251251
</data>
252-
<data name="AHE_ExportException" xml:space="preserve">
252+
<data name="AHE_ExportError" xml:space="preserve">
253253
<value>Внимание! Произошла ошибка при попытке экспорта в файл. Возможно, у вас недостаточно для этого прав, либо кто-то блокирует попытку записи.</value>
254254
</data>
255255
<data name="AHE_Imported" xml:space="preserve">
@@ -258,7 +258,7 @@
258258
<data name="AHE_ImportFileNotFound" xml:space="preserve">
259259
<value>Выбранный файл для импорта не найден!</value>
260260
</data>
261-
<data name="AHE_ImportFileException" xml:space="preserve">
261+
<data name="AHE_ImportError" xml:space="preserve">
262262
<value>Произошла ошибка во время импорта выбранного файла!</value>
263263
</data>
264264
<data name="AHE_ClipboardNonComment" xml:space="preserve">

src/mhed/FrmMhed.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ private async Task SaveToFile()
712712
catch (Exception Ex)
713713
{
714714
Logger.Error(Ex, DebugStrings.AppDbgExSaveTask);
715-
MessageBox.Show(string.Format(AppStrings.AHE_SaveException, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
715+
MessageBox.Show(string.Format(AppStrings.AHE_SaveError, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
716716
}
717717
}
718718
else
@@ -736,7 +736,7 @@ private async Task ExportToFile()
736736
catch (Exception Ex)
737737
{
738738
Logger.Error(Ex, DebugStrings.AppDbgExExportTask);
739-
MessageBox.Show(AppStrings.AHE_ExportException, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
739+
MessageBox.Show(AppStrings.AHE_ExportError, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
740740
}
741741
}
742742
}
@@ -753,13 +753,13 @@ private async Task LoadHostsFile()
753753
catch (FileNotFoundException Ex)
754754
{
755755
Logger.Error(Ex, DebugStrings.AppDbgHostsFileDoesNotExists);
756-
MessageBox.Show(string.Format(AppStrings.AHE_NoFileDetected, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
756+
MessageBox.Show(string.Format(AppStrings.AHE_HostsNotFound, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
757757
App.Platform.Exit(ReturnCodes.HostsFileDoesNotExists);
758758
}
759759
catch (Exception Ex)
760760
{
761761
Logger.Error(Ex, DebugStrings.AppDbgExHostsLoadParse);
762-
MessageBox.Show(string.Format(AppStrings.AHE_ExceptionDetected, App.HostsFile.FilePath, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error));
762+
MessageBox.Show(string.Format(AppStrings.AHE_HostsLoadParseError, App.HostsFile.FilePath, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error));
763763
}
764764
}
765765

@@ -785,7 +785,7 @@ private async Task ImportFromFile()
785785
catch (Exception Ex)
786786
{
787787
Logger.Error(Ex, DebugStrings.AppDbgExImportTask);
788-
MessageBox.Show(AppStrings.AHE_ImportFileException, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
788+
MessageBox.Show(AppStrings.AHE_ImportError, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
789789
}
790790
}
791791
}
@@ -807,7 +807,7 @@ private async Task ReloadHostsFile()
807807
catch (Exception Ex)
808808
{
809809
Logger.Error(Ex, DebugStrings.AppDbgExHostsLoadParse);
810-
MessageBox.Show(string.Format(AppStrings.AHE_ExceptionDetected, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
810+
MessageBox.Show(string.Format(AppStrings.AHE_HostsLoadParseError, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
811811
}
812812
}
813813

@@ -1003,7 +1003,7 @@ private void HE_MenuDeleteItem_Click(object sender, EventArgs e)
10031003
/// <param name="e">Event arguments.</param>
10041004
private async void HE_MenuRestoreDefaultsItem_Click(object sender, EventArgs e)
10051005
{
1006-
if (MessageBox.Show(AppStrings.AHE_RestDef, Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
1006+
if (MessageBox.Show(AppStrings.AHE_RestoreDefaultsQuestion, Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
10071007
{
10081008
App.HostsFile.Restore();
10091009
await SaveToFile();
@@ -1227,7 +1227,7 @@ private void HE_StatusBarHostsLocation_MouseLeave(object sender, EventArgs e)
12271227
/// <param name="e">Event arguments.</param>
12281228
private void HE_StatusBarHostsLocation_Click(object sender, EventArgs e)
12291229
{
1230-
if (MessageBox.Show(string.Format(AppStrings.AHE_HMessg, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
1230+
if (MessageBox.Show(string.Format(AppStrings.AHE_HostsLocation, App.HostsFile.FilePath), Properties.Resources.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
12311231
{
12321232
HelperShowFile(App.HostsFile.FilePath);
12331233
}

0 commit comments

Comments
 (0)