Function t

Function to translate texts.

addDictionary({ es: { hello: 'Hola' } });
setLang('es');
t('hello'); // 'Hola'
  • Parameters

    • text: string

      The text to translate.

    • Optionalcontext: string

      The context of the text.

    Returns string

    The translated text.