using System; using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Services { /// /// Defines the Localization Service, which is an easy access to operations involving Languages and Dictionary /// public interface ILocalizationService : IService { //Possible to-do list: //Import DictionaryItem (?) //RemoveByLanguage (translations) //Add/Set Text (Insert/Update) //Remove Text (in translation) /// /// Creates and saves a new dictionary item and assigns a value to all languages if defaultValue is specified. /// /// /// /// /// IDictionaryItem CreateDictionaryItemWithIdentity(string key, Guid? parentId, string defaultValue = null); /// /// Gets a by its id /// /// Id of the /// IDictionaryItem GetDictionaryItemById(int id); /// /// Gets a by its id /// /// Id of the /// IDictionaryItem GetDictionaryItemById(Guid id); /// /// Gets a by its key /// /// Key of the /// IDictionaryItem GetDictionaryItemByKey(string key); /// /// Gets a list of children for a /// /// Id of the parent /// An enumerable list of objects IEnumerable GetDictionaryItemChildren(Guid parentId); /// /// Gets the root/top objects /// /// An enumerable list of objects IEnumerable GetRootDictionaryItems(); /// /// Checks if a with given key exists /// /// Key of the /// True if a exists, otherwise false bool DictionaryItemExists(string key); /// /// Saves a object /// /// to save /// Optional id of the user saving the dictionary item void Save(IDictionaryItem dictionaryItem, int userId = 0); /// /// Deletes a object and its related translations /// as well as its children. /// /// to delete /// Optional id of the user deleting the dictionary item void Delete(IDictionaryItem dictionaryItem, int userId = 0); /// /// Gets a by its id /// /// Id of the /// ILanguage GetLanguageById(int id); /// /// Gets a by its culture code /// /// Culture Code - also refered to as the Friendly name /// ILanguage GetLanguageByCultureCode(string cultureName); /// /// Gets a by its iso code /// /// Iso Code of the language (ie. en-US) /// ILanguage GetLanguageByIsoCode(string isoCode); /// /// Gets all available languages /// /// An enumerable list of objects IEnumerable GetAllLanguages(); /// /// Saves a object /// /// to save /// Optional id of the user saving the language void Save(ILanguage language, int userId = 0); /// /// Deletes a by removing it and its usages from the db /// /// to delete /// Optional id of the user deleting the language void Delete(ILanguage language, int userId = 0); } }