Skip to content

Commit 31cfd3f

Browse files
committed
Improve side navigation for translation tools
1 parent 4cbab9d commit 31cfd3f

File tree

2 files changed

+15
-32
lines changed

2 files changed

+15
-32
lines changed

include/lib_general.inc.php

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,28 @@ function site_footer($SECONDSCREEN = false)
7575
require __DIR__ . '/../shared/templates/footer.inc';
7676
}
7777

78-
function nav_languages()
78+
function nav_languages($lang = null)
7979
{
8080
global $LANGUAGES;
8181
$out = '<div class="panel">';
82-
$out .= '<p class="headline"><a href="revcheck.php">Translation status</a></p>';
82+
$out .= '<p class="headline"><a href="/revcheck.php">Translation status</a></p>';
8383
$out .= '<div class="body">';
8484
$out .= '<ul>';
8585
foreach ($LANGUAGES as $code => $name)
8686
{
87-
$out .='<li><a href="revcheck.php?lang='.$code.'">'.$name.'</a></li>';
87+
$out .= '<li><a href="/revcheck.php?lang='.$code.'">'.$name.'</a>';
88+
if ($lang === $code) {
89+
$out .= '<ul>';
90+
$out .= '<li><a href="/revcheck.php?p=translators&amp;lang='.$lang.'">Translators</a></li>';
91+
$out .= '<li><a href="/revcheck.php?p=filesummary&amp;lang='.$lang.'">File summary</a></li>';
92+
$out .= '<li><a href="/revcheck.php?p=files&amp;lang='.$lang.'">Outdated files</a></li>';
93+
$out .= '<li><a href="/revcheck.php?p=misstags&amp;lang='.$lang.'">Missing revision numbers</a></li>';
94+
$out .= '<li><a href="/revcheck.php?p=missfiles&amp;lang='.$lang.'">Untranslated files</a></li>';
95+
$out .= '<li><a href="/revcheck.php?p=oldfiles&amp;lang='.$lang.'">Not in EN tree</a></li>';
96+
$out .= '</ul>';
97+
}
98+
$out .= '</li>';
8899
}
89100
$out .= '</ul></div></div>';
90101
return $out;
91102
}
92-
93-
function nav_tools($lang)
94-
{
95-
global $LANGUAGES;
96-
$out = '<div class="panel">';
97-
$out .= '<p class="headline">';
98-
$out .= '<a href="revcheck.php?lang='.$lang.'">Tools ('.$LANGUAGES[$lang].' Manual)</a>';
99-
$out .= '</p>';
100-
$out .= '<div class="body">';
101-
$out .= '<ul>';
102-
$out .= '<li><a href="revcheck.php?p=translators&amp;lang='.$lang.'">Translators</a></li>';
103-
$out .= '<li><a href="revcheck.php?p=filesummary&amp;lang='.$lang.'">File summary</a></li>';
104-
$out .= '<li><a href="revcheck.php?p=files&amp;lang='.$lang.'">Outdated files</a></li>';
105-
$out .= '<li><a href="revcheck.php?p=misstags&amp;lang='.$lang.'">Missing revision numbers</a></li>';
106-
$out .= '<li><a href="revcheck.php?p=missfiles&amp;lang='.$lang.'">Untranslated files</a></li>';
107-
$out .= '<li><a href="revcheck.php?p=oldfiles&amp;lang='.$lang.'">Not in EN tree</a></li>';
108-
$out .= '</ul>';
109-
$out .= '</div></div>';
110-
return $out;
111-
}

www/revcheck.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,6 @@
298298
// we need a dir to browse
299299
$dirs = get_dirs($dbhandle, $lang);
300300
$users = get_translators($dbhandle, $lang);
301-
/*
302-
if (empty($dirs)) {
303-
echo '<p>Error: no directories found in database.</p>';
304-
$sidebar = nav_tools($lang);
305-
site_footer($sidebar);
306-
die;
307-
}
308-
*/
309301
echo '<p>This tool allows you to check which files in your translation need updates. To show the list ';
310302
echo 'choose a directory (it doesn\'t work recursively) or translator.</p>';
311303
echo '<p>When you click on the filename you will see the plaintext diff showing changes between revisions, so ';
@@ -448,6 +440,6 @@
448440
}
449441

450442
if ($lang != 'en') {
451-
$sidebar = nav_tools($lang);
443+
$sidebar = nav_languages($lang);
452444
site_footer($sidebar);
453445
}

0 commit comments

Comments
 (0)