Function getFixedT

  • Returns a t function that defaults to given language or namespace. Both params could be arrays of languages or namespaces and will be treated as fallbacks in that case. On the returned function you can like in the t function override the languages or namespaces by passing them in options or by prepending namespace.

    Accepts optional keyPrefix that will be automatically applied to returned t function.

    Type Parameters

    • Ns extends Namespace = "translation"

    • TKPrefix extends string = undefined

    • ActualNs extends Namespace = Ns extends null
          ? "translation"
          : Ns

    Parameters

    • Rest ...args: [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix] | [lng: null, ns: Ns, keyPrefix?: TKPrefix]
      Rest

    Returns TFunction<ActualNs, TKPrefix>

Generated using TypeDoc