forked from vern/website
44 lines
2.1 KiB
PHP
44 lines
2.1 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="preload" href="//gcdn.vern.cc/vernsite/style.css">
|
|
<link rel="stylesheet" href="//gcdn.vern.cc/vernsite/style.css">
|
|
<title>Translations | ~vern</title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
$const = 742;
|
|
$langs = array();
|
|
$langs['por-BR'] = array("Brazilian Portuguese", "Português Brasileiro");
|
|
$langs['tur'] = array("Turkish", "Türkçe");
|
|
$langs['spa-AR'] = array("Argentinian Spanish", "Español argentino");
|
|
|
|
|
|
function style($tl) {
|
|
global $const;
|
|
global $langs;
|
|
|
|
$sum = shell_exec('cd /var/www/website; echo "$(($(diff 2>/dev/null -y --suppress-common-lines eng/ '.$tl.'/ | grep "|" | wc -l)+$(diff 2>/dev/null -y --suppress-common-lines eng/ '.$tl.'/ | grep "^Only in eng/" | awk '."'".'{print $NF}'."'".' | while read -r line; do wc -l < eng/"$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 foreach($langs as $tl => $_) { echo style($tl); } ?>
|
|
</ul>
|
|
<!--#include file="footer.cgi" -->
|
|
</body>
|
|
</html>
|