LanguageWa.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Walloon (Walon)
  4. *
  5. * @ingroup Language
  6. */
  7. # NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
  8. # k' i gn a.
  9. class LanguageWa extends Language {
  10. ###
  11. ### Dates in Walloon are "1î d' <monthname>" for 1st of the month,
  12. ### "<day> di <monthname>" for months starting by a consoun, and
  13. ### "<day> d' <monthname>" for months starting with a vowel
  14. ###
  15. function date( $ts, $adj = false, $format = true, $tc = false ) {
  16. global $wgUser;
  17. if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
  18. $datePreference = $this->dateFormat( $format );
  19. # ISO (YYYY-mm-dd) format
  20. #
  21. # we also output this format for YMD (eg: 2001 January 15)
  22. if ( $datePreference == 'ISO 8601' ) {
  23. $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
  24. return $d;
  25. }
  26. # dd/mm/YYYY format
  27. if ( $datePreference == 'walloon short' ) {
  28. $d = substr($ts, 6, 2). '/' . substr($ts, 4, 2). '/' .substr($ts, 0, 4);
  29. return $d;
  30. }
  31. # Walloon format
  32. #
  33. # we output this in all other cases
  34. $m = substr( $ts, 4, 2 );
  35. $n = substr( $ts, 6, 2 );
  36. if ($n == 1) {
  37. $d = "1î d' " . $this->getMonthName( $m ) .
  38. " " . substr( $ts, 0, 4 );
  39. } else if ($n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23) {
  40. $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
  41. " " . substr( $ts, 0, 4 );
  42. } else if ($m == 4 || $m == 8 || $m == 10) {
  43. $d = (0 + $n) . " d' " . $this->getMonthName( $m ) .
  44. " " . substr( $ts, 0, 4 );
  45. } else {
  46. $d = (0 + $n) . " di " . $this->getMonthName( $m ) .
  47. " " . substr( $ts, 0, 4 );
  48. }
  49. return $d;
  50. }
  51. function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
  52. if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
  53. $datePreference = $this->dateFormat( $format );
  54. if ( $datePreference == 'ISO 8601' ) {
  55. return parent::timeanddate( $ts, $adj, $format, $tc );
  56. } else {
  57. return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
  58. $this->time( $ts, $adj, $format, $tc );
  59. }
  60. }
  61. }