Ticket 2427: fix regression in plugin i18n

This commit is contained in:
Brion Vibber 2010-07-12 10:27:23 -07:00
parent 974c4df029
commit 1b3b7f9a42

View File

@ -213,16 +213,16 @@ function _mdomain($backtrace)
$plug = strpos($path, '/plugins/'); $plug = strpos($path, '/plugins/');
if ($plug === false) { if ($plug === false) {
// We're not in a plugin; return default domain. // We're not in a plugin; return default domain.
return 'statusnet'; $final = 'statusnet';
} else { } else {
$cut = $plug + 9; $cut = $plug + 9;
$cut2 = strpos($path, '/', $cut); $cut2 = strpos($path, '/', $cut);
if ($cut2) { if ($cut2) {
$cached[$path] = substr($path, $cut, $cut2 - $cut); $final = substr($path, $cut, $cut2 - $cut);
} else { } else {
// We might be running directly from the plugins dir? // We might be running directly from the plugins dir?
// If so, there's no place to store locale info. // If so, there's no place to store locale info.
return 'statusnet'; $final = 'statusnet';
} }
} }
$cached[$path] = $final; $cached[$path] = $final;