summaryrefslogtreecommitdiff
path: root/library/WT/I18N.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/WT/I18N.php')
-rw-r--r--library/WT/I18N.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/library/WT/I18N.php b/library/WT/I18N.php
index aeb7a24b35..050dda342d 100644
--- a/library/WT/I18N.php
+++ b/library/WT/I18N.php
@@ -9,7 +9,7 @@
// We wrap the Zend_Translate gettext library, to allow us to add extra
// functionality, such as mixed RTL and LTR text.
//
-// Copyright (C) 2013 Greg Roach
+// Copyright (C) 2014 Greg Roach
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
@@ -133,22 +133,22 @@ class WT_I18N {
self::$translation_adapter = new Zend_Translate('gettext', WT_ROOT.'language/'.$locale.'.mo', $locale);
// Deprecated - some custom modules use this to add translations
- Zend_Registry::set('Zend_Translate', self::$translation_adapter);
+ Zend_Registry::set('Zend_Translate', WT_I18N::$translation_adapter);
// Load any local user translations
if (is_dir(WT_DATA_DIR.'language')) {
if (file_exists(WT_DATA_DIR.'language/'.$locale.'.mo')) {
- self::$translation_adapter->addTranslation(
+ WT_I18N::addTranslation(
new Zend_Translate('gettext', WT_DATA_DIR.'language/'.$locale.'.mo', $locale)
);
}
if (file_exists(WT_DATA_DIR.'language/'.$locale.'.php')) {
- self::$translation_adapter->addTranslation(
+ WT_I18N::addTranslation(
new Zend_Translate('array', WT_DATA_DIR.'language/'.$locale.'.php', $locale)
);
}
if (file_exists(WT_DATA_DIR.'language/'.$locale.'.csv')) {
- self::$translation_adapter->addTranslation(
+ WT_I18N::addTranslation(
new Zend_Translate('csv', WT_DATA_DIR.'language/'.$locale.'.csv', $locale)
);
}
@@ -187,6 +187,11 @@ class WT_I18N {
return $locale;
}
+ // Add a translation file
+ public static function addTranslation(Zend_Translate $translation) {
+ WT_I18N::$translation_adapter->addTranslation($translation);
+ }
+
// Check which languages are installed
public static function installed_languages() {
$mo_files=glob(WT_ROOT.'language'.DIRECTORY_SEPARATOR.'*.mo');