pt-br.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // sunday first as date('w') is zero-based on sunday
  3. $days = array(
  4. 'domingo',
  5. 'segunda-feira',
  6. 'terça-feira',
  7. 'quarta-feira',
  8. 'quinta-feira',
  9. 'sexta-feira',
  10. 'sábado',
  11. );
  12. $months = array(
  13. 'Janeiro',
  14. 'Fevereiro',
  15. 'Março',
  16. 'Abril',
  17. 'Maio',
  18. 'Junho',
  19. 'Julho',
  20. 'Agosto',
  21. 'Setembro',
  22. 'Outubro',
  23. 'Novembro',
  24. 'Dezembro',
  25. );
  26. return array(
  27. 'Unable to fully convert this rrule to text.' => 'Não foi possível converter esta regra para texto.',
  28. 'for %count% times' => 'por %count% vezes',
  29. 'for one time' => 'uma vez',
  30. '(~ approximate)' => '(~ approximado)',
  31. 'until %date%' => 'até %date%', // e.g. every year until July 4, 2014
  32. 'day_date' => function ($str, $params) use ($days, $months) { // outputs a day date, e.g. July 4, 2014
  33. return date('j', $params['date']) . ' de ' . $months[date('n', $params['date']) - 1] . ' de ' . 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'].' de '.$months[$params['month'] - 1];
  37. },
  38. 'day_names' => $days,
  39. 'month_names' => $months,
  40. 'and' => 'e',
  41. 'or' => 'ou',
  42. 'in_month' => 'em', // e.g. weekly in January, May and August
  43. 'in_week' => 'na', // e.g. yearly in week 3
  44. 'on' => 'à', // e.g. every day on Tuesday, Wednesday and Friday
  45. 'the_for_monthday' => 'o', // e.g. monthly on Tuesday the 1st
  46. 'the_for_weekday' => 'o', // e.g. monthly on the 4th Monday
  47. 'on the' => 'no', // e.g. every year on the 1st and 200th day
  48. 'of_the_month' => 'do mês', // e.g. every year on the 2nd or 3rd of the month
  49. 'every %count% years' => 'a cada %count% anos',
  50. 'every year' => 'anualmente',
  51. 'every_month_list' => 'sempre em', // e.g. every January, May and August
  52. 'every %count% months' => 'a cada %count% meses',
  53. 'every month' => 'mensalmente',
  54. 'every %count% weeks' => 'a cada %count% semanas',
  55. 'every week' => 'semanalmente',
  56. 'every %count% days' => 'a cada %count% dias',
  57. 'every day' => 'diariamente',
  58. 'last' => 'último', // e.g. 2nd last Friday
  59. 'days' => 'dias',
  60. 'day' => 'dia',
  61. 'weeks' => 'semanas',
  62. 'week' => 'semana',
  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. $abbreviation = $number.'°';
  72. $isNegative = $number < 0;
  73. if ($isNegative) {
  74. $abbreviation = $abbreviation.' último';
  75. }
  76. $suffix = '';
  77. if (!empty($params['has_negatives'])) {
  78. $suffix .= ' dia';
  79. }
  80. return $abbreviation . $suffix;
  81. },
  82. );