diff --git a/bin/build_lang_stat b/bin/build_lang_stat new file mode 100755 index 00000000..1a3c2d4a --- /dev/null +++ b/bin/build_lang_stat @@ -0,0 +1,55 @@ +#!/usr/bin/php + + + +{|class="wikitable sortable" +|- +!scope="col"| Code +!scope="col"| Language +!scope="col"| Native name + "lang/", + "Tag Translations" => "node_modules/openstreetmap-tag-translations/tags/", + "Category Titles" => "node_modules/openstreetbrowser-categories-main/lang/", +); + +foreach ($dirs as $dirId => $dir) { + print "!scope=\"col\"| {$dirId}\n"; + + $stat[$dirId] = build_statistic($dir); +} + +print "!scope=\"col\"| Total\n"; + +$total = 0; +foreach ($dirs as $dirId => $dir) { + $total += $stat[$dirId]['']; +} + +foreach ($languages as $code => $native_name) { + print "|-\n"; + print "| {$code}\n"; + print "| [[/{{Languagename|{$code}|en}}|{{Languagename|{$code}|en}}]] || {{Languagename|{$code}}}\n"; + $sum = 0; + foreach ($dirs as $dirId => $dir) { + print "| {{Progress Bar|max={$stat[$dirId]['']}|current=" . ($stat[$dirId][$code] ?? 0) . "}}\n"; + $sum += $stat[$dirId][$code]; + } + print "| {{Progress Bar|max={$total}|current={$sum}}}\n"; +} + +?> +|} diff --git a/lib/modulekit/lang b/lib/modulekit/lang index 89c651db..b1b4760b 160000 --- a/lib/modulekit/lang +++ b/lib/modulekit/lang @@ -1 +1 @@ -Subproject commit 89c651dbbbbd8464f78029d7479e9b719d302aae +Subproject commit b1b4760b0555aa1b1862c4f641adca7af76a2fc8