public static void TranslateProject(string apikey, string project_path, TranslatorDefinition transdef, Language sourceLanguage) { AndroidProject project = new AndroidProject(project_path); ResourceTranslator rt = new ResourceTranslator(project, transdef.CreateInstance(apikey), sourceLanguage); rt.TranslateProject(); }
private void cbTranslateService_SelectedIndexChanged(object sender, EventArgs e) { if (ValidateApiKey()) { TranslatorDefinition transdef = GetSelectedTranslatorDefinition(); ITranslator translator = transdef.CreateInstance(GetApiKey()); List <Language> languages = translator.GetSupportedLanguages(); cbSourceLang.BeginUpdate(); cbSourceLang.Items.Clear(); cbSourceLang.Items.AddRange(languages.ToArray()); cbSourceLang.SelectedIndex = 0; cbSourceLang.EndUpdate(); } }