Skip to content

Commit

Permalink
Fixed translate function __() - now support var replacement in defaul…
Browse files Browse the repository at this point in the history
…t string
  • Loading branch information
Wibeset committed Dec 25, 2010
1 parent ade2a3a commit c2871dd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/Base.php
Expand Up @@ -364,14 +364,10 @@ function __($language_file, $str, $place_holders = array())
if (!isset(app()->parameters['lity']['languages'][$language_file])) {
if ($keys = @include_once(ABSPATH.'app/languages/'.lang().'/'.ucfirst($language_file).".php"))
app()->parameters['lity']['languages'][$language_file] = $keys;
else
return $str;
}

if (!isset(app()->parameters['lity']['languages'][$language_file][$str]))
return $str;

$str = app()->parameters['lity']['languages'][$language_file][$str];
if (isset(app()->parameters['lity']['languages'][$language_file][$str]))
$str = app()->parameters['lity']['languages'][$language_file][$str];

if (strstr($str, "{{")) {
if (preg_match_all('/{{([a-zA-Z0-9_\/]*)}}/', $str, $matchs)) {
Expand Down Expand Up @@ -593,4 +589,4 @@ function redirect_to_404()

redirect_to('');

} // redirect_to_404()
} // redirect_to_404()

0 comments on commit c2871dd

Please sign in to comment.