de.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. // sunday first as date('w') is zero-based on sunday
  3. $days = array(
  4. 'Sonntag',
  5. 'Montag',
  6. 'Dienstag',
  7. 'Mittwoch',
  8. 'Donnerstag',
  9. 'Freitag',
  10. 'Samstag',
  11. );
  12. $months = array(
  13. 'Januar',
  14. 'Februar',
  15. 'März',
  16. 'April',
  17. 'Mai',
  18. 'Juni',
  19. 'Juli',
  20. 'August',
  21. 'September',
  22. 'Oktober',
  23. 'November',
  24. 'Dezember',
  25. );
  26. return array(
  27. 'Unable to fully convert this rrule to text.' => 'RRule kann nicht vollständig zu Text konvertiert werden.',
  28. 'for %count% times' => '%count% Mal',
  29. 'for one time' => 'einmal',
  30. '(~ approximate)' => '(~ ungefähr)',
  31. 'until %date%' => 'bis %date%', // e.g. every year until July 4, 2014
  32. 'day_date' => function ($str, $params) use ($days, $months) { // outputs a day date, e.g. 4. Juli, 2014
  33. return date('j. ', $params['date']) . $months[date('n', $params['date']) - 1] . date(', Y', $params['date']);
  34. },
  35. 'day_month' => function ($str, $params) use ($days, $months) { // outputs a day month, e.g. July 4
  36. return $params['day'].'. '.$months[$params['month'] - 1];
  37. },
  38. 'day_names' => $days,
  39. 'month_names' => $months,
  40. 'and' => 'und',
  41. 'or' => 'oder',
  42. 'in_month' => 'im', // e.g. weekly in January, May and August
  43. 'in_week' => 'in', // e.g. yearly in week 3
  44. 'on' => 'am', // e.g. every day on Tuesday, Wednesday and Friday
  45. 'the_for_monthday' => 'dem', // e.g. monthly on Tuesday the 1st
  46. 'the_for_weekday' => '', // e.g. monthly on the 4th Monday
  47. 'on the' => 'am', // e.g. every year on the 1st and 200th day
  48. 'of_the_month' => 'des Monats', // e.g. every year on the 2nd or 3rd of the month
  49. 'every %count% years' => 'alle %count% Jahre',
  50. 'every year' => 'jährlich',
  51. 'every_month_list' => 'jeden', // e.g. every January, May and August
  52. 'every %count% months' => 'alle %count% Monate',
  53. 'every month' => 'monatlich',
  54. 'every %count% weeks' => 'alle %count% Wochen',
  55. 'every week' => 'wöchentlich',
  56. 'every %count% days' => 'alle %count% Tage',
  57. 'every day' => 'täglich',
  58. 'every %count% hours' => 'alle %count% Stunden',
  59. 'every hour' => 'stündlich',
  60. 'last' => 'letzte', // e.g. 2nd last Friday
  61. 'days' => 'Tage',
  62. 'day' => 'Tag',
  63. 'weeks' => 'Wochen',
  64. 'week' => 'Woche',
  65. 'hours' => 'Stunden',
  66. 'hour' => 'stündlich',
  67. // formats a number with a prefix e.g. every year on the 1st and 200th day
  68. // negative numbers should be handled as in '5th to the last' or 'last'
  69. //
  70. // if has_negatives is true in the params, it is good form to add 'day' after
  71. // each number, as in: 'every month on the 5th day or 2nd to the last day' or
  72. // it may be confusing like 'every month on the 5th or 2nd to the last day'
  73. 'ordinal_number' => function ($str, $params) {
  74. $number = $params['number'];
  75. $suffix = '';
  76. $isNegative = $number < 0;
  77. if ($number == -1) {
  78. $abbreviation = 'letzten';
  79. } elseif ($number == -2) {
  80. $abbreviation = 'vorletzten';
  81. } elseif ($number == -3) {
  82. $abbreviation = 'drittletzten';
  83. } elseif ($number == -4) {
  84. $abbreviation = 'viertletzten';
  85. } elseif ($number == -5) {
  86. $abbreviation = 'fünftletzten';
  87. } elseif ($number == -6) {
  88. $abbreviation = 'sechstletzten';
  89. } elseif ($number == -7) {
  90. $abbreviation = 'siebtletzten';
  91. } elseif ($number == -8) {
  92. $abbreviation = 'achtletzten';
  93. } elseif ($number == -9) {
  94. $abbreviation = 'neuntletzten';
  95. } elseif ($number == -10) {
  96. $abbreviation = 'zehntletzten';
  97. } elseif ($number == -11) {
  98. $abbreviation = 'elftletzten';
  99. } elseif ($isNegative) {
  100. $number = abs($number);
  101. $abbreviation = $number . 't letzten';
  102. } else {
  103. $abbreviation = $number . '.';
  104. }
  105. if (!empty($params['has_negatives']) && $isNegative) {
  106. $suffix .= ' Tag';
  107. }
  108. return $abbreviation . $suffix;
  109. },
  110. );