[ticket/11574] Load new language files whenever possible

PHPBB3-11574
This commit is contained in:
Joas Schilling 2013-06-10 13:56:32 +02:00
parent f11993c038
commit deac5f53e3

View file

@ -186,11 +186,23 @@ if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_r
} }
// And finally, load the relevant language files // And finally, load the relevant language files
include($phpbb_root_path . 'language/' . $language . '/common.' . $phpEx); $load_lang_files = array('common', 'acp/common', 'acp/board', 'install', 'posting');
include($phpbb_root_path . 'language/' . $language . '/acp/common.' . $phpEx); $new_path = $phpbb_root_path . 'install/update/new/language/' . $language . '/';
include($phpbb_root_path . 'language/' . $language . '/acp/board.' . $phpEx); $old_path = $phpbb_root_path . 'language/' . $language . '/';
include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
include($phpbb_root_path . 'language/' . $language . '/posting.' . $phpEx); // NOTE: we can not use "phpbb_include_updated" as the files uses vars which would be required
// to be global while loading.
foreach ($load_lang_files as $lang_file)
{
if (file_exists($new_path . $lang_file . '.' . $phpEx))
{
include($new_path . $lang_file . '.' . $phpEx);
}
else
{
include($old_path . $lang_file . '.' . $phpEx);
}
}
// usually we would need every single constant here - and it would be consistent. For 3.0.x, use a dirty hack... :( // usually we would need every single constant here - and it would be consistent. For 3.0.x, use a dirty hack... :(