You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

  1. #!/usr/bin/php
  2. <?php
  3. require "lib/modulekit/lang/inc/build_statistic.php";
  4. ?>
  5. <!--
  6. Status:
  7. 0-15 #FF0033
  8. 16-50 #FF7700
  9. 51-70 #FFCC00
  10. 71-85 #77CC00
  11. 86-100 #33CC00
  12. -->
  13. {|class="wikitable sortable"
  14. |-
  15. !scope="col"| Code
  16. !scope="col"| Language
  17. !scope="col"| Native name
  18. <?php
  19. $languages = json_decode(file_get_contents("lib/modulekit/lang/lang/list.json", true));
  20. $languages_en = json_decode(file_get_contents("lib/modulekit/lang/lang/en.json", true));
  21. $dirs = array(
  22. "OSB Core UI" => "lang/",
  23. "Tag Translations" => "node_modules/openstreetmap-tag-translations/tags/",
  24. "Category Titles" => "node_modules/openstreetbrowser-categories-main/lang/",
  25. );
  26. foreach ($dirs as $dirId => $dir) {
  27. $stat[$dirId] = build_statistic($dir);
  28. }
  29. $total = 0;
  30. foreach ($dirs as $dirId => $dir) {
  31. $total += $stat[$dirId][''];
  32. print "!scope=\"col\"| {$dirId} ({$stat[$dirId]['']})\n";
  33. }
  34. print "!scope=\"col\"| Total ({$total})\n";
  35. foreach ($languages as $code => $native_name) {
  36. $sum = 0;
  37. foreach ($dirs as $dirId => $dir) {
  38. $sum += $stat[$dirId][$code] ?? 0;
  39. }
  40. if ($sum > 0) {
  41. print "|-\n";
  42. print "| {$code}\n";
  43. print "| {{Languagename|{$code}|en}} || {{Languagename|{$code}}}\n";
  44. foreach ($dirs as $dirId => $dir) {
  45. print "| {{Progress Bar|max={$stat[$dirId]['']}|current=" . ($stat[$dirId][$code] ?? 0) . "}}\n";
  46. }
  47. print "| {{Progress Bar|max={$total}|current={$sum}}}\n";
  48. }
  49. }
  50. ?>
  51. |}