Utility Functions
translate()
translate()
The translate()
function allows you to translate a single key without needing to inject the TranslocoService
each time.
Important
This function is a proxy to the TranslocoService.translate
method. It will not work if the service hasn't been initialized.
Ensure that the translation files are successfully loaded before calling this method.
translateObject()
translateObject()
The translateObject()
function allows you to translate an entire object, similarly to the translate()
function, without needing to inject the service.
Important
This function is a proxy to the TranslocoService.translateObject
method. It will not work if the service hasn't been initialized.
Ensure that the translation files are successfully loaded before calling this method.
getBrowserLang()
getBrowserLang()
The getBrowserLang()
function returns the language code (e.g., "en"
) detected from the user's browser settings.
getBrowserCultureLang()
getBrowserCultureLang()
The getBrowserCultureLang()
function returns the culture language code (e.g., "en-US"
) detected from the user's browser settings.
Last updated