From 639e3b9f17c9bac668b4ad24bb9861d8006fa396 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 14 Oct 2011 00:44:48 +0200 Subject: [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 --- phpBB/includes/functions_module.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_module.php') 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); } } -- cgit v1.2.1