Items with limited number of properties (for example, only name and description) may need to be localized. This topic demonstrates how to apply the
Localization Manager in order to use items with localizable properties.
 |
This approach is not recommended when handling more than 4,000 - 5,000 items. It is better to use databases when
saving localized content for purposes of better manipulation of the content. |
Following is an implementation of the Item class:
| Localization Manager |
Copy Code |
|
using Telerik.Localization;
class Item
{
public Item(Guid id)
{
//Retrieves an item for the current UI culture or creates new if one does not exist.
this.item = manger.GetLocal(id);
}
public string Name
{
get
{
return item.GetValue("Name");
}
set
{
item.SetValue("Name", value);
}
}
public string Description
{
get
{
return item.GetValue("Description");
}
set
{
item.SetValue("Description", value);
}
}
public void Save()
{
manger.SaveItem(this.item);
}
private ILocalizedItem item;
private static LocalizationManager manger = new LocalizationManager();
}
|
See Also