From 57986b0b6395f24506b9a19ff1820ed2d9510717 Mon Sep 17 00:00:00 2001 From: Maxi Jabase Date: Mon, 14 Feb 2022 13:35:08 -0300 Subject: [PATCH] add translations to macros and some error messages --- UI/Windows/ConfigWindow.xaml.cs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/UI/Windows/ConfigWindow.xaml.cs b/UI/Windows/ConfigWindow.xaml.cs index fdd5b48e..62062304 100644 --- a/UI/Windows/ConfigWindow.xaml.cs +++ b/UI/Windows/ConfigWindow.xaml.cs @@ -32,20 +32,20 @@ public partial class ConfigWindow private readonly string[] CompileMacros = { - "{editordir} - Directory of the SPCode binary", - "{scriptdir} - Directory of the compiling script", - "{copydir} - Directory where the .smx should be copied", - "{scriptfile} - Full directory and name of the script", - "{scriptname} - File name of the script", - "{pluginfile} - Full directory and name of the compiled script", - "{pluginname} - File name of the compiled script" + $"{{editordir}} {Translate("macro_editordir")}", + $"{{scriptdir}} {Translate("macro_scriptdir")}", + $"{{copydir}} {Translate("macro_copydir")}", + $"{{scriptfile}} {Translate("macro_scriptfile")}", + $"{{scriptname}} {Translate("macro_scriptname")}", + $"{{pluginfile}} {Translate("macro_pluginfile")}", + $"{{pluginname}} {Translate("macro_pluginname")}" }; private readonly string[] CommandMacros = { - "{plugins_reload} - Reloads all compiled plugins", - "{plugins_load} - Loads all compiled plugins", - "{plugins_unload} - Unloads all compiled plugins" + $"{{plugins_reload}} {Translate("macro_plugins_reload")}", + $"{{plugins_load}} {Translate("macro_plugins_load")}", + $"{{plugins_unload}} {Translate("macro_plugins_unload")}" }; public ConfigWindow() @@ -295,8 +295,8 @@ private void AddSMDirButton_Click(object sender, RoutedEventArgs e) } catch (UnauthorizedAccessException) { - this.ShowMessageAsync("Access error", - "The directory you just specified could not be accessed properly by SPCode. You may have trouble using the includes from this directory.", + this.ShowMessageAsync(Translate("PermissionAccessError"), + Translate("PermissionAcessErrorMessage"), MessageDialogStyle.Affirmative, Program.MainWindow.MetroDialogOptions); } @@ -655,9 +655,10 @@ private void Language_Translate() RConPWBlock.Text = Translate("RconPw"); RConComBlock.Text = Translate("RconCom"); Rcon_MenuC.Text = Translate("RConCMDLineCom"); + BackupConfigsButton.Content = Translate("BackupConfigs"); + LoadConfigsButton.Content = Translate("LoadConfigs"); } - private class SimpleCommand : ICommand { public Predicate CanExecutePredicate { get; set; }