vern-web/en/translations.php

40 lines
1.9 KiB
PHP

<!DOCTYPE html>
<!--
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="description" content="Status of ~vern translations">
<link rel="stylesheet" href="//gcdn.vern.cc/vernsite/style.css">
<title>Translations | ~vern</title>
</head>
<body>
<?php
$const = 656;
$langs = array();
$langs['pt-BR'] = array("Brazilian Portuguese", "Português Brasileiro");
function style($tl) {
global $const;
global $langs;
$sum = shell_exec('cd /var/www/website; echo "$(($(diff 2>/dev/null -y --suppress-common-lines en/ '.$tl.'/ | grep "|" | wc -l)+$(diff 2>/dev/null -y --suppress-common-lines en/ '.$tl.'/ | grep "^Only in en/" | awk '."'".'{print $NF}'."'".' | while read -r line; do wc -l < en/"$line";printf "+"; done)0))"');
$percent = intdiv(($sum * 100), $const);
return "<li>" . $langs[$tl][0] . " (" . $langs[$tl][1] . ", <code>/$tl/</code>)</li>\n$percent% complete<br>\n<progress max=$const value=$sum>$percent%</progress><br>";
}
?>
<!--#include file="nav.php" -->
<div class=h><h1 id=translations>Translations</h1> <a aria-hidden=true href=#translations>#translations</a></div>
<ul>
<?php echo style('pt-BR'); ?>
</ul>
<!--#include file="footer.cgi" -->
</body>
</html>