Applies to Umbraco 6.x and newer
The LocalizationService acts as a "gateway" to Umbraco data for operations which are related to Dictionary items and Languages.
Browse the API documentation for LocalizationService.
- Namespace:
Umbraco.Core.Services - Assembly:
Umbraco.Core.dll
All samples in this document will require references to the following dll:
- Umbraco.Core.dll
All samples in this document will require the following usings:
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
Please note that this page will be updated with samples and additional information about the methods listed below
The LocalizationService is available through the ApplicationContext, but the if you are using a SurfaceController or the UmbracoUserControl then the LocalizationService is available through a local Services property.
Services.LocalizationService
Getting the service through the ApplicationContext:
ApplicationContext.Current.Services.LocalizationService
Deletes a IDictionaryItem object and its related translations as well as its children.
Deletes a ILanguage by removing it and its usages from the db
Checks if a IDictionaryItem with given key exists
Gets all available languages as an IEnumerable<Core.Models.ILanguage>
Gets a IDictionaryItem by its id
Gets a IDictionaryItem by its id
Gets a IDictionaryItem by its key
Gets a list of children as IEnumerable<IDictionaryItem> for parent IDictionaryItem
Gets a ILanguage by its culture code (Culture Name - also referred to as 'Friendly name')
Gets a ILanguage by its id
Gets a Language by its ISO code (ISO code of the language, i.e. en-US)
Gets the root/top IDictionaryItem objects as IEnumerable<Core.Models.IDictionaryItem>
Saves a IDictionaryItem object
Saves a ILanguage object