From 652749ddedebe179eb3e3ec7cc55b0f39539b98b Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 30 Oct 2010 13:34:18 +0000 Subject: [PATCH] Normalized add_domain() params in native phpgettext classes --- includes/lang/gettext.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/lang/gettext.php b/includes/lang/gettext.php index 3dc2e88d..dfa778e3 100644 --- a/includes/lang/gettext.php +++ b/includes/lang/gettext.php @@ -60,6 +60,7 @@ function is_error($err) { class gettext_native_support { var $_interpolation_vars = array(); + var $domain_path; /** * Set gettext language code. @@ -125,6 +126,8 @@ class gettext_native_support */ function add_domain($domain, $path=false, $version='') { + if ($path === false) + $path = $this->domain_path; if ($path === false) $path = "./locale"; if ($domain == "") @@ -293,8 +296,13 @@ class gettext_php_support extends gettext_native_support * @param string $path optional -- Repository path * @throws GetText_Error */ - function add_domain($domain, $path = "./locale/", $version ='') + function add_domain($domain, $path = false, $version ='') { + if ($path === false) + $path = $this->domain_path; + if ($path === false) + $path = "./locale"; + if ($version) { $domain .= '-'.$version; } -- 2.30.2