X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Flang%2Fgettext.php;h=dfa778e32e07cc6ab84bdabb8453ca50c9da07f8;hb=2ae4762cbcd0479ecdf8f13317a7d76da08f114f;hp=78e7b68720b1eccab49d0e47ce54015df9376f9f;hpb=20be871bac38cfbee474e5cc3e388100aa343fb1;p=fa-stable.git diff --git a/includes/lang/gettext.php b/includes/lang/gettext.php index 78e7b687..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; } @@ -534,9 +542,14 @@ class gettext_php_support_compiler } } -/** -* get_text related error. +/* + Set current gettext domain path */ -//class GetText_Error extends PEAR_Error {} +function set_ext_domain($path='') { + global $path_to_root; + $_SESSION['get_text']->add_domain($_SESSION['language']->code, + $path_to_root . ($path ? '/' : '') .$path.'/lang', + $path ? '' : $_SESSION['language']->version); +} ?>