aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-12-13 20:28:22 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-12-13 20:28:22 +0100
commita999dbad747f45605bbd74264c235e0b39b5af63 (patch)
treebf70cb102512478c193c37ff4e00a87c2be80bcf /phpBB
parentda6ced59d9632fec5103ce4bea86eb6bcceb5d1e (diff)
parent7bc457175300be7ebaefad20da8d1222539a808f (diff)
downloadforums-a999dbad747f45605bbd74264c235e0b39b5af63.tar
forums-a999dbad747f45605bbd74264c235e0b39b5af63.tar.gz
forums-a999dbad747f45605bbd74264c235e0b39b5af63.tar.bz2
forums-a999dbad747f45605bbd74264c235e0b39b5af63.tar.xz
forums-a999dbad747f45605bbd74264c235e0b39b5af63.zip
Merge remote-tracking branch 'vsephpbb/ticket/12063' into develop
* vsephpbb/ticket/12063: [ticket/12063] Use CSS to replace valign=top [ticket/12063] Remove obsolete valign attributes from tr tags
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_bbcodes.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html
index c22ed395e7..90a39a3eee 100644
--- a/phpBB/adm/style/acp_bbcodes.html
+++ b/phpBB/adm/style/acp_bbcodes.html
@@ -71,7 +71,7 @@
</thead>
<tbody>
<!-- BEGIN token -->
- <tr valign="top">
+ <tr style="vertical-align: top;">
<td class="row1">{token.TOKEN}</td>
<td class="row2">{token.EXPLAIN}</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
index d3b4408243..5bd762ec0b 100644
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ b/phpBB/styles/subsilver2/template/mcp_topic.html
@@ -73,7 +73,7 @@
<td align="center"><b class="postauthor">{postrow.POST_AUTHOR_FULL}</b></td>
<td width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr valign="top">
+ <tr style="vertical-align: top;">
<td class="gensmall" nowrap="nowrap">&nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
<td class="gensmall" width="100%">{postrow.POST_SUBJECT}</td>
</tr>
> 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="robots" content="noindex,nofollow,nosnippet">
    <title>www.mageia.org translation report</title>
    <style>
    html, body { margin: 0; padding: 0; font-family: Verdana, "Trebuchet MS", "Lucida Grande", "Lucida Sans", Verdana, Tahoma, Arial, sans-serif; }
    #page { padding: 1em; position: absolute; top: 128px; }
    th { text-align: left; }
    .ok a {
        text-decoration: none;
        color: inherit;
    }
    .ok { color: darkgreen; background: lightgreen; }
    .ok, .strings, .missing { text-align: center; }
    .number { text-align: right; }
    .strings { background: orange; }
    .strings, .missing, .small { font-size: 80%; }
    td, th { vertical-align: top; font-family: Arial; font-size: 80%; padding: 0.3em; }
    td { vertical-align: middle; }
    .action { font-size: smaller; display: block; text-align: center;
        text-decoration: none; padding: 0.3em 0.5em; border-radius: 3px;
        background: rgba(0, 0, 0, 0.1); margin: 0.5em 0; }
    .partial { display: inline; margin-left: 0.3em; margin-top: 0.3em; }
    .addlang { color: #333; }
    </style>
</head>
<body class="contribute">
    <header id="mgnavt">
        <h1><a href="//www.mageia.org/">www.mageia.org</a> translation report</h1>
        <ul>
            <li>Please check <a href="https://wiki.mageia.org/en/Internationalisation_Team_(i18n)#Website_translation">localization Wiki page</a> for special cases for navigation and some web pages like <a href="https://wiki.mageia.org/en/Internationalisation_Team_%28i18n%29#Special_cases_of_web_pages">downloads/get, constitution, license...</a></li>
        </ul>
    </header>
    <div id="page">
    <?php
    /**
    */
    include 'lib.php';
    $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null;
    $one_resource = isset($_GET['r']) ? strip_tags(trim($_GET['r'])) : null;

    $restore_languages = FALSE;
    $restore_resources = FALSE;

    if (isset($one_resource) && $one_resource != 'all') {
        $enFiles    = array($one_resource);
        $restore_resources = TRUE;
    } else {
        $enFiles    = array_merge(array('../_nav/langs/en.pot'), get_lang_references('*.lang'), get_lang_references('*.pot')); // added navigation file
        sort($enFiles);
    }
    $num_of_enFiles = count($enFiles);

    if (isset($one_language) && $one_language != 'all') {
        $otherLangs = array('en', $one_language);
        $restore_languages = TRUE;
    } else {
        $otherLangs = get_other_langs();
    }

    $enStringsCount = array();
    $report         = array();
    $stats          = array();
    $stats['en']['files'] = 0;
    $num_of_col     = 0;

    $diff_link      = '<a href="diff.php?s=%s&amp;l=%s" title="see detailed diff">';

    $languages      = array();
    $unique_lines_in_eng_constitution = array();
    $number_of_unique_lines_in_eng_constitution = 0;

    foreach ($otherLangs as $l) {

        $stats['en']['files'] += 1;
        $stats[$l]['files']    = 0;
        $stats[$l]['strings']  = 0;
        if ($l == 'en' || $restore_languages) {
            $link_one_language = '%s';
        } else {
            $link_one_language = '<a href="?l=' . $l . '" title="see this language only">%s</a>';
        }

        $s = sprintf('<tr><th>' . $link_one_language . '<br><span style="font-weight: normal; font-size: smaller;">%s</span></th>',
            $langs[$l], $l);

        $cols = '';
        $lang_coloumn = '';

        foreach ($enFiles as $f) {

            if (strrpos($f, '.pot')) {
                $gettext  = true;
                $resource = _extract_resource($f);
                $langF    = _po_file_switch($f, $l);
            } else {
                $gettext  = false;
                $resource = _extract_resource($f, '.en.lang');
                $langF    = _lang_file_switch($f, $l);
            }
            $enStringsCount[$f] = 0;
            if (false !== strstr($f, '../_nav/langs/en.')) {
                $nav = true;
                $langF = '../_nav/langs/' . $l . '.po' . (($l == 'en') ? 't' : '');
            } else {
                $nav = false;
            }

            $link = str_replace('index', '', $resource);
            if ($nav) {
                $dest_en = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', 'en.pot');
                $dest_l = sprintf('%s/%s/%s', G_APP_ROOT, '_nav/langs', $l . '.po');
            } else {
                $dest_en = sprintf('%s/%s/%s/%s', G_APP_ROOT, 'en', $link, 'index.php');
                $dest_l = sprintf('%s/%s/%s/%s', G_APP_ROOT, $l, $link, 'index.php');
            }

            // if symlink e.g. does directly translated page exist?
            if ((realpath($dest_l) == realpath($dest_en)) || $nav) {
                $page_not_linked = '';
                $old_page = '';
            } else {
                $page_not_linked = sprintf('<a href="/%s/%s">old page</a> still exists!', $l, $link);
                $old_page = sprintf('by recycling <a href="/%s/%s">old page</a>', $l, $link);
            }

            $add_translation = sprintf('<td class="missing"><a href="missing.php?s=%s&amp;l=%s" class="action addlang">add translation</a>%s</td>',
                $f, $l, $old_page
            );

            if (file_exists($langF)) {

                $stats[$l]['files'] += 1;

                if ($gettext) {
                    $test = _po_diff($l, $resource);
                    $num_of_missing_strings = 0;
                    $num_of_fuzzy_or_missing_strings = count($test['fuzzy_or_missing']);
                } else {
                    $test = _lang_diff($f, $langF);
                    $num_of_missing_strings = count($test['missing']);
                    $num_of_fuzzy_or_missing_strings = 0;
                }
                $num_of_untranslated_strings = count($test['notrans']);
                $num_of_duplicated_strings   = count($test['dup_str']);
                $num_of_extra_strings        = count($test['extra']);

                if ($link == 'about/constitution') {
                    $constitution_results = aproximate_number_of_untranslated_constitution_lines(G_APP_ROOT, $l, $unique_lines_in_eng_constitution);
                    if ($l == 'en') {
                        $unique_lines_in_eng_constitution = $constitution_results['unique_lines_in_constitution'];
                        $number_of_unique_lines_in_eng_constitution = count($unique_lines_in_eng_constitution);
                    }
                    $test['a'] += $number_of_unique_lines_in_eng_constitution; // add aproximate number of lines from constitution to translate
                    $num_of_untranslated_strings += $constitution_results['aproximate_number_of_untranslated_lines'];
                }
                if ($link == 'about/license') {
                    require_once('../en/about/license/license.php');
                    $license_array = read_license_from_vcs($l);
                    $license_numbers = array_pop($license_array);
                    $test['a'] += $license_numbers["all"]; // add aproximate number of untranslated sentences from license
                    $num_of_untranslated_strings += $license_numbers["untran"]; // add number of all license sentences
                }

                if ($nav) {
                    $mga = array();
                    $local_f  = @file_get_contents('../_nav/langs/' . $l . '.po');
                    $mognas_f = @file_get_contents('http://nav.mageia.org/langs/' . $l . '.po');
                    if ($local_f != $mognas_f) {
                        $page_not_linked = 'difference in svn <a class="action partial" href="//svnweb.mageia.org/web/www/trunk/_nav/langs/">1</a> &amp; <a class="action partial" href="//svnweb.mageia.org/web/nav/langs/">2</a>';
                    }
                } else if ($link == 'downloads/get') {
                    $mga = array(
                        'A' => 'downloads/get/index.php?q=Mageia-2-dual-CD.iso&amp;d=1', // " style="display: block;
                        'B' => 'downloads/get/index.php?q=Non_existing_file&amp;d=1',
                    );
                } else if ($link == '2') {
                    $mga = array(
                        'A' => '2/index.php',
                        'B' => '2/download_index.php',
                        'C' => '2/for-pc/index.php',
                        'D' => '2/for-server/index.php',
                    );
                } else if ($link == '3') {
                    $mga = array(
                        'A' => '3/index.php',
                        'B' => '3/download_index.php',
                        'C' => '3/for-pc/index.php',
                        'D' => '3/for-server/index.php',
                    );
                } else if ($link == '4') {
                    $mga = array(
                        'A' => '4/index.php',
                        'B' => '4/download_index.php',
                    );
                } else if ($link == 'cauldron') {
                    $mga = array(
                        'view page' => '5/download_index.php',
                    );
                } else if ($link == 'documentation') {
                    $mga = array(
                        'doc' => 'doc/index.php',
                        'archive' => 'doc/archive.php',
                    );
                } else {
                    $mga = array(
                        'view page' => $link,
                    );
                }
                $link = '<div>';
                foreach ($mga as $k => $v) {
                    $link .= sprintf('<a href="/%s/%s" class="action partial">%s</a>', $l, $v, $k);
                }
                $link .= $page_not_linked . '</div>';

                if ($num_of_missing_strings === 0
                    && $num_of_fuzzy_or_missing_strings === 0
                    && $num_of_untranslated_strings === 0) {

                    $extra = null;
                    if ($num_of_extra_strings > 0) {
                        $extra = ' <span class="small">' . sprintf($diff_link, $f, $l) . '+' . $num_of_extra_strings . '</a></span>';
                    }
                    if ($num_of_duplicated_strings > 0) {
                        $extra .= ' <span class="small">' . sprintf($diff_link, $f, $l) . 'dup: ' . $num_of_duplicated_strings . '</a></span>';
                    }

                    $cols .= sprintf('<td class="ok"><a href="%s" title="get a copy of the file">OK</a>%s%s</td>',
                        $langF, $extra, $link);

                    $done = $test['a'];
                } else {
                    // special case, en
                    if ($l == 'en') {
                        $cols .= '<td class="number">' . $num_of_untranslated_strings . ' strings</td>';
                        $enStringsCount[$f] += $test['a'];
                        $done = $test['a'];

                    // regular case
                    } else {

                        if(($num_of_missing_strings + $num_of_fuzzy_or_missing_strings + $num_of_untranslated_strings) < $test['a']) {
                            $cols .= sprintf('<td class="strings">' . $diff_link, $f, $l);

                            if ($num_of_missing_strings > 0) {
                                $cols .= $num_of_missing_strings . '&nbsp;missing<br>';
                            }
                            if ($num_of_fuzzy_or_missing_strings > 0) {
                                $cols .= $num_of_fuzzy_or_missing_strings . '&nbsp;fuzzy or missing<br>';
                            }
                            if ($num_of_untranslated_strings > 0) {
                                $cols .= $num_of_untranslated_strings . '&nbsp;untranslated<br>';
                            }
                            if ($num_of_extra_strings > 0) {
                                $cols .= $num_of_extra_strings . '&nbsp;extra<br>';
                            }
                            if ($num_of_duplicated_strings > 0) {
                                $cols .= $num_of_duplicated_strings . '&nbsp;duplicate';
                                $cols .= ($num_of_duplicated_strings > 1 ? 's' : '');
                            }
                            $cols .= '</a>';
                            $cols .= $link . '</td>';
                        } else {
                            $cols .= $add_translation;
                        }
                        $done = $test['a'] - $num_of_untranslated_strings - $num_of_missing_strings - $num_of_fuzzy_or_missing_strings;
                    }
                }
                $stats[$l]['strings'] += $done;

            } else {
                $cols .= $add_translation;
            }
            $num_clmns_to_repeat = 9;
            $num_of_col++;
            if ($num_of_col % $num_clmns_to_repeat == 0 && $num_of_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) {
                if ($l == 'en') {
                    $cols .= $lang_coloumn = '<td style="font-weight: bold;">Language</td>';
                } else {
                    $cols .= $lang_coloumn = sprintf('<td style="font-weight: bold; vertical-align: top;">' . $link_one_language . '<br><span style="font-weight: normal; font-size: smaller;">%s</span></td>', $langs[$l], $l);
                }
            }
        }
        $cols .= $lang_coloumn; // last coloumn
        $num_of_col = 0; // reset counter of coloumns

        $progress = floor($stats[$l]['strings'] / $stats['en']['strings'] * 100);
        // special case, en
        if ($l == 'en') {
            $s .= sprintf('<td class="number">%d strings</td>', $stats[$l]['strings']);
        // regular case
        } else {
            $s .= sprintf(
                '<td class="number">%d%%<br><span style="font-size: smaller;">%d / %d</span></td>',
                $progress,
                $stats[$l]['strings'],
                $stats['en']['strings']
            );
        }
        $s .= $cols;
        $s .= '</tr>' . PHP_EOL;
        $languages[$stats[$l]['strings'] . '-' . $l] = $s;
    }
    $en_language = array_shift($languages); // shift English for proper sorting
    krsort($languages, SORT_NUMERIC);

    // add language coloumn repeating
    $lang_line = array();
    $num_of_h_col = 0;
    $add_last_coloumn = FALSE;
    $resources = ($restore_resources ? '&nbsp;' : $num_of_enFiles . ' resources');
    foreach ($enFiles as $lang_chunk) {
        $num_of_h_col++;
        if ($restore_resources) {
            $lang_line[] = str_replace('en/', '', $lang_chunk);
        } else {
            $lang_line[] = '<a href="?r=' . $lang_chunk . '" title="see only this resource">' . str_replace('en/', '', $lang_chunk) . '</a>';
        }
        if ($num_of_h_col % $num_clmns_to_repeat == 0 && $num_of_h_col <= $num_of_enFiles - ($num_clmns_to_repeat / 3)) {
            $lang_line[] = $resources;
            $add_last_coloumn = TRUE;
        }
    }
    if ($add_last_coloumn) {
        $lang_line[] = $resources;// last h coloumn
    }

    $thfiles = '<th>' . implode('</th><th>', $lang_line) . '</th>' . PHP_EOL;
    if ($restore_languages) {
        echo '<p>Restore <a href="?l=all" title="see all languages">all languages</a>.</p>';
        $count = '&nbsp;';
    } else {
        $count = count($otherLangs) . ' languages';
    }
    if ($restore_resources) {
        echo '<p>Restore <a href="?r=all" title="see all resources">all resources</a>.</p>';
    }
    $chunks  = array_chunk($languages, $num_lines_to_repeat = 8); // add header repeating
    $table_body = array();
    foreach ($chunks as $chunk) {
        $table_body = array_merge($table_body, $chunk, array(count($chunk) > ($num_lines_to_repeat / 2) ? '<tr><th>' . $count . '</th><th>' . $resources . '</th>' . $thfiles : ''));
    }
    array_unshift($table_body, $en_language); // unshift English back
    $s = implode($table_body);


    echo <<<S
<table border="1">
<thead><tr>
    <th>{$count}</th>
    <th>Progress</th>
    {$thfiles}
</tr></thead>
<tbody>
{$s}
</tbody>
</table>

<hr>
S;
?>
    </div>
    <script src="/_nav/js/source.js"></script>
</body>
</html>