protected void cmdDisableLocalization_Click(object sender, EventArgs e) { try { var portalController = new PortalController(); foreach (Locale locale in LocaleController.Instance.GetLocales(PortalSettings.PortalId).Values) { if (!IsDefaultLanguage(locale.Code)) { LocaleController.Instance.PublishLanguage(PortalId, locale.Code, false); TabController.DeleteTranslatedTabs(PortalId, locale.Code, false); portalController.RemovePortalLocalization(PortalId, locale.Code, false); } } TabController.EnsureNeutralLanguage(PortalId, PortalDefault, false); PortalController.UpdatePortalSetting(PortalId, "ContentLocalizationEnabled", "False"); DataCache.ClearPortalCache(PortalId, true); Response.Redirect(Globals.NavigateURL(), true); } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
protected void cmdDeleteTranslation_Click(object sender, EventArgs e) { try { if ((sender) is LinkButton) { var cmdDeleteTranslation = (LinkButton)sender; int languageId = int.Parse(cmdDeleteTranslation.CommandArgument); Locale locale = LocaleController.Instance.GetLocale(languageId); TabController.DeleteTranslatedTabs(PortalId, locale.Code, false); new PortalController().RemovePortalLocalization(PortalId, locale.Code, false); LocaleController.Instance.PublishLanguage(PortalId, locale.Code, false); DataCache.ClearPortalCache(PortalId, true); //Redirect to refresh page (and skinobjects) Response.Redirect(Globals.NavigateURL(), true); } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }