summaryrefslogtreecommitdiff
path: root/lib/language.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-06-07 10:19:40 -0700
committerBrion Vibber <brion@pobox.com>2010-06-07 10:19:40 -0700
commitd88b208edcb75ec864e09bb3ab29785b35064400 (patch)
tree6a3b2eb35fb792bffb7ebaf3b4f81fb1131466d1 /lib/language.php
parenta7e33ac89df9f05b7497bfb34c6e69b3329a87e5 (diff)
parent41e9dba7297d43b7de0cb7665901869910d1047a (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts: plugins/OpenID/openid.php
Diffstat (limited to 'lib/language.php')
-rw-r--r--lib/language.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/language.php b/lib/language.php
index 5a2818133..1805707ad 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -61,7 +61,7 @@ if (!function_exists('dpgettext')) {
* Not currently exposed in PHP's gettext module; implemented to be compat
* with gettext.h's macros.
*
- * @param string $domain domain identifier, or null for default domain
+ * @param string $domain domain identifier
* @param string $context context identifier, should be some key like "menu|file"
* @param string $msgid English source text
* @return string original or translated message
@@ -106,7 +106,7 @@ if (!function_exists('dnpgettext')) {
* Not currently exposed in PHP's gettext module; implemented to be compat
* with gettext.h's macros.
*
- * @param string $domain domain identifier, or null for default domain
+ * @param string $domain domain identifier
* @param string $context context identifier, should be some key like "menu|file"
* @param string $msg singular English source text
* @param string $plural plural English source text
@@ -180,7 +180,11 @@ function _m($msg/*, ...*/)
}
/**
- * Looks for which plugin we've been called from to set the gettext domain.
+ * Looks for which plugin we've been called from to set the gettext domain;
+ * if not in a plugin subdirectory, we'll use the default 'statusnet'.
+ *
+ * Note: we can't return null for default domain since most of the PHP gettext
+ * wrapper functions turn null into "" before passing to the backend library.
*
* @param array $backtrace debug_backtrace() output
* @return string
@@ -208,8 +212,8 @@ function _mdomain($backtrace)
}
$plug = strpos($path, '/plugins/');
if ($plug === false) {
- // We're not in a plugin; return null for the default domain.
- return null;
+ // We're not in a plugin; return default domain.
+ return 'statusnet';
} else {
$cut = $plug + 9;
$cut2 = strpos($path, '/', $cut);
@@ -218,7 +222,7 @@ function _mdomain($backtrace)
} else {
// We might be running directly from the plugins dir?
// If so, there's no place to store locale info.
- return null;
+ return 'statusnet';
}
}
$cached[$path] = $final;