From e15265be3c687d5830a44de38fc2e5311dc00d86 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 26 Jul 2010 22:48:08 -0700 Subject: start at i18n --- boot.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 8d2628845..fc793132b 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(); } + + -- cgit v1.2.3