Skip to main content
Version: Next

FetchT

fetchT

Fetches the translation function for the given locale and namespace.

Example

const t = fetchT('en-US', 'common');
const translated = t('hello'); // Translates 'hello' in the 'en-US' locale
Signature
function fetchT(lng: string | string[], ns?: string | null, keyPrefix?: string): TFunction

Parameters

lng

parameter
string | string[]

ns

parameter
string | null

keyPrefix

parameter
string