diff options
author | Filip Komar <filip@mageia.org> | 2012-08-03 14:43:47 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2012-08-03 14:43:47 +0000 |
commit | 2179fad2a0a38c9bb5fd4b818af52009db6eb523 (patch) | |
tree | 327a7d719df1f88ff5f1e68c3cbc44ac869b4f86 /langs/report.php | |
parent | 2123f89da4a1122bef1bde373233223a3ea3bb0f (diff) | |
download | www-2179fad2a0a38c9bb5fd4b818af52009db6eb523.tar www-2179fad2a0a38c9bb5fd4b818af52009db6eb523.tar.gz www-2179fad2a0a38c9bb5fd4b818af52009db6eb523.tar.bz2 www-2179fad2a0a38c9bb5fd4b818af52009db6eb523.tar.xz www-2179fad2a0a38c9bb5fd4b818af52009db6eb523.zip |
added link to old page if exists
Diffstat (limited to 'langs/report.php')
-rw-r--r-- | langs/report.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/langs/report.php b/langs/report.php index d967b4990..204b8e029 100644 --- a/langs/report.php +++ b/langs/report.php @@ -123,8 +123,21 @@ } else { $stats[$l]['files'] += 0; $stats[$l]['strings'] += 0; - $cols .= sprintf('<td class="missing"><a href="missing.php?s=%s&l=%s" class="action addlang">add</a></td>', - $f, $l + + $old_link = str_replace(array('en/', '.en.lang', 'index'), '', $f); + $lang_filename = './../' . $l . '/'; + $complete_filename = $lang_filename . $old_link . '/'; + $lang_file_path = realpath($lang_filename); + // if symlink e.g. does directly translated page exist? + if(realpath($complete_filename) != realpath($lang_file_path) . '/' . $old_link) { + $old_link = ''; + } else { + $old_link = sprintf(', you can use <a href="/%s/%s">old page</a> as a guide', $l, $old_link); + } + + + $cols .= sprintf('<td class="missing"><a href="missing.php?s=%s&l=%s" class="action addlang">add translation</a>%s</td>', + $f, $l, $old_link ); } } |