public IActionResult ExportXml(string id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageLanguages)) { return(AccessDeniedView()); } var language = _languageService.GetLanguageById(id); if (language == null) { //No language found with the specified id return(RedirectToAction("List")); } try { var xml = _localizationService.ExportResourcesToXml(language); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "language_pack.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public ActionResult ExportXml(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageLanguages)) { return(AccessDeniedView()); } var language = _languageService.GetLanguageById(id); if (language == null) { //No language found with the specified id return(RedirectToAction("List")); } try { var xml = _localizationService.ExportResourcesToXml(language); return(new XmlDownloadResult(xml, "language_pack.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public ActionResult ExportXml(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageLanguages)) { return(AccessDeniedView()); } var language = _languageService.GetLanguageById(id); if (language == null) { return(RedirectToAction("List")); } try { var xml = _localizationService.ExportResourcesToXml(language); return(new XmlDownloadResult(xml, "language-pack-{0}.xml".FormatInvariant(language.UniqueSeoCode))); } catch (Exception exc) { NotifyError(exc); return(RedirectToAction("List")); } }
public IActionResult ExportXml(string id) { var language = _languageService.GetLanguageById(id); if (language == null) { //No language found with the specified id return(RedirectToAction("List")); } try { var xml = _localizationService.ExportResourcesToXml(language); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "language_pack.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
public ActionResult ExportXml(long id) { var language = _languageService.GetLanguageById(id); if (language == null) { //No language found with the specified id return(RedirectToAction("List")); } try { var xml = _localizationService.ExportResourcesToXml(language); return(new XmlDownloadResult(xml, "language_pack.xml")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }
/// <summary> /// Export language resources to xml /// </summary> /// <param name="language">Language</param> /// <returns>Result in XML format</returns> public string ExportResourcesToXml(Language language) { return(_localizationService.ExportResourcesToXml(language)); }