View Source
  Class LanguageController
  
  Backoffice controller supporting the dashboard for language administration.
 
  
  
    Inheritance
      System.Object
      Microsoft.AspNetCore.Mvc.ControllerBase
      
      
      
      
      
   
  
  Assembly: Umbraco.Web.BackOffice.dll
  Syntax
  
    public class LanguageController : UmbracoAuthorizedJsonController
   
  Constructors
  
  
    View Source
  
  LanguageController(ILocalizationService, IUmbracoMapper)
  
  
  Declaration
  
    [ActivatorUtilitiesConstructor]
public LanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | ILocalizationService | 
        localizationService | 
         | 
      
      
        | IUmbracoMapper | 
        umbracoMapper | 
         | 
      
    
  
  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<Models.ContentEditing.Language>? GetAllLanguages()
   
  Returns
  
  
    View Source
  
  GetLanguage(Int32)
  
  
  Declaration
  
    [HttpGet]
[Authorize(Policy = "TreeAccessLanguages")]
public ActionResult<Models.ContentEditing.Language?> GetLanguage(int id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        id | 
         | 
      
    
  
  Returns
  
  
    View Source
  
  SaveLanguage(Models.ContentEditing.Language)
  Creates or saves a language
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessLanguages")]
[HttpPost]
public ActionResult<Models.ContentEditing.Language?> SaveLanguage(Models.ContentEditing.Language language)
   
  Parameters
  
  Returns