/// <summary> /// Install languages from the given xml file /// </summary> /// <param name="languagesXmlFileLocation">The languages XML file location.</param> public void Install(string languagesXmlFileLocation) { // Let's first delete everything _languageService.DeleteAll(); var languages = _languageFileParser.DeserializeLanguagesFile(languagesXmlFileLocation); try { foreach (var language in languages) { // insert the language _languageService.InsertLanguage(language.First); // update all the resources with the new id of the language Array.ForEach(language.Second.ToArray(), (resource) => resource.LanguageId = language.First.Id); // batch insert them! _localizationService.InsertLocaleStringResources(language.Second.ToArray()); } } catch (Exception ex) { Trace.WriteLine("Problem installing languages. " + ex.Message); _errorNotifier.Notify(ex); } }