Skip to content

SiLocaleId Service documentation

import { SiLocaleId } from '@siemens/element-ng/localization';

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

NameTypeDescription
[Symbol.iterator]()inherited
() => StringIterator<string>

Iterator

anchor()inheriteddeprecated
(name: string) => string

Returns an <a> HTML anchor element and sets the name attribute to the text value

Deprecated: A legacy feature for browser compatibility

Parameters
at()inherited
(index: number) => string | undefined

Returns a new String consisting of the single UTF-16 code unit located at the specified index.

Parameters
  • The zero-based index of the desired code unit. A negative index will count back from the last item.

    index: number

big()inheriteddeprecated
() => string

Returns a <big> HTML element

Deprecated: A legacy feature for browser compatibility

bold()inheriteddeprecated
() => string

Returns a <b> HTML element

Deprecated: A legacy feature for browser compatibility

charAt()inherited
(pos: number) => string

Returns the character at the specified index.

Inherited from String

Parameters
  • The zero-based index of the desired character.

    pos: number

charCodeAt()inherited
(index: number) => number

Returns the Unicode value of the character at the specified location.

Inherited from String

Parameters
  • The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.

    index: number

codePointAt()inherited
(pos: number) => number | undefined

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()inherited
(...strings: string[]) => string

Returns a string that contains the concatenation of two or more strings.

Inherited from String

Parameters
  • The strings to append to the end of the string.

    strings: string[]

    rest
endsWith()inherited
(searchString: string, endPosition?: number) => boolean

Returns 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
fixed()inheriteddeprecated
() => string

Returns a <tt> HTML element

Deprecated: A legacy feature for browser compatibility

fontcolor()inheriteddeprecated
(color: string) => string

Returns a <font> HTML element and sets the color attribute value

Deprecated: A legacy feature for browser compatibility

Parameters
fontsize()inheriteddeprecated
(size: number) => string
(size: string) => string

Returns a <font> HTML element and sets the size attribute value

Deprecated: A legacy feature for browser compatibility

Parameters
Parameters
fromCharCode()inherited
(...codes: number[]) => string
Parameters
fromCharCode()staticinherited
(...codes: number[]) => string
Parameters
fromCodePoint()inherited
(...codePoints: number[]) => string

Return the String value whose elements are, in order, the elements in the List elements. If length is 0, the empty string is returned.

Parameters
fromCodePoint()staticinherited
(...codePoints: number[]) => string

Return 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()inherited
(searchString: string, position?: number) => boolean

Returns 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
  • search string

    searchString: string

  • If position is undefined, 0 is assumed, so as to search all of the String.

    position?: number

indexOf()inherited
(searchString: string, position?: number) => number

Returns the position of the first occurrence of a substring, or -1 if it is not present.

Inherited from String

Parameters
  • The substring to search for in the string

    searchString: string

  • The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.

    position?: number

isWellFormed()inherited
() => boolean

Returns true if all leading surrogates and trailing surrogates appear paired and in order.

italics()inheriteddeprecated
() => string

Returns an <i> HTML element

Deprecated: A legacy feature for browser compatibility

lastIndexOf()inherited
(searchString: string, position?: number) => number

Returns the last occurrence of a substring in the string, or -1 if it is not present.

Inherited from String

Parameters
  • The substring to search for.

    searchString: string

  • The index at which to begin searching. If omitted, the search begins at the end of the string.

    position?: number

(readonly) lengthinherited
number

Returns the length of a String object.

Inherited from String

localeCompare()inherited
(that: string) => number
(that: string, locales?: string | string[], options?: Intl.CollatorOptions) => number
(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions) => number

Determines whether two strings are equivalent in the current locale.

Inherited from String

Parameters
  • String to compare to target string

    that: string

Determines whether two strings are equivalent in the current or specified locale.

Parameters
  • String to compare to target string

    that: string

  • A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.

    locales?: string | string[]

  • An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.

    options?: Intl.CollatorOptions

Determines whether two strings are equivalent in the current or specified locale.

Parameters
  • String to compare to target string

    that: string

  • A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.

    locales?: Intl.LocalesArgument

  • An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.

    options?: Intl.CollatorOptions

match()inherited
(regexp: string | RegExp) => RegExpMatchArray | null
(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }) => RegExpMatchArray | null

Matches a string with a regular expression, and returns an array containing the results of that search.

Inherited from String

Parameters
  • A variable name or string literal containing the regular expression pattern and flags.

    regexp: string | RegExp

Matches a string or an object that supports being matched against, and returns an array containing the results of that search, or null if no matches are found.

Parameters
  • An object that supports being matched against.

    matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }

matchAll()inherited
(regexp: RegExp) => RegExpStringIterator<RegExpExecArray>

Matches a string with a regular expression, and returns an iterable of matches containing the results of that search.

Parameters
normalize()inherited
(form: "NFC" | "NFD" | "NFKC" | "NFKD") => string
(form?: string) => string

Returns 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
  • Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"

    form: "NFC" | "NFD" | "NFKC" | "NFKD"

Parameters
  • Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default is "NFC"

    form?: string

padEnd()inherited
(maxLength: number, fillString?: string) => string

Pads 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
  • 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.

    maxLength: number

  • 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).

    fillString?: string

padStart()inherited
(maxLength: number, fillString?: string) => string

Pads 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
  • 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.

    maxLength: number

  • 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).

    fillString?: string

raw()inherited
(template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string

String.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
  • A well-formed template string call site representation.

    template: { raw: readonly string[] | ArrayLike<string>; }

  • A set of substitution values.

    substitutions: any[]

    rest
raw()staticinherited
(template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string

String.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
  • A well-formed template string call site representation.

    template: { raw: readonly string[] | ArrayLike<string>; }

  • A set of substitution values.

    substitutions: any[]

    rest
repeat()inherited
(count: number) => string

Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned.

Parameters
  • number of copies to append

    count: number

replace()inherited
(searchValue: string | RegExp, replaceValue: string) => string
(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string
(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string) => string
(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string) => string

Replaces text in a string, using a regular expression or search string.

Inherited from String

Parameters
  • A string or regular expression to search for.

    searchValue: string | RegExp

  • 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.

    replaceValue: string

Parameters
  • A string to search for.

    searchValue: string | RegExp

  • A function that returns the replacement text.

    replacer: (substring: string, ...args: any[]) => string

Passes a string and replaceValue to the [Symbol.replace] method on searchValue. This method is expected to implement its own replacement algorithm.

Parameters
  • An object that supports searching for and replacing matches within a string.

    searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }

  • The replacement text.

    replaceValue: string

Replaces text in a string, using an object that supports replacement within a string.

Parameters
  • A object can search for and replace matches within a string.

    searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }

  • A function that returns the replacement text.

    replacer: (substring: string, ...args: any[]) => string

replaceAll()inherited
(searchValue: string | RegExp, replaceValue: string) => string
(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string

Replace all instances of a substring in a string, using a regular expression or search string.

Parameters
  • A string to search for.

    searchValue: string | RegExp

  • A string containing the text to replace for every successful match of searchValue in this string.

    replaceValue: string

Parameters
  • A string to search for.

    searchValue: string | RegExp

  • A function that returns the replacement text.

    replacer: (substring: string, ...args: any[]) => string

search()inherited
(regexp: string | RegExp) => number
(searcher: { [Symbol.search](string: string): number; }) => number

Finds the first substring match in a regular expression search.

Inherited from String

Parameters
  • The regular expression pattern and applicable flags.

    regexp: string | RegExp

Parameters
  • An object which supports searching within a string.

    searcher: { [Symbol.search](string: string): number; }

slice()inherited
(start?: number, end?: number) => string

Returns a section of a string.

Inherited from String

Parameters
  • The index to the beginning of the specified portion of stringObj.

    start?: 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.

    end?: number

small()inheriteddeprecated
() => string

Returns a <small> HTML element

Deprecated: A legacy feature for browser compatibility

split()inherited
(separator: string | RegExp, limit?: number) => string[]
(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number) => string[]

Split a string into substrings using the specified separator and return them as an array.

Inherited from String

Parameters
  • 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.

    separator: string | RegExp

  • A value used to limit the number of elements returned in the array.

    limit?: number

Parameters
  • An object that can split a string.

    splitter: { [Symbol.split](string: string, limit?: number): string[]; }

  • A value used to limit the number of elements returned in the array.

    limit?: number

startsWith()inherited
(searchString: string, position?: number) => boolean

Returns 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
strike()inheriteddeprecated
() => string

Returns a <strike> HTML element

Deprecated: A legacy feature for browser compatibility

sub()inheriteddeprecated
() => string

Returns a <sub> HTML element

Deprecated: A legacy feature for browser compatibility

substr()inheriteddeprecated
(from: number, length?: number) => string

Gets a substring beginning at the specified location and having the specified length.

Deprecated: A legacy feature for browser compatibility

Inherited from String

Parameters
  • The starting position of the desired substring. The index of the first character in the string is zero.

    from: number

  • The number of characters to include in the returned substring.

    length?: number

substring()inherited
(start: number, end?: number) => string

Returns the substring at the specified location within a String object.

Inherited from String

Parameters
  • The zero-based index number indicating the beginning of the substring.

    start: 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.

    end?: number

sup()inheriteddeprecated
() => string

Returns a <sup> HTML element

Deprecated: A legacy feature for browser compatibility

toLocaleLowerCase()inherited
(locales?: string | string[]) => string
(locales?: Intl.LocalesArgument) => string

Converts all alphabetic characters to lowercase, taking into account the host environment's current locale.

Inherited from String

Parameters
Parameters
  • locales?: Intl.LocalesArgument

toLocaleUpperCase()inherited
(locales?: string | string[]) => string
(locales?: Intl.LocalesArgument) => string

Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.

Inherited from String

Parameters
Parameters
  • locales?: Intl.LocalesArgument

toLowerCase()
() => string

Converts all the alphabetic characters in a string to lowercase.

Inherited from String

toString()
() => string

Outputs the locale id as a string.

Inherited from String

toUpperCase()inherited
() => string

Converts all the alphabetic characters in a string to uppercase.

Inherited from String

toWellFormed()inherited
() => string

Returns a string where all lone or out-of-order surrogates have been replaced by the Unicode replacement character (U+FFFD).

trim()inherited
() => string

Removes the leading and trailing white space and line terminator characters from a string.

Inherited from String

trimEnd()inherited
() => string

Removes the trailing white space and line terminator characters from a string.

trimLeft()inheriteddeprecated
() => string

Removes the leading white space and line terminator characters from a string.

Deprecated: A legacy feature for browser compatibility. Use trimStart instead

trimRight()inheriteddeprecated
() => string

Removes the trailing white space and line terminator characters from a string.

Deprecated: A legacy feature for browser compatibility. Use trimEnd instead

trimStart()inherited
() => string

Removes the leading white space and line terminator characters from a string.

valueOf()
() => string

Returns the primitive value of the specified object.

Inherited from String


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