generator.php 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. require 'vendor/autoload.php';
  3. use Jenssegers\Date\Date;
  4. // Set the language
  5. setlocale(LC_ALL, $argv[1] ?: 'en');
  6. $months = array(
  7. 'january',
  8. 'february',
  9. 'march',
  10. 'april',
  11. 'may',
  12. 'june',
  13. 'july',
  14. 'august',
  15. 'september',
  16. 'october',
  17. 'november',
  18. 'december',
  19. );
  20. $days = array(
  21. 'monday',
  22. 'tuesday',
  23. 'wednesday',
  24. 'thursday',
  25. 'friday',
  26. 'saturday',
  27. 'sunday',
  28. );
  29. $translations = array();
  30. foreach ($months as $month) {
  31. $date = new Date($month);
  32. $translation = strftime('%B', $date->getTimestamp());
  33. $translations[$month] = $translation;
  34. echo "'" . $month . "'\t=> '" . $translation . "',\n";
  35. }
  36. echo "\n";
  37. foreach ($days as $day) {
  38. $date = new Date($day);
  39. $translation = strftime('%A', $date->getTimestamp());
  40. $translations[$day] = $translation;
  41. echo "'" . $day . "'\t=> '" . $translation . "',\n";
  42. }