Skip to content

SiLocaleId Service documentation

The SiLocaleId is used to provide a locale id from the translate service to the angular localization. The Angular services call toString or valueOf so that the current locale of the translation service is provided. The Intl. library does not invoke toString() and using the value directly in Intl formatting results always having the en locale. Thus, when using the SiLocaleId in other services, make sure to use the toString() method before.

Attributes and Methods

NameTypeDefaultDescription
iterator
() => StringIterator<string>Iterator
at(...)
(index: number) => (undefined | string)Returns a new String consisting of the single UTF-16 code unit located at the specified index.

Parameters
  • index: number  The zero-based index of the desired code unit. A negative index will count back from the last item.
charAt(...)
(pos: number) => stringReturns the character at the specified index.

Parameters
  • pos: number  The zero-based index of the desired character.
charCodeAt(...)
(index: number) => numberReturns the Unicode value of the character at the specified location.

Parameters
  • index: number  The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
codePointAt(...)
(pos: number) => (undefined | number)Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point value of the UTF-16 encoded code point starting at the string element at position pos in the String resulting from converting this object to a String. If there is no element at that position, the result is undefined. If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.

Parameters
concat(...)
(strings: string[]) => stringReturns a string that contains the concatenation of two or more strings.

Parameters
  • strings: string[]  The strings to append to the end of the string.
endsWith(...)
(searchString: string, endPosition: number) => booleanReturns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at endPosition – length(this). Otherwise returns false.

Parameters
fromCharCode(...)
(codes: number[]) => stringParameters
fromCodePoint(...)
(codePoints: number[]) => stringReturn the String value whose elements are, in order, the elements in the List elements. If length is 0, the empty string is returned.

Parameters
includes(...)
(searchString: string, position: number) => booleanReturns true if searchString appears as a substring of the result of converting this object to a String, at one or more positions that are greater than or equal to position; otherwise, returns false.

Parameters
  • searchString: string  search string
  • position: number  If position is undefined, 0 is assumed, so as to search all of the String.
indexOf(...)
(searchString: string, position: number) => numberReturns the position of the first occurrence of a substring.

Parameters
  • searchString: string  The substring to search for in the string
  • position: number  The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
lastIndexOf(...)
(searchString: string, position: number) => numberReturns the last occurrence of a substring in the string.

Parameters
  • searchString: string  The substring to search for.
  • position: number  The index at which to begin searching. If omitted, the search begins at the end of the string.
(readonly) length
numberReturns the length of a String object.
localeCompare(...)
(that: string) => numberDetermines whether two strings are equivalent in the current locale.

Parameters
  • that: string  String to compare to target string
match(...)
(regexp: (string | RegExp)) => (null | RegExpMatchArray)Matches a string with a regular expression, and returns an array containing the results of that search.

Parameters
  • regexp: (string | RegExp)  A variable name or string literal containing the regular expression pattern and flags.
matchAll(...)
(regexp: RegExp) => RegExpStringIterator<RegExpExecArray>Matches a string with a regular expression, and returns an iterable of matches containing the results of that search.

Parameters
  • regexp: RegExp  A variable name or string literal containing the regular expression pattern and flags.
normalize(...)
(form: ("NFC" | "NFD" | "NFKC" | "NFKD")) => stringReturns the String value result of normalizing the string into the normalization form named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.

Parameters
  • form: ("NFC" | "NFD" | "NFKC" | "NFKD")  Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"
padEnd(...)
(maxLength: number, fillString: string) => stringPads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string.

Parameters
  • maxLength: number  The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.
  • fillString: string  The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).
padStart(...)
(maxLength: number, fillString: string) => stringPads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string.

Parameters
  • maxLength: number  The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.
  • fillString: string  The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).
raw(...)
(template: { raw: (ArrayLike<string> | readonly string[]) }, substitutions: any[]) => stringString.raw is usually used as a tag function of a Tagged Template String. When called as such, the first argument will be a well formed template call site object and the rest parameter will contain the substitution values. It can also be called directly, for example, to interleave strings and values from your own tag function, and in this case the only thing it needs from the first argument is the raw property.

Parameters
  • template: { raw: (ArrayLike<string> | readonly string[]) }  A well-formed template string call site representation.
  • substitutions: any[]  A set of substitution values.
repeat(...)
(count: number) => stringReturns a String value that is made from count copies appended together. If count is 0, the empty string is returned.

Parameters
  • count: number  number of copies to append
replace(...)
(searchValue: (string | RegExp), replaceValue: string) => stringReplaces text in a string, using a regular expression or search string.

Parameters
  • searchValue: (string | RegExp)  A string or regular expression to search for.
  • replaceValue: string  A string containing the text to replace. When the searchValue is a RegExp , all matches are replaced if the g flag is set (or only those matches at the beginning, if the y flag is also present). Otherwise, only the first match of searchValue is replaced.
replaceAll(...)
(searchValue: (string | RegExp), replaceValue: string) => stringReplace all instances of a substring in a string, using a regular expression or search string.

Parameters
  • searchValue: (string | RegExp)  A string to search for.
  • replaceValue: string  A string containing the text to replace for every successful match of searchValue in this string.
search(...)
(regexp: (string | RegExp)) => numberFinds the first substring match in a regular expression search.

Parameters
  • regexp: (string | RegExp)  The regular expression pattern and applicable flags.
slice(...)
(start: number, end: number) => stringReturns a section of a string.

Parameters
  • start: number  The index to the beginning of the specified portion of stringObj.
  • end: number  The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. If this value is not specified, the substring continues to the end of stringObj.
split(...)
(separator: (string | RegExp), limit: number) => string[]Split a string into substrings using the specified separator and return them as an array.

Parameters
  • separator: (string | RegExp)  A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
  • limit: number  A value used to limit the number of elements returned in the array.
startsWith(...)
(searchString: string, position: number) => booleanReturns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at position. Otherwise returns false.

Parameters
substring(...)
(start: number, end: number) => stringReturns the substring at the specified location within a String object.

Parameters
  • start: number  The zero-based index number indicating the beginning of the substring.
  • end: number  Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. If end is omitted, the characters from start through the end of the original string are returned.
toLocaleLowerCase(...)
(locales: (string | string[])) => stringConverts all alphabetic characters to lowercase, taking into account the host environment's current locale.

Parameters
toLocaleUpperCase(...)
(locales: (string | string[])) => stringReturns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.

Parameters
toLowerCase()
() => stringConverts all the alphabetic characters in a string to lowercase.
toString()
() => stringOutputs the locale id as a string.
toUpperCase()
() => stringConverts all the alphabetic characters in a string to uppercase.
trim()
() => stringRemoves the leading and trailing white space and line terminator characters from a string.
trimEnd()
() => stringRemoves the trailing white space and line terminator characters from a string.
trimStart()
() => stringRemoves the leading white space and line terminator characters from a string.
valueOf()
() => stringReturns the primitive value of the specified object.
anchor(...)
Deprecated
(name: string) => stringReturns an <​a​> HTML anchor element and sets the name attribute to the text value
Deprecated: A legacy feature for browser compatibility

Parameters
big()
Deprecated
() => stringReturns a <​big​> HTML element
Deprecated: A legacy feature for browser compatibility
() => stringReturns a <​blink​> HTML element
Deprecated: A legacy feature for browser compatibility
bold()
Deprecated
() => stringReturns a <​b​> HTML element
Deprecated: A legacy feature for browser compatibility
fixed()
Deprecated
() => stringReturns a <​tt​> HTML element
Deprecated: A legacy feature for browser compatibility
fontcolor(...)
Deprecated
(color: string) => stringReturns a <​font​> HTML element and sets the color attribute value
Deprecated: A legacy feature for browser compatibility

Parameters
fontsize(...)
Deprecated
(size: number) => stringReturns a <​font​> HTML element and sets the size attribute value
Deprecated: A legacy feature for browser compatibility

Parameters
italics()
Deprecated
() => stringReturns an <​i​> HTML element
Deprecated: A legacy feature for browser compatibility
(url: string) => stringReturns an <​a​> HTML element and sets the href attribute value
Deprecated: A legacy feature for browser compatibility

Parameters
small()
Deprecated
() => stringReturns a <​small​> HTML element
Deprecated: A legacy feature for browser compatibility
strike()
Deprecated
() => stringReturns a <​strike​> HTML element
Deprecated: A legacy feature for browser compatibility
sub()
Deprecated
() => stringReturns a <​sub​> HTML element
Deprecated: A legacy feature for browser compatibility
substr(...)
Deprecated
(from: number, length: number) => stringGets a substring beginning at the specified location and having the specified length.
Deprecated: A legacy feature for browser compatibility

Parameters
  • from: number  The starting position of the desired substring. The index of the first character in the string is zero.
  • length: number  The number of characters to include in the returned substring.
sup()
Deprecated
() => stringReturns a <​sup​> HTML element
Deprecated: A legacy feature for browser compatibility
trimLeft()
Deprecated
() => stringRemoves the leading white space and line terminator characters from a string.
Deprecated: A legacy feature for browser compatibility. Use trimStart instead
trimRight()
Deprecated
() => stringRemoves the trailing white space and line terminator characters from a string.
Deprecated: A legacy feature for browser compatibility. Use trimEnd instead

Types Documentation

No types to document for items on this page.


Except where otherwise noted, content on this site is licensed under MIT License.