Interface ILanguageService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface ILanguageService
Methods
View SourceCreateAsync(ILanguage, Guid)
Creates a new ILanguage object
Declaration
Task<Attempt<ILanguage, LanguageOperationStatus>> CreateAsync(ILanguage language, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
ILanguage | language | ILanguage to create |
Guid | userKey | Key of the user creating the language |
Returns
Type | Description |
---|---|
Task<Attempt<ILanguage, LanguageOperationStatus>> |
DeleteAsync(String, Guid)
Deletes a ILanguage by removing it and its usages from the db
Declaration
Task<Attempt<ILanguage, LanguageOperationStatus>> DeleteAsync(string isoCode, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | isoCode | The ISO code of the ILanguage to delete |
Guid | userKey | Key of the user deleting the language |
Returns
Type | Description |
---|---|
Task<Attempt<ILanguage, LanguageOperationStatus>> |
GetAllAsync()
Gets all available languages
Declaration
Task<IEnumerable<ILanguage>> GetAllAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<ILanguage>> | An enumerable list of ILanguage objects |
GetAsync(String)
Gets a ILanguage by its iso code
Declaration
Task<ILanguage> GetAsync(string isoCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | isoCode | Iso Code of the language (ie. en-US) |
Returns
Type | Description |
---|---|
Task<ILanguage> | ILanguage |
GetDefaultIsoCodeAsync()
Gets the default language ISO code.
Declaration
Task<string> GetDefaultIsoCodeAsync()
Returns
Type | Description |
---|---|
Task<System.String> | The default language ISO code |
Remarks
This can be optimized and bypass all deep cloning.
GetDefaultLanguageAsync()
Gets the default ILanguage
Declaration
Task<ILanguage> GetDefaultLanguageAsync()
Returns
Type | Description |
---|---|
Task<ILanguage> | ILanguage |
GetIsoCodesByIdsAsync(ICollection<Int32>)
Retrieves the isoCodes of configured languages by their Ids
Declaration
Task<string[]> GetIsoCodesByIdsAsync(ICollection<int> ids)
Parameters
Type | Name | Description |
---|---|---|
ICollection<System.Int32> | ids | The ids of the configured ILanguages |
Returns
Type | Description |
---|---|
Task<System.String[]> | The ISO codes of the ILanguages |
GetMultipleAsync(IEnumerable<String>)
Gets all languages with the given iso codes
Declaration
Task<IEnumerable<ILanguage>> GetMultipleAsync(IEnumerable<string> isoCodes)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | isoCodes |
Returns
Type | Description |
---|---|
Task<IEnumerable<ILanguage>> | An enumerable list of ILanguage objects |
UpdateAsync(ILanguage, Guid)
Updates an existing ILanguage object
Declaration
Task<Attempt<ILanguage, LanguageOperationStatus>> UpdateAsync(ILanguage language, Guid userKey)
Parameters
Type | Name | Description |
---|---|---|
ILanguage | language | ILanguage to update |
Guid | userKey | Key of the user saving the language |
Returns
Type | Description |
---|---|
Task<Attempt<ILanguage, LanguageOperationStatus>> |