This service is available via Telligent.Evolution.Extensibility.Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.ILanguage>()
and is defined in Telligent.Evolution.Platform.dll
Properties
Name | Type | Description | Default | Options |
---|---|---|---|---|
Code | string | Identifies the current language code, for example, en. | ||
CodeAndLocale | string | Identifies the current language code and locale, for example, en-us. | ||
IsRightToLeft | bool | Identifies if the accessing user's language is rendered right to left. | ||
NewLine | string | Environment-aware new line character |
Methods
string FormatAgoDate(DateTime date);
Formats a date as a readable 'time ago' format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required |
Return Type
string
string FormatAgoDate(DateTime date, bool useUserTime);
Formats a date as a readable 'time ago' format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
useUserTime | bool | DEPRECATED: this parameter is no longer supported | Required |
Return Type
string
string FormatDataSize(int size);
Formats a data size
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
size | int | Size | Required |
Return Type
string
string FormatDate(DateTime date);
Formats a date to the default date format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required |
Return Type
string
string FormatDate(DateTime date, string format);
Formats a date to a custom date format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
format | string | Supports standard and custom datetime formats as defined msdn.microsoft.com/.../az4se3k1.aspx and msdn.microsoft.com/.../8kb3ddd4.aspx | Required |
Return Type
string
string FormatDate(DateTime date, LanguageFormatDateOptions options);
Formats a date to a custom date format and or adjusted time zone
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
options | LanguageFormatDateOptions | Options include: Format. Parameter "AdjustTimeZone" is no longer supported | Required |
Return Type
string
string FormatDateAndTime(DateTime date, bool adjustTimeZone = True);
Formats a date to the default date and time format
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
adjustTimeZone | bool | When true, converts to accessing user's time zone. DEPRECATED: this parameter is no longer supported | Optional | True |
Return Type
string
string FormatNumber(double number);
Formats a number
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
number | double | Number | Required |
Return Type
string
string FormatNumber(int number);
Formats a number
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
number | int | Number | Required |
Return Type
string
string FormatString(string format, params string[] parameters);
Replaces each format item in a specified string with the text equivalent of a corresponding object's value.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
format | string | Format string including indexed placeholders: {0}, {1}, {2}, etc | Required | ||
parameters | string[] | Parameters | Required |
Return Type
string
string FormatString(string format, IDictionary parameters);
Replaces named tokens in the format {name} with the corresponding value in the dictionary.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
format | string | Format | Required | ||
parameters | IDictionary | Parameters | Required |
Return Type
string
string FormatTime(DateTime time);
Formats the time component of a date/time using the site default time format.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
time | DateTime | Time | Required |
Return Type
string
string FormatUrl(string url);
Formats a URL
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Url | Required |
Return Type
string
string GetInitials(string fullName);
Returns initials for a full name
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
fullName | string | Full Name | Required |
Return Type
string
string Lowercase(string text);
Converts a string to lower-case
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required |
Return Type
string
string RemoveHtml(string html);
Removes HTML from a string
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | string | Html | Required |
Return Type
string
string Truncate(string text, int desiredLength, string ellipsis);
Truncates text as close to the desiredLength as possible without breaking words. Also removes HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required | ||
desiredLength | int | Desired length | Required | ||
ellipsis | string | String to show in place of truncated text | Required |
Return Type
string
string Truncate(string text, int desiredLength, string ellipsis, bool maintainHtmlFormatting = False);
Truncates text as close to the desiredLength as possible without breaking words. Also removes HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required | ||
desiredLength | int | Desired length | Required | ||
ellipsis | string | String to show in place of truncated text | Required | ||
maintainHtmlFormatting | bool | When true, allows HTML formatting to be included in the truncated html. | Optional | False |
Return Type
string
string Truncate(string text, int desiredLength, string ellipsis, List<string> allowedHtmlTags);
Truncates text as close to the desiredLength as possible without breaking words. Also removes HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required | ||
desiredLength | int | Desired length | Required | ||
ellipsis | string | String to show in place of truncated text | Required | ||
allowedHtmlTags | List<string> | Keep these html tags in the results, html tags aren't included in the length count. | Required |
Return Type
string
string Uppercase(string text);
Converts a string to upper-case
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Text | Required |
Return Type
string