From 96447cedc1f9558d098a15818dc5047ff71a6c8f Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 27 Feb 2014 09:20:38 +0000 Subject: [PATCH] Fix plugins localization --- src/mibew/libs/common/locale.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mibew/libs/common/locale.php b/src/mibew/libs/common/locale.php index 2bb18b16..566ed251 100644 --- a/src/mibew/libs/common/locale.php +++ b/src/mibew/libs/common/locale.php @@ -197,8 +197,15 @@ function load_messages($locale) $plugins_list = array_keys(PluginManager::getAllPlugins()); foreach ($plugins_list as $plugin_name) { - $locale_file = MIBEW_FS_ROOT . - "/plugins/{$plugin_name}/locales/{$locale}/properties"; + // Build plugin path + list($vendor_name, $plugin_short_name) = explode(':', $plugin_name, 2); + $plugin_name_parts = explode('_', $plugin_short_name); + $locale_file = MIBEW_FS_ROOT + . "/plugins/" . ucfirst($vendor_name) . "/Mibew/Plugin/" + . implode('', array_map('ucfirst', $plugin_name_parts)) + . "/locales/{$locale}/properties"; + + // Get localized strings if (is_readable($locale_file)) { $locale_data = read_locale_file($locale_file); // array_merge used to provide an ability for plugins to override