[ticket/14317] Make it easier to change the language iso tag

PHPBB3-14317
This commit is contained in:
Joas Schilling 2015-11-28 11:36:05 +01:00
parent 941d138650
commit 0c66d4816a

View file

@ -11,18 +11,13 @@
* *
*/ */
// define('LANGUAGE_TO_MIGRATE', 'en');
// Security message:
// # NO CHANGES BELOW THIS LINE
// This script is potentially dangerous.
// Remove or comment the next line (die(".... ) to enable this script.
// Do NOT FORGET to either remove this script or disable it after you have used it.
//
#die("Please read the first lines of this script for instructions on how to enable it");
define('IN_PHPBB', true); define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1); $phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path='./../'; $phpbb_root_path = './../';
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
$help_bbcode = load_help('bbcode'); $help_bbcode = load_help('bbcode');
@ -239,7 +234,7 @@ trigger_error('Successfully migrated help_bbcode and help_faq to help/bbcode and
function load_help($help) function load_help($help)
{ {
global $phpbb_root_path; global $phpbb_root_path;
include($phpbb_root_path . 'language/en/help_' . $help . '.php'); include($phpbb_root_path . 'language/' . LANGUAGE_TO_MIGRATE . '/help_' . $help . '.php');
return $help; return $help;
} }
@ -250,7 +245,7 @@ function load_help($help)
function write_help($help, array $lang) function write_help($help, array $lang)
{ {
global $phpbb_root_path; global $phpbb_root_path;
$fp = fopen($phpbb_root_path . 'language/en/help/' . $help . '.php', 'wb'); $fp = fopen($phpbb_root_path . 'language/' . LANGUAGE_TO_MIGRATE . '/help/' . $help . '.php', 'wb');
fwrite($fp, get_language_file_header()); fwrite($fp, get_language_file_header());
fwrite($fp, '$lang = array_merge($lang, array(' . "\n"); fwrite($fp, '$lang = array_merge($lang, array(' . "\n");