public HttpResponseMessage LocalizedContent([FromUri] int?portalId, [FromUri] string cultureCode) { try { var pid = portalId ?? this.PortalId; if (!this.UserInfo.IsSuperUser && pid != this.PortalId) { return(this.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, AuthFailureMessage)); } var progress = new LocalizationProgress { InProgress = true, }; var portal = PortalController.Instance.GetPortal(pid); var portalSettings = new PortalSettings(portal); LanguagesControllerTasks.LocalizeLanguagePages( progress, pid, cultureCode, portalSettings.DefaultLanguage ?? Localization.SystemLocale); return(this.Request.CreateResponse(HttpStatusCode.OK, progress)); } catch (Exception ex) { Logger.Error(ex); return(this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.ToString())); } }
public HttpResponseMessage GetLocalizationProgress() { try { var progress = LanguagesControllerTasks.ReadProgressFile(); return(this.Request.CreateResponse(HttpStatusCode.OK, progress)); } catch (Exception ex) { Logger.Error(ex); return(this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.ToString())); } }