diff options
author | Filip Komar <filip@mageia.org> | 2014-01-10 22:01:29 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2014-01-10 22:01:29 +0000 |
commit | 80b7264f9831f21c714c96a10938f704f107c7e3 (patch) | |
tree | 0d041a127b66ca2d96414f5edce455f9abf6f3e8 /langs/report.php | |
parent | 4226ef6f206ce7a5d81b3f04b85d4b47937a0f0f (diff) | |
download | www-80b7264f9831f21c714c96a10938f704f107c7e3.tar www-80b7264f9831f21c714c96a10938f704f107c7e3.tar.gz www-80b7264f9831f21c714c96a10938f704f107c7e3.tar.bz2 www-80b7264f9831f21c714c96a10938f704f107c7e3.tar.xz www-80b7264f9831f21c714c96a10938f704f107c7e3.zip |
report can be limited to one language only
Diffstat (limited to 'langs/report.php')
-rw-r--r-- | langs/report.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/langs/report.php b/langs/report.php index bb94e0466..6f8fcbb8a 100644 --- a/langs/report.php +++ b/langs/report.php @@ -37,13 +37,18 @@ <?php /** */ + $one_language = isset($_GET['l']) ? strip_tags(trim($_GET['l'])) : null; include 'lib.php'; define('APP_ROOT', realpath(__DIR__ . '/..')); $enFiles = get_lang_references(); // added navigation file array_unshift($enFiles, '../_nav/langs/en.lang'); - $otherLangs = get_other_langs(); + if (isset($one_language) && $one_language != 'all') { + $otherLangs = array('en', $one_language); + } else { + $otherLangs = get_other_langs(); + } $enStringsCount = array(); $report = array(); @@ -60,8 +65,13 @@ $stats['en']['files'] += 1; $stats[$l]['files'] = 0; $stats[$l]['strings'] = 0; + if ($l == 'en') { + $link_one_language = '%s'; + } else { + $link_one_language = '<a href="?l=' . $l . '" title="see this language only">%s</a>'; + } - $s = sprintf('<tr><th>%s<br><span style="font-weight: normal; font-size: smaller;">%s</span></th>', + $s = sprintf('<tr><th>' . $link_one_language . '<br><span style="font-weight: normal; font-size: smaller;">%s</span></th>', $langs[$l], $l); $cols = ''; @@ -218,9 +228,9 @@ $num_of_col++; if ($num_of_col % $num_clmns_to_repeat == 0 && $num_of_col <= count($enFiles) - ($num_clmns_to_repeat / 3)) { if ($l == 'en') { - $cols .= $lang_coloumn = '<td style="font-weight: bold;">Language</td>'; + $cols .= $lang_coloumn = '<td style="font-weight: bold;"><a href="?l=all" title="see all languages">Language</a></td>'; } else { - $cols .= $lang_coloumn = sprintf('<td style="font-weight: bold; vertical-align: top;">%s<br><span style="font-weight: normal; font-size: smaller;">%s</span></td>', $langs[$l], $l); + $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); } } } @@ -273,7 +283,7 @@ echo <<<S <table border="1"> <thead><tr> - <th>{$count} languages</th> + <th><a href="?l=all" title="see all languages">{$count} languages</a></th> <th>Progress</th> {$thfiles} </tr></thead> |