wrap

Wraps the given base context with a TolgeeContextWrapper that uses the global singleton instance of Tolgee.

This method is a convenience function for cases where attachBaseContext provides a nullable context. If base is null, it falls back to returning a regular ContextWrapper.

Return

A wrapped ContextWrapper with Tolgee support, or a regular ContextWrapper if Tolgee is unavailable.

Parameters

base

The context to wrap, which may be null.


Wraps the given base context with a TolgeeContextWrapper using the provided tolgee instance.

This method allows explicitly specifying a Tolgee instance for cases where dependency injection or multiple Tolgee instances are needed. If base is null, it falls back to returning a regular ContextWrapper.

Return

A wrapped ContextWrapper with Tolgee support, or a regular ContextWrapper if base is null.

Parameters

base

The context to wrap, which may be null.

tolgee

The Tolgee translation service instance to use for retrieving localized strings.