static int RunCreateScript(CreateScriptOption opts) { var manager = new TranslationManager { ConsoleMessage = (x) => ShowMessage(x) }; manager.Initialize(opts.Filename); ShowMessage($"Generating script {opts.ScriptFilename}"); var retVal = RunScriptCreation(manager, opts); // TODO: use on Add translation too if (retVal == 0) { ShowMessage("Script generated."); } return(retVal); }
static int RunScriptCreation(TranslationManager manager, CreateScriptOption opts) => manager?.GenerateScript(opts.ScriptFilename, opts.Version) == true ? 0 : 1;