tr.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. // sunday first as date('w') is zero-based on sunday
  3. $days = array(
  4. 'Pazar',
  5. 'Pazartesi',
  6. 'Salı',
  7. 'Çarşamba',
  8. 'Perşembe',
  9. 'Cuma',
  10. 'Cumartesi',
  11. );
  12. $months = array(
  13. 'Ocak',
  14. 'Şubat',
  15. 'Mart',
  16. 'Nisan',
  17. 'Mayıs',
  18. 'Haziran',
  19. 'Temmuz',
  20. 'Ağustos',
  21. 'Eylül',
  22. 'Ekim',
  23. 'Kasım',
  24. 'Aralık',
  25. );
  26. return array(
  27. 'Unable to fully convert this rrule to text.' => 'Bu rrule tam metne dönüştürülemiyor.',
  28. 'for %count% times' => '%count% kez',
  29. 'for one time' => 'bir kere',
  30. '(~ approximate)' => '(~ yaklaşık)',
  31. 'until %date%' => 'kadar %date%', // e.g. 4 Temmuz 2014 e kadar her yıl
  32. 'day_date' => function ($str, $params) use ($days, $months) { // tarih çıktıları, e.g. Temmuz 4, 2014
  33. return $months[date('n', $params['date']) - 1] . ' '. date('j, Y', $params['date']);
  34. },
  35. 'day_month' => function ($str, $params) use ($days, $months) { // outputs a day month, e.g. July 4
  36. return $months[$params['month'] - 1].' '.$params['day'];
  37. },
  38. 'day_names' => $days,
  39. 'month_names' => $months,
  40. 'and' => 've',
  41. 'or' => 'veya',
  42. 'in_month' => 'içinde', // e.g. Ocak, Mayıs ve Ağustos'ta haftalık
  43. 'in_week' => 'içinde', // e.g. yıllık haftada 3
  44. 'on' => 'on', // e.g. her Salı, Çarşamba ve Cuma günü
  45. 'the_for_monthday' => 'the', // e.g. monthly on Tuesday the 1st
  46. 'the_for_weekday' => 'the', // e.g. monthly on the 4th Monday
  47. 'on the' => 'üzerinde', // e.g. her yıl 1. ve 200. günde
  48. 'of_the_month' => 'ayın', // e.g. her yıl 2. ve 3. ayın
  49. 'every %count% years' => 'every %count% years',
  50. 'every year' => 'yıllık',
  51. 'every_month_list' => 'her', // e.g. her Ocak, Mayıs ve Ağustos
  52. 'every %count% months' => 'her %count% ay',
  53. 'every month' => 'aylık',
  54. 'every %count% weeks' => 'her %count% hafta',
  55. 'every week' => 'haftalık',
  56. 'every %count% days' => 'her %count% gün',
  57. 'every day' => 'günlük',
  58. 'last' => 'son', // e.g. 2nd last Friday
  59. 'days' => 'günler',
  60. 'day' => 'gün',
  61. 'weeks' => 'haftalar',
  62. 'week' => 'hafta',
  63. // formats a number with a prefix e.g. every year on the 1st and 200th day
  64. // negative numbers should be handled as in '5th to the last' or 'last'
  65. //
  66. // if has_negatives is true in the params, it is good form to add 'day' after
  67. // each number, as in: 'every month on the 5th day or 2nd to the last day' or
  68. // it may be confusing like 'every month on the 5th or 2nd to the last day'
  69. 'ordinal_number' => function ($str, $params) {
  70. $number = $params['number'];
  71. $ends = array('th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th');
  72. $suffix = '';
  73. $isNegative = $number < 0;
  74. if ($number == -1) {
  75. $abbreviation = 'son';
  76. } else {
  77. if ($isNegative) {
  78. $number = abs($number);
  79. $suffix = ' sonuna kadar';
  80. }
  81. if (($number % 100) >= 11 && ($number % 100) <= 13) {
  82. $abbreviation = $number.'th';
  83. } else {
  84. $abbreviation = $number.$ends[$number % 10];
  85. }
  86. }
  87. if (!empty($params['has_negatives'])) {
  88. $suffix .= ' gün';
  89. }
  90. return $abbreviation . $suffix;
  91. },
  92. );