3 * Based on Language.php 1.645
5 * Compatible to MediaWiki 1.5
6 * Initial translation by Trần Thế Trung and Nguyễn Thanh Quang
7 * Last update 28 August 2005 (UTC)
10 class LanguageVi
extends Language
{
11 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
12 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
14 $datePreference = $this->dateFormat( $format );
16 $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
17 $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
18 $year = $this->formatNum( substr( $ts, 0, 4 ), true );
20 switch( $datePreference ) {
22 case 4: return "$day/$month/$year";
23 case MW_DATE_ISO
: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
24 default: return "$day $month năm $year";
28 function timeSeparator( $format ) {
29 $datePreference = $this->dateFormat($format);
30 switch ( $datePreference ) {
36 function timeDateSeparator( $format ) {
37 $datePreference = $this->dateFormat($format);
38 switch ( $datePreference ) {
41 case '2': return ', ';
46 function formatMonth( $month, $format ) {
47 $datePreference = $this->dateFormat($format);
48 switch ( $datePreference ) {
50 case '1': return 'tháng ' . ( 0 +
$month );
51 case '2': return 'tháng ' . $this->getSpecialMonthName( $month );
52 default: return 0 +
$month;
56 function formatDay( $day, $format ) {
57 $datePreference = $this->dateFormat($format);
58 switch ( $datePreference ) {
61 case '2': return 'ngày ' . (0 +
$day);
62 default: return 0 +
$day;
66 function getSpecialMonthName( $key ) {
67 $names = 'Một, Hai, Ba, Tư, Năm, Sáu, Bảy, Tám, Chín, Mười, Mười một, Mười hai';
68 $names = explode(', ', $names);
69 return $names[$key-1];