public function withLocale($locale, $callback)
    {
        if (! $locale) {
            return $callback();
        }

        $app = Container::getInstance();

        $original = $app->getLocale();

        try {
            $app->setLocale($locale);

            return $callback();
        } finally {
            $app->setLocale($original);
        }
    }
public function withLocale($locale, $callback)
    {
        if (! $locale) {
            return $callback();
        }

        $app = Container::getInstance();

        $original = $app->getLocale();

        try {
            $app->setLocale($locale);

            return $callback();
        } finally {
            $app->setLocale($original);
        }
    }
public function withLocale ( $ locale , $ callback ) { if ( ! $ locale ) { return $ callback ( ) ; } $ app = Container :: getInstance ( ) ; $ original = $ app -> getLocale ( ) ; try { $ app -> setLocale ( $ locale ) ; return $ callback ( ) ; } finally { $ app -> setLocale ( $ original ) ; } }
Run the callback with the given locale.

@param  string   $locale
@param  \Closure $callback
@return mixed
Run the callback with the given locale .