Utility Functions

translate()

The translate() function allows you to translate a single key without needing to inject the TranslocoService each time.

import { translate } from '@jsverse/transloco';

translate('hello');

translateObject()

The translateObject() function allows you to translate an entire object, similarly to the translate() function, without needing to inject the service.

import { translateObject } from '@jsverse/transloco';

translateObject('some.object');

getBrowserLang()

The getBrowserLang() function returns the language code (e.g., "en") detected from the user's browser settings.

import { getBrowserLang } from '@jsverse/transloco';

getBrowserLang();

getBrowserCultureLang()

The getBrowserCultureLang() function returns the culture language code (e.g., "en-US") detected from the user's browser settings.

import { getBrowserCultureLang } from '@jsverse/transloco';

getBrowserCultureLang();

Last updated

Was this helpful?