Interface ILocalizableToken
Defines the interface for auto-localizable tokens. Localizable tokens have a value, and their surface representation ("text") can be automatically converted into a target culture representation, given the token's value and the target culture.
Namespace: SdlSdl.LanguagePlatformCoreTokenization
Assembly: Sdl.LanguagePlatform.Core.dll
Syntax
public interface ILocalizableToken
Properties
TokenizationContext
The TokenizationContext in which to apply localization etc.
Declaration
TokenizationContext TokenizationContext { get; set; }
Property Value
Type | Description |
---|---|
TokenizationContext |
Methods
Localize(CultureInfo, AutoLocalizationSettings)
Declaration
bool Localize(CultureInfo culture, AutoLocalizationSettings autoLocalizationSettings)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture | |
AutoLocalizationSettings | autoLocalizationSettings |
Returns
Type | Description |
---|---|
bool |
Localize(CultureInfo, AutoLocalizationSettings, ILocalizableToken, bool)
Declaration
bool Localize(CultureInfo culture, AutoLocalizationSettings autoLocalizationSettings, ILocalizableToken originalMemoryToken, bool adjustCasing)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture | |
AutoLocalizationSettings | autoLocalizationSettings | |
ILocalizableToken | originalMemoryToken | |
bool | adjustCasing |
Returns
Type | Description |
---|---|
bool |
LocalizeAsync(CultureInfo, AutoLocalizationSettings, ICultureMetadataManager)
Auto-localizes the token according to the settings of the specified target culture and the provided auto-localization settings. The text of the token will be changed, but not the values.
For some token types, special AutoLocalizationSettings will be used, if provided.
Declaration
Task<bool> LocalizeAsync(CultureInfo culture, AutoLocalizationSettings autoLocalizationSettings, ICultureMetadataManager cultureMetadataManager)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture | The target culture |
AutoLocalizationSettings | autoLocalizationSettings | Contains the AutoLocalizationSettings to use for some token types. May be null, in which case default settings will be used. |
ICultureMetadataManager | cultureMetadataManager |
Returns
Type | Description |
---|---|
Taskbool |
|
LocalizeAsync(CultureInfo, AutoLocalizationSettings, ILocalizableToken, bool, ICultureMetadataManager)
Auto-localizes the token according to the settings of the specified target culture and the provided auto-localization settings. The text of the token will be changed, but not the values.
For some token types, special AutoLocalizationSettings will be used, if provided.
Declaration
Task<bool> LocalizeAsync(CultureInfo culture, AutoLocalizationSettings autoLocalizationSettings, ILocalizableToken originalMemoryToken, bool adjustCasing, ICultureMetadataManager cultureMetadataManager)
Parameters
Type | Name | Description |
---|---|---|
CultureInfo | culture | The target culture |
AutoLocalizationSettings | autoLocalizationSettings | Contains the AutoLocalizationSettings to use for some token types. May be null, in which case default settings will be used. |
ILocalizableToken | originalMemoryToken | The original memory token. Some auto-localization settings will be derived from the token, if provided. |
bool | adjustCasing | If true, it is assumed that the token is in segment-initial position. Then, casing will be adjusted if the original memory token is supplied as well. |
ICultureMetadataManager | cultureMetadataManager |
Returns
Type | Description |
---|---|
Taskbool |
|
SetValue(Token, bool)
Overwrites the current token's value with the value from blueprint
, which
also must be a DateTimeToken. Note that only the value and the type are
overwritten, not the textual representation.
Declaration
bool SetValue(Token blueprint, bool keepNumericSeparators)
Parameters
Type | Name | Description |
---|---|---|
Token | blueprint | The token to take the value from |
bool | keepNumericSeparators | Applicable to numeric (number and measurement) tokens only: if true, do not override the original group and decimal separators. |
Returns
Type | Description |
---|---|
bool | A flag indicating whether the token's value or type were changed. |