mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Do not automatically load translations from plugins
One shoud use translations import feature instead
This commit is contained in:
parent
c9a81dd174
commit
27ed59eb08
@ -688,30 +688,6 @@ function load_messages($locale)
|
||||
|
||||
$messages[$locale] = $locale_data['messages'];
|
||||
} else {
|
||||
// Load active plugins localization
|
||||
$plugins_list = array_keys(PluginManager::getAllPlugins());
|
||||
|
||||
foreach ($plugins_list as $plugin_name) {
|
||||
// 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}/translation.po";
|
||||
|
||||
// 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
|
||||
// localized strings
|
||||
$messages[$locale] = array_merge(
|
||||
$messages[$locale],
|
||||
$locale_data['messages']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Load localizations from the database
|
||||
$db = Database::getInstance();
|
||||
$db_messages = $db->query(
|
||||
|
Loading…
Reference in New Issue
Block a user