Skip to main content
Version: 5.x.x

Other tools

Other helper functions exported in @tolgee/core.

getTranslateProps

Takes arguments of t function and returns them in standard object. Use this if you need to wrap t function and use it's arguments.

Example:

function myT(...args) {
const props = getTranslateProps(...args);
console.log(props.key);
return tolgee.t(props);
}

getFallback

Used for parameters that can be single value or array or empty. (e.g. ns).

getFallback(value: FallbackGeneral): string[] | undefined

getFallbackArray

Same as getFallback, but always returns array.

getFallbackArray(value: FallbackGeneral): string[]