View Source
Class LocalizedTextService
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public class LocalizedTextService : ILocalizedTextService2, ILocalizedTextService
Constructors
View Source
LocalizedTextService(IDictionary<CultureInfo, IDictionary<String, IDictionary<String, String>>>, ILogger)
Initializes with a source of a dictionary of culture -> areas -> sub dictionary of keys/values
Declaration
public LocalizedTextService(IDictionary<CultureInfo, IDictionary<string, IDictionary<string, string>>> source, ILogger logger)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.Globalization.CultureInfo, System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IDictionary<System.String, System.String>>> |
source |
|
ILogger |
logger |
|
View Source
LocalizedTextService(IDictionary<CultureInfo, Lazy<XDocument>>, ILogger)
Initializes with an XML source
Declaration
public LocalizedTextService(IDictionary<CultureInfo, Lazy<XDocument>> source, ILogger logger)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IDictionary<System.Globalization.CultureInfo, System.Lazy<System.Xml.Linq.XDocument>> |
source |
|
ILogger |
logger |
|
View Source
LocalizedTextService(Lazy<LocalizedTextServiceFileSources>, ILogger)
Initializes with a file sources instance
Declaration
public LocalizedTextService(Lazy<LocalizedTextServiceFileSources> fileSources, ILogger logger)
Parameters
Methods
View Source
ConvertToSupportedCultureWithRegionCode(CultureInfo)
Tries to resolve a full 4 letter culture from a 2 letter culture name
Declaration
public CultureInfo ConvertToSupportedCultureWithRegionCode(CultureInfo currentCulture)
Parameters
Type |
Name |
Description |
System.Globalization.CultureInfo |
currentCulture |
The culture to determine if it is only a 2 letter culture, if so we'll try to convert it, otherwise it will just be returned
|
Returns
Type |
Description |
System.Globalization.CultureInfo |
|
View Source
GetAllStoredValues(CultureInfo)
Returns all key/values in storage for the given culture
Declaration
public IDictionary<string, string> GetAllStoredValues(CultureInfo culture)
Parameters
Type |
Name |
Description |
System.Globalization.CultureInfo |
culture |
|
Returns
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.String> |
|
View Source
GetAllStoredValuesByAreaAndAlias(CultureInfo)
Declaration
public IDictionary<string, IDictionary<string, string>> GetAllStoredValuesByAreaAndAlias(CultureInfo culture)
Parameters
Type |
Name |
Description |
System.Globalization.CultureInfo |
culture |
|
Returns
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IDictionary<System.String, System.String>> |
|
View Source
GetSupportedCultures()
Returns a list of all currently supported cultures
Declaration
public IEnumerable<CultureInfo> GetSupportedCultures()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Globalization.CultureInfo> |
|
View Source
Localize(String, CultureInfo, IDictionary<String, String>)
Declaration
public string Localize(string key, CultureInfo culture, IDictionary<string, string> tokens = null)
Parameters
Type |
Name |
Description |
System.String |
key |
|
System.Globalization.CultureInfo |
culture |
|
System.Collections.Generic.IDictionary<System.String, System.String> |
tokens |
|
Returns
Type |
Description |
System.String |
|
View Source
Localize(String, String, CultureInfo, IDictionary<String, String>)
Declaration
public string Localize(string area, string alias, CultureInfo culture, IDictionary<string, string> tokens = null)
Parameters
Type |
Name |
Description |
System.String |
area |
|
System.String |
alias |
|
System.Globalization.CultureInfo |
culture |
|
System.Collections.Generic.IDictionary<System.String, System.String> |
tokens |
|
Returns
Type |
Description |
System.String |
|