el.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. // sunday first as date('w') is zero-based on sunday
  3. $days = array(
  4. 'Κυριακή',
  5. 'Δευτέρα',
  6. 'Τρίτη',
  7. 'Τετάρτη',
  8. 'Πέμπτη',
  9. 'Παρασκευή',
  10. 'Σάββατο',
  11. );
  12. $months = array(
  13. 'Ιανουάριος',
  14. 'Φεβρουάριος',
  15. 'Μάρτιος',
  16. 'Απρίλιος',
  17. 'Μάιος',
  18. 'Ιούνιος',
  19. 'Ιούλιος',
  20. 'Αύγουστος',
  21. 'Σεπτέμβριος',
  22. 'Οκτώβριος',
  23. 'Νοέμβριος',
  24. 'Δεκέμβριος',
  25. );
  26. $months_genitive = array(
  27. 'Ιανουαρίου',
  28. 'Φεβρουαρίου',
  29. 'Μαρτίου',
  30. 'Απριλίου',
  31. 'Μαΐου',
  32. 'Ιουνίου',
  33. 'Ιουλίου',
  34. 'Αυγούστου',
  35. 'Σεπτεμβρίου',
  36. 'Οκτωβρίου',
  37. 'Νοεμβρίου',
  38. 'Δεκεμβρίου',
  39. );
  40. return array(
  41. 'Unable to fully convert this rrule to text.' => 'Αδυναμία πλήρους μετατροπής αυτού του κανόνα rrule σε κείμενο.',
  42. 'for %count% times' => 'για %count% φορές',
  43. 'for one time' => 'για μία φορά',
  44. '(~ approximate)' => '(~ κατά προσέγγιση)',
  45. 'until %date%' => 'μέχρι %date%', // e.g. every year until July 4, 2014
  46. 'day_date' => function ($str, $params) use ($days, $months_genitive) { // outputs a day date, e.g. 4 Ιουλίου 2014
  47. return date('j', $params['date']) . ' ' . $months_genitive[date('n', $params['date']) - 1] . ' '. date('Y', $params['date']);
  48. },
  49. 'day_month' => function ($str, $params) use ($days, $months_genitive) { // outputs a day month, e.g. 4 Ιουλίου
  50. return $params['day'] . ' ' . $months_genitive[$params['month'] - 1];
  51. },
  52. 'day_names' => $days,
  53. 'month_names' => $months,
  54. 'and' => 'και',
  55. 'or' => 'ή',
  56. 'in_month' => 'τον', // e.g. weekly in January, May and August
  57. 'in_week' => 'την', // e.g. yearly in week 3
  58. 'on' => 'την', // e.g. every day on Tuesday, Wednesday and Friday
  59. 'the_for_monthday' => 'την', // e.g. monthly on Tuesday the 1st
  60. 'the_for_weekday' => 'την', // e.g. monthly on the 4th Monday
  61. 'on the' => 'την', // e.g. every year on the 1st and 200th day
  62. 'of_the_month' => 'του μήνα', // e.g. every year on the 2nd or 3rd of the month
  63. 'every %count% years' => 'κάθε %count% χρόνια',
  64. 'every year' => 'ετήσια',
  65. 'every_month_list' => 'κάθε', // e.g. every January, May and August
  66. 'every %count% months' => 'κάθε %count% μήνες',
  67. 'every month' => 'μηνιαία',
  68. 'every %count% weeks' => 'κάθε %count% εβδομάδες',
  69. 'every week' => 'εβδομαδιαία',
  70. 'every %count% days' => 'κάθε %count% ημέρες',
  71. 'every day' => 'καθημερινά',
  72. 'last' => 'τελευταία', // e.g. 2nd last Friday
  73. 'days' => 'ημέρες',
  74. 'day' => 'ημέρα',
  75. 'weeks' => 'εβδομάδες',
  76. 'week' => 'εβδομάδα',
  77. // formats a number with a prefix e.g. every year on the 1st and 200th day
  78. // negative numbers should be handled as in '5th to the last' or 'last'
  79. //
  80. // if has_negatives is true in the params, it is good form to add 'day' after
  81. // each number, as in: 'every month on the 5th day or 2nd to the last day' or
  82. // it may be confusing like 'every month on the 5th or 2nd to the last day'
  83. 'ordinal_number' => function ($str, $params) {
  84. $number = $params['number'];
  85. $ends = 'η';
  86. $suffix = '';
  87. $isNegative = $number < 0;
  88. if ($number == -1) {
  89. $abbreviation = 'τελευταία';
  90. } else {
  91. if ($isNegative) {
  92. $number = abs($number);
  93. $suffix = ' μέχρι την τελευταία';
  94. }
  95. $abbreviation = $number . $ends;
  96. }
  97. if (!empty($params['has_negatives'])) {
  98. $suffix .= ' ημέρα';
  99. }
  100. return $abbreviation . $suffix;
  101. },
  102. );