Created
March 13, 2012 09:32
-
-
Save marc1706/2027828 to your computer and use it in GitHub Desktop.
Check for missing language variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* @package Board3 Portal v2 | |
* @copyright (c) Board3 Group ( www.board3.de ) | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
* | |
*/ | |
/** | |
* @ignore | |
*/ | |
define('IN_PHPBB', true); | |
define('IN_PORTAL', true); | |
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; | |
$phpEx = substr(strrchr(__FILE__, '.'), 1); | |
include($phpbb_root_path . 'common.' . $phpEx); | |
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx); | |
$portal_root_path = PORTAL_ROOT_PATH; | |
// Start session management | |
$user->session_begin(); | |
$auth->acl($user->data); | |
$user->setup(); | |
/** | |
* Initial vars | |
*/ | |
$lang_de = $lang_en = $lang = array(); | |
$output = ''; | |
$cur_file = 'mods/info_acp_portal'; | |
/** | |
* now include all English language variables from specified file | |
*/ | |
include($phpbb_root_path . 'language/en/' . $cur_file . '.' . $phpEx); | |
$lang_en = $lang; | |
$lang = array(); | |
/** | |
* now include all German language variables from specified file | |
*/ | |
include($phpbb_root_path . 'language/de/' . $cur_file . '.' . $phpEx); | |
$lang_de = $lang; | |
$lang = array(); | |
/** | |
* now compare English to German language | |
*/ | |
foreach($lang_en as $key => $var) | |
{ | |
if (!isset($lang_de[$key])) | |
{ | |
$output .= 'Language variable ' . $key . ' does not exist in the German language file, but in the English one!<br />'; | |
} | |
} | |
/** | |
* now compare German to English language | |
*/ | |
foreach($lang_de as $key => $var) | |
{ | |
if (!isset($lang_en[$key])) | |
{ | |
$output .= 'Language variable ' . $key . ' does not exist in the English language file, but in the German one!<br />'; | |
} | |
} | |
trigger_error($output); | |
page_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment