public static void Main(string[] args) { Environment.ExitCode = 0; ManagerBehaviorSettings settings = new ManagerBehaviorSettings(); settings.RequestLanguageIfNotSpecified = true; settings.UseToolGeneratedConfigFile = true; LanguagesManager localManager = new LanguagesManager(new System.Collections.ObjectModel.ReadOnlyCollection <string>(new string[] { "md5 Program" }), Directories.LocalsFolder, "BUtil", settings); localManager.Init(); localManager.Apply(); // applying locals _Usage = Translation.Current[488]; _EnterCommand = Translation.Current[489]; _AskEnterArguments = Translation.Current[490]; _Md5OfPackerFormatString = Translation.Current[491]; _OperationFailledFormatString = Translation.Current[492]; _EnterParam1 = Translation.Current[493]; _EnterParam2 = Translation.Current[494]; _Ok = Translation.Current[495]; _Bad = Translation.Current[496]; _Md5Commands = Translation.Current[497]; _Md5Question = Translation.Current[498]; _NoParameters = Translation.Current[499]; _InvalidOperation = Translation.Current[500]; _InputFileNotSpecified = Translation.Current[501]; _PressKeyToQuit = Translation.Current[502]; main(args); Console.WriteLine(_PressKeyToQuit); Console.ReadKey(); Console.WriteLine(Environment.NewLine); Console.WriteLine(_COPYRIGHT); }
/// <summary> /// Loads the locals /// </summary> static void loadLocalization() { ManagerBehaviorSettings settings = new ManagerBehaviorSettings(); settings.RequestLanguageIfNotSpecified = true; settings.UseToolGeneratedConfigFile = true; LanguagesManager localManager = new LanguagesManager(new System.Collections.ObjectModel.ReadOnlyCollection <string>(new string[] { "Ghost Program", "Core Library" }), Directories.LocalsFolder, "BUtil", settings); localManager.Init(); localManager.Apply(); }
/// <summary> /// Loading the localization /// </summary> static void LoadLanguage() { var settings = new ManagerBehaviorSettings { RequestLanguageIfNotSpecified = true, UseToolGeneratedConfigFile = true }; _localsManager = new LanguagesManager(new ReadOnlyCollection <string>(new [] { "Configurator Program", "Core Library", }), Directories.LocalsFolder, "BUtil", settings); _localsManager.Init(); _localsManager.Apply(); }
/// <summary> /// Loads language settigns /// Constraints: should be called only form main form! /// </summary> public void LoadLanguage(ToolStripMenuItem chooseLanguagesMenu) { try { _localsManager.Init(); _localsManager.Apply(); _localsManager.GenerateMenuWithLanguages(chooseLanguagesMenu); } catch (Exception exc) { MessageBox.Show(exc.Message, Error, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } }
private static void LoadLocals() { try { var namespaces = new [] { "Core Library", "Console backup Program" }; var collection = new ReadOnlyCollection <string>(namespaces); var settings = new ManagerBehaviorSettings(); settings.RequestLanguageIfNotSpecified = false; settings.UseToolGeneratedConfigFile = true; var manager = new LanguagesManager(collection, Directories.LocalsFolder, "BUtil", settings); manager.Init(); } catch (Exception exc) { ShowErrorAndQuit(string.Format(CultureInfo.InstalledUICulture, "Could not load locals due to {0}", exc.Message)); } }