summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/default.php1
-rw-r--r--lib/plugin.php7
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/default.php b/lib/default.php
index 6200abada..45e35e83d 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -298,6 +298,7 @@ $default =
'WikiHashtags' => null,
'RSSCloud' => null,
'OpenID' => null),
+ 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
),
'admin' =>
array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license')),
diff --git a/lib/plugin.php b/lib/plugin.php
index ee57f5904..3f84afa27 100644
--- a/lib/plugin.php
+++ b/lib/plugin.php
@@ -88,7 +88,12 @@ class Plugin
$class = get_class($this);
if (substr($class, -6) == 'Plugin') {
$name = substr($class, 0, -6);
- $path = INSTALLDIR . "/plugins/$name/locale";
+ $path = common_config('plugins', 'locale_path');
+ if (!$path) {
+ // @fixme this will fail for things installed in local/plugins
+ // ... but then so will web links so far.
+ $path = INSTALLDIR . "/plugins/$name/locale";
+ }
if (file_exists($path) && is_dir($path)) {
bindtextdomain($name, $path);
bind_textdomain_codeset($name, 'UTF-8');