Example #1
0
foreach ($defined as $key => $valuecount) {
    foreach ($valuecount as $value => $count) {
        if (!@$definite[$key][$value] && !@$probable[$key][$value] && !@$possible[$value]) {
            output_lang_issue($key, $value, 'defined but apparently not used');
        }
    }
}
foreach ($backmap as $phrase => $where) {
    if (count($where) > 1) {
        foreach ($where as $onewhere) {
            output_lang_issue($onewhere['prefix'], $onewhere['key'], 'contains the shared phrase "' . $phrase . '"', false);
        }
    }
}
require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
$languages = qa_admin_language_options();
unset($languages['']);
foreach ($languages as $code => $language) {
    echo '<H1>Checking ' . $language . ' files in <code>qa-lang/' . $code . '</code>...</H1>';
    $langdefined = array();
    $langdifferent = array();
    $langsubstitutions = array();
    $langincludefiles = glob(QA_LANG_DIR . $code . '/qa-*.php');
    $langnewphrases = array();
    output_start_includes();
    foreach ($langincludefiles as $langincludefile) {
        if (preg_match('/qa-lang-([a-z]+)\\.php$/', $langincludefile, $matches)) {
            // it's a lang file
            $prefix = $matches[1];
            output_reading_include($langincludefile);
            $phrases = @(include $langincludefile);
 $type = @$optiontype[$optionname];
 if ($type == 'number-blank') {
     $type = 'number';
 }
 $value = $options[$optionname];
 $optionfield = array('id' => $optionname, 'label' => ($indented ? '&ndash; ' : '') . qa_lang_html('options/' . $optionname), 'tags' => 'name="option_' . $optionname . '" id="option_' . $optionname . '"', 'value' => qa_html($value), 'type' => $type, 'error' => qa_html(@$errors[$optionname]));
 if (isset($optionmaximum[$optionname])) {
     $optionfield['note'] = qa_lang_html_sub('admin/maximum_x', $optionmaximum[$optionname]);
 }
 $feedrequest = null;
 $feedisexample = false;
 switch ($optionname) {
     // special treatment for certain options
     case 'site_language':
         require_once QA_INCLUDE_DIR . 'qa-util-string.php';
         qa_optionfield_make_select($optionfield, qa_admin_language_options(), $value, '');
         $optionfield['suffix'] = strtr(qa_lang_html('admin/check_language_suffix'), array('^1' => '<a href="' . qa_html(qa_path_to_root() . 'qa-include/qa-check-lang.php') . '">', '^2' => '</a>'));
         if (!qa_has_multibyte()) {
             $optionfield['error'] = qa_lang_html('admin/no_multibyte');
         }
         break;
     case 'neat_urls':
         $neatoptions = array();
         $rawoptions = array(QA_URL_FORMAT_NEAT, QA_URL_FORMAT_INDEX, QA_URL_FORMAT_PARAM, QA_URL_FORMAT_PARAMS, QA_URL_FORMAT_SAFEST);
         foreach ($rawoptions as $rawoption) {
             $neatoptions[$rawoption] = '<iframe src="' . qa_path_html('url/test/' . QA_URL_TEST_STRING, array('dummy' => '', 'param' => QA_URL_TEST_STRING), null, $rawoption) . '" width="20" height="16" style="vertical-align:middle; border:0" scrolling="no" frameborder="0"></iframe>&nbsp;' . '<small>' . qa_html(urldecode(qa_path('123/why-do-birds-sing', null, '/', $rawoption))) . ($rawoption == QA_URL_FORMAT_NEAT ? strtr(qa_lang_html('admin/neat_urls_note'), array('^1' => '<a href="http://www.question2answer.org/htaccess.php" target="_blank">', '^2' => '</a>')) : '') . '</small>';
         }
         qa_optionfield_make_select($optionfield, $neatoptions, $value, QA_URL_FORMAT_SAFEST);
         $optionfield['type'] = 'select-radio';
         $optionfield['note'] = qa_lang_html_sub('admin/url_format_note', '<span style=" ' . qa_admin_url_test_html() . '/span>');
         break;