summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-10-11 21:49:14 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-10-11 21:49:14 +1100
commitff730c861b7a8c4e5b7502e198cb1a979ad04abd (patch)
treeb3dccbfeb19188faede4e815c08341f254433b69 /inc/functions.php
parente8183e7899cc0dc26d76a8c3e13f17dbf786d701 (diff)
Started on internationalization (i18n)
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index e0163d6f..65a03606 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -5,6 +5,8 @@
exit;
}
+ require 'contrib/gettext/gettext.inc';
+
register_shutdown_function('fatal_error_handler');
loadConfig();
@@ -106,6 +108,15 @@
$_SERVER['REMOTE_ADDR'] = $m[2];
}
+ if(_setlocale(LC_ALL, $config['locale']) === false) {
+ $error = function_exists('error') ? 'error' : 'basic_error_function_because_the_other_isnt_loaded_yet';
+ $error('The specified locale (' . $config['locale'] . ') does not exist on your platform!');
+
+ }
+ _bindtextdomain('tinyboard', './inc/locale');
+ _bind_textdomain_codeset('tinyboard', 'UTF-8');
+ _textdomain('tinyboard');
+
if($config['recaptcha'])
require_once 'inc/contrib/recaptcha/recaptchalib.php';
if($config['cache']['enabled'])
@@ -823,7 +834,7 @@
// Previous button
if($num == 0) {
// There is no previous page.
- $btn['prev'] = 'Previous';
+ $btn['prev'] = _('Previous');
} else {
$loc = ($mod ? '?/' . $board['uri'] . '/' : '') .
($num == 1 ?
@@ -837,12 +848,12 @@
'<input type="hidden" name="status" value="301" />' .
'<input type="hidden" name="r" value="' . htmlentities($loc) . '" />'
:'') .
- '<input type="submit" value="Previous" /></form>';
+ '<input type="submit" value="' . _('Previous') . '" /></form>';
}
if($num == count($pages) - 1) {
// There is no next page.
- $btn['next'] = 'Next';
+ $btn['next'] = _('Next');
} else {
$loc = ($mod ? '?/' . $board['uri'] . '/' : '') . sprintf($config['file_page'], $num + 2);
@@ -851,7 +862,7 @@
'<input type="hidden" name="status" value="301" />' .
'<input type="hidden" name="r" value="' . htmlentities($loc) . '" />'
:'') .
- '<input type="submit" value="Next" /></form>';
+ '<input type="submit" value="' . _('Next') . '" /></form>';
}
}
}