diff --git a/boot.php b/boot.php index 8d2628845a..fc793132b8 100644 --- a/boot.php +++ b/boot.php @@ -39,6 +39,7 @@ class App { public $argc; public $module; public $pager; + public $strings; private $scheme; private $hostname; @@ -175,6 +176,19 @@ function replace_macros($s,$r) { }} +function load_translation_table($lang) { + global $a; + +} + + +function t($s) { + global $a; + + if($a->strings[$s]) + return $a->strings[$s]; + return $s; +} if(! function_exists('fetch_url')) { function fetch_url($url,$binary = false) { @@ -430,9 +444,9 @@ function paginate(&$a) { if($a->pager['total'] > $a->pager['itemspage']) { $o .= '
'; if($a->pager['page'] != 1) - $o .= ''."pager['page'] - 1).'">prev '; + $o .= ''."pager['page'] - 1).'">' . t('prev') . ' '; - $o .= "first "; + $o .= "" . t('first') . " "; $numpages = $a->pager['total'] / $a->pager['itemspage']; @@ -461,10 +475,10 @@ function paginate(&$a) { } $lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages); - $o .= "last "; + $o .= "" . t('last') . " "; if(($a->pager['total'] - ($a->pager['itemspage'] * $a->pager['page'])) > 0) - $o .= ''."pager['page'] + 1).'">next'; + $o .= ''."pager['page'] + 1).'">' . t('next') . ''; $o .= '
'."\r\n"; } return $o; @@ -481,3 +495,5 @@ function expand_acl($s) { } return array(); } + + diff --git a/include/auth.php b/include/auth.php index 513d717e3e..8e9d19d8a9 100644 --- a/include/auth.php +++ b/include/auth.php @@ -10,7 +10,7 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] == 'login'))) { unset($_SESSION['is_visitor']); unset($_SESSION['administrator']); unset($_SESSION['cid']); - $_SESSION['sysmsg'] = "Logged out." . EOL; + $_SESSION['sysmsg'] = t("Logged out.") . EOL; goaway($a->get_baseurl()); } if(x($_SESSION,'uid')) { @@ -50,7 +50,7 @@ else { dbesc(trim($_POST['login-name'])), dbesc($encrypted)); if(($r === false) || (! count($r))) { - $_SESSION['sysmsg'] = 'Login failed.' . EOL ; + $_SESSION['sysmsg'] = t('Login failed.') . EOL ; goaway($a->get_baseurl()); } $_SESSION['uid'] = $r[0]['uid']; @@ -58,7 +58,7 @@ else { $_SESSION['authenticated'] = 1; $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname']; - $_SESSION['sysmsg'] = "Welcome back " . $r[0]['username'] . EOL; + $_SESSION['sysmsg'] = t("Welcome back ") . $r[0]['username'] . EOL; $a->user = $r[0]; if(strlen($a->user['timezone'])) date_default_timezone_set($a->user['timezone']); diff --git a/include/nav.php b/include/nav.php index 0dc0f6029e..a47d55d9a2 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,8 +1,7 @@ - page['nav'] .= "Logout\r\n"; + $a->page['nav'] .= "" . t('Logout') . "\r\n"; } $a->page['nav'] .= "\r\n";