summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/controllers/l10n_client.php8
-rw-r--r--modules/gallery/helpers/l10n_scanner.php2
-rw-r--r--modules/gallery/helpers/locales.php6
-rw-r--r--modules/gallery/hooks/init_gallery.php2
-rw-r--r--modules/gallery/libraries/Gallery_I18n.php (renamed from modules/gallery/libraries/I18n.php)8
-rw-r--r--modules/gallery/tests/I18n_Test.php6
6 files changed, 16 insertions, 16 deletions
diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php
index 6db67d3b..3801e6aa 100644
--- a/modules/gallery/controllers/l10n_client.php
+++ b/modules/gallery/controllers/l10n_client.php
@@ -24,7 +24,7 @@ class L10n_Client_Controller extends Controller {
access::forbidden();
}
- $locale = I18n::instance()->locale();
+ $locale = Gallery_I18n::instance()->locale();
$input = Input::instance();
$key = $input->post("l10n-message-key");
@@ -36,7 +36,7 @@ class L10n_Client_Controller extends Controller {
if (!$root_message->loaded) {
throw new Exception("@todo bad request data / illegal state");
}
- $is_plural = I18n::is_plural_message(unserialize($root_message->message));
+ $is_plural = Gallery_I18n::is_plural_message(unserialize($root_message->message));
if ($is_plural) {
$plural_forms = l10n_client::plural_forms($locale);
@@ -122,9 +122,9 @@ class L10n_Client_Controller extends Controller {
$calls[$row->key] = array(unserialize($row->message), array());
}
} else {
- $calls = I18n::instance()->call_log();
+ $calls = Gallery_I18n::instance()->call_log();
}
- $locale = I18n::instance()->locale();
+ $locale = Gallery_I18n::instance()->locale();
if ($calls) {
$translations = array();
diff --git a/modules/gallery/helpers/l10n_scanner.php b/modules/gallery/helpers/l10n_scanner.php
index a8059b3a..e36d419d 100644
--- a/modules/gallery/helpers/l10n_scanner.php
+++ b/modules/gallery/helpers/l10n_scanner.php
@@ -37,7 +37,7 @@ class l10n_scanner_Core {
}
}
- $key = I18n::get_message_key($message);
+ $key = Gallery_I18n::get_message_key($message);
if (array_key_exists($key, $cache)) {
return $cache[$key];
}
diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php
index 2de029ff..8d76e333 100644
--- a/modules/gallery/helpers/locales.php
+++ b/modules/gallery/helpers/locales.php
@@ -125,13 +125,13 @@ class locales_Core {
if (empty(self::$locales)) {
self::_init_language_data();
}
- $locale or $locale = I18n::instance()->locale();
+ $locale or $locale = Gallery_I18n::instance()->locale();
return self::$locales["$locale"];
}
static function is_rtl($locale=null) {
- $locale or $locale = I18n::instance()->locale();
+ $locale or $locale = Gallery_I18n::instance()->locale();
list ($language, $territory) = explode('_', $locale . "_");
return in_array($language, array("he", "fa", "ar"));
}
@@ -233,7 +233,7 @@ class locales_Core {
}
// If we have any preference, override the site's default locale
if ($locale) {
- I18n::instance()->locale($locale);
+ Gallery_I18n::instance()->locale($locale);
}
}
diff --git a/modules/gallery/hooks/init_gallery.php b/modules/gallery/hooks/init_gallery.php
index b2d9c4de..4ce9bab4 100644
--- a/modules/gallery/hooks/init_gallery.php
+++ b/modules/gallery/hooks/init_gallery.php
@@ -24,7 +24,7 @@ if (!file_exists(VARPATH . "database.php")) {
url::redirect(url::abs_file("installer"));
}
-Event::add("system.ready", array("I18n", "instance"));
+Event::add("system.ready", array("Gallery_I18n", "instance"));
Event::add("system.ready", array("module", "load_modules"));
Event::add("system.ready", array("gallery", "ready"));
Event::add("system.post_routing", array("url", "parse_url"));
diff --git a/modules/gallery/libraries/I18n.php b/modules/gallery/libraries/Gallery_I18n.php
index c3336052..0571fe58 100644
--- a/modules/gallery/libraries/I18n.php
+++ b/modules/gallery/libraries/Gallery_I18n.php
@@ -27,7 +27,7 @@
* @return String The translated message string.
*/
function t($message, $options=array()) {
- return I18n::instance()->translate($message, $options);
+ return Gallery_I18n::instance()->translate($message, $options);
}
/**
@@ -43,11 +43,11 @@ function t($message, $options=array()) {
* @return String The translated message string.
*/
function t2($singular, $plural, $count, $options=array()) {
- return I18n::instance()->translate(array("one" => $singular, "other" => $plural),
+ return Gallery_I18n::instance()->translate(array("one" => $singular, "other" => $plural),
array_merge($options, array("count" => $count)));
}
-class I18n_Core {
+class Gallery_I18n_Core {
private static $_instance;
private $_config = array();
private $_call_log = array();
@@ -64,7 +64,7 @@ class I18n_Core {
if (empty($config['default_locale'])) {
$config['default_locale'] = module::get_var('gallery', 'default_locale');
}
- self::$_instance = new I18n_Core($config);
+ self::$_instance = new Gallery_I18n_Core($config);
}
return self::$_instance;
diff --git a/modules/gallery/tests/I18n_Test.php b/modules/gallery/tests/I18n_Test.php
index 9010606a..d0555cbf 100644
--- a/modules/gallery/tests/I18n_Test.php
+++ b/modules/gallery/tests/I18n_Test.php
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class I18n_Test extends Unit_Test_Case {
+class Gallery_I18n_Test extends Unit_Test_Case {
private $i18n;
public function setup() {
@@ -26,7 +26,7 @@ class I18n_Test extends Unit_Test_Case {
'root_locale' => 'en',
'default_locale' => 'te_ST',
'locale_dir' => VARPATH . 'locale/');
- $this->i18n = I18n::instance($config);
+ $this->i18n = Gallery_I18n::instance($config);
ORM::factory("incoming_translation")
->where("locale", "te_ST")
@@ -43,7 +43,7 @@ class I18n_Test extends Unit_Test_Case {
foreach ($messages_te_ST as $data) {
list ($message, $translation) = $data;
$entry = ORM::factory("incoming_translation");
- $entry->key = I18n::get_message_key($message);
+ $entry->key = Gallery_I18n::get_message_key($message);
$entry->message = serialize($message);
$entry->translation = serialize($translation);
$entry->locale = 'te_ST';