concrete/src/Localization/Localization.php
public function withContext($context, callable $callback)
    {
        $this->pushActiveContext($context);
        try {
            return $callback();
        } finally {
            try {
                $this->popActiveContext();
            } catch (Exception $x) {
            } catch (Throwable $x) {
            }
        }
    }
public function withContext($context, callable $callback)
    {
        $this->pushActiveContext($context);
        try {
            return $callback();
        } finally {
            try {
                $this->popActiveContext();
            } catch (Exception $x) {
            } catch (Throwable $x) {
            }
        }
    }
public function withContext ( $ context , callable $ callback ) { $ this -> pushActiveContext ( $ context ) ; try { return $ callback ( ) ; } finally { try { $ this -> popActiveContext ( ) ; } catch ( Exception $ x ) { } catch ( Throwable $ x ) { } } }
Execute a function using a specific localization context.

@param string $context The translation context to use when running $callback (default contexts are defined by the Localization::CONTEXT_... constants).
@param callable $callback

@return mixed return the result of $callback

@since concrete5 8.5.0a2
Execute a function using a specific localization context .