• Core
  • Infrastructure
  • Web
  • Extensions
Search Results for

    Show / Hide Table of Contents
    View Source

    Class LanguageController

    Backoffice controller supporting the dashboard for language administration.

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [PluginController("UmbracoApi")]
    public class LanguageController : UmbracoAuthorizedJsonController, IUmbracoFeature, IDiscoverable

    Constructors

    View Source

    LanguageController(ILocalizationService, IUmbracoMapper)

    Declaration
    [ActivatorUtilitiesConstructor]
    public LanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper)
    Parameters
    Type Name Description
    ILocalizationService localizationService
    IUmbracoMapper umbracoMapper
    View Source

    LanguageController(ILocalizationService, IUmbracoMapper, IOptionsSnapshot<GlobalSettings>)

    Declaration
    public LanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper, IOptionsSnapshot<GlobalSettings> globalSettings)
    Parameters
    Type Name Description
    ILocalizationService localizationService
    IUmbracoMapper umbracoMapper
    Microsoft.Extensions.Options.IOptionsSnapshot<GlobalSettings> globalSettings

    Methods

    View Source

    DeleteLanguage(Int32)

    Deletes a language with a given ID

    Declaration
    [Authorize(Policy = "TreeAccessLanguages")]
    [HttpDelete]
    [HttpPost]
    public IActionResult DeleteLanguage(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.IActionResult
    View Source

    GetAllCultures()

    Returns all cultures available for creating languages.

    Declaration
    [HttpGet]
    [Authorize(Policy = "TreeAccessLanguages")]
    public IDictionary<string, string> GetAllCultures()
    Returns
    Type Description
    IDictionary<System.String, System.String>
    View Source

    GetAllLanguages()

    Returns all currently configured languages.

    Declaration
    [HttpGet]
    public IEnumerable<Language>? GetAllLanguages()
    Returns
    Type Description
    System.Nullable<IEnumerable<Language>>
    View Source

    GetLanguage(Int32)

    Declaration
    [HttpGet]
    [Authorize(Policy = "TreeAccessLanguages")]
    public ActionResult<Language> GetLanguage(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<Language>
    View Source

    SaveLanguage(Language)

    Creates or saves a language

    Declaration
    [Authorize(Policy = "TreeAccessLanguages")]
    [HttpPost]
    public ActionResult<Language> SaveLanguage(Language language)
    Parameters
    Type Name Description
    Language language
    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.ActionResult<Language>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • LanguageController(ILocalizationService, IUmbracoMapper)
      • LanguageController(ILocalizationService, IUmbracoMapper, IOptionsSnapshot<GlobalSettings>)
    • Methods
      • DeleteLanguage(Int32)
      • GetAllCultures()
      • GetAllLanguages()
      • GetLanguage(Int32)
      • SaveLanguage(Language)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX