Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
eusonlito committed Feb 18, 2017
1 parent 3ee36bf commit 678bb94
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ namespace App\Providers {
}

namespace {
// Change "txt" with your custom gettext function name
function txt($original)
{
$text = app('gettext')->getTranslator()->gettext($original);
static $translator;

if (empty($translator)) {
$translator = app('gettext')->getTranslator();
}

$text = $translator->gettext($original);

if (func_num_args() === 1) {
return $text;
Expand All @@ -101,7 +106,6 @@ namespace {
return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args);
}
}

```

# Configuration
Expand Down

0 comments on commit 678bb94

Please sign in to comment.