diff options
author | Nils Adermann <naderman@naderman.de> | 2011-10-14 00:44:48 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2011-10-14 00:44:48 +0200 |
commit | 639e3b9f17c9bac668b4ad24bb9861d8006fa396 (patch) | |
tree | 5be967133d7c513083633b910bcae9bdc2767af3 /phpBB/includes/functions_module.php | |
parent | 724f40f0f4fdfc47764a069cc91f045f0c67f4fb (diff) | |
download | forums-639e3b9f17c9bac668b4ad24bb9861d8006fa396.tar forums-639e3b9f17c9bac668b4ad24bb9861d8006fa396.tar.gz forums-639e3b9f17c9bac668b4ad24bb9861d8006fa396.tar.bz2 forums-639e3b9f17c9bac668b4ad24bb9861d8006fa396.tar.xz forums-639e3b9f17c9bac668b4ad24bb9861d8006fa396.zip |
[feature/extension-manager] Support for loading language files from extensions
The referenced extension needs to be explicitly specified in an add_lang_ext()
call.
PHPBB3-10323
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r-- | phpBB/includes/functions_module.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 9226a75d4c..946e7d2b8d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -865,7 +865,7 @@ class p_master function add_mod_info($module_class) { global $user, $phpEx; - +/* if (file_exists($user->lang_path . $user->lang_name . '/mods')) { $add_files = array(); @@ -888,6 +888,23 @@ class p_master { $user->add_lang($add_files); } + }*/ + + global $phpbb_extension_manager; + + $finder = $phpbb_extension_manager->get_finder(); + + $lang_files = $finder + ->prefix('info_' . strtolower($module_class) . '_') + ->suffix(".$phpEx") + ->directory('/language/' . $user->lang_name) + ->default_path('language/' . $user->lang_name . '/mods/') + ->default_directory('') + ->find(); + + foreach ($lang_files as $lang_file => $ext_name) + { + $user->add_lang_ext($ext_name, $lang_file); } } |