public HttpResponseMessage EnableLocalizedContent([FromUri] int?portalId, [FromUri] bool translatePages)
        {
            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.LocalizeSitePages(
                    progress, pid, translatePages, 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()));
            }
        }