Translator

Object to work with translations

Used for the localization of strings.

Hierarchy

  • Translator

Methods

T

  • T(str: string): string
  • T(str: string, locale: string): Promise<string>
  • The method returns the string translation based on the provided locale.

    // Get company's locale 
    const lang = await System.company. getLanguage(); 
    const locale = lang.code; 
    // Translate string 
    const res =  SR.T('hello', locale); 
    

    Parameters

    • str: string

    Returns string

    Translation of the string.

  • The method returns the string translation based on the provided locale.

    // Get company's locale 
    const lang = await System.company. getLanguage(); 
    const locale = lang.code; 
    // Translate string 
    const res =  SR.T('hello', locale); 
    

    Parameters

    • str: string
    • locale: string

    Returns Promise<string>

    Translation of the string.