* (bug 6910) Correct date/time formats in Vietnamese (vi)
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 17 Apr 2007 05:52:24 +0000 (05:52 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 17 Apr 2007 05:52:24 +0000 (05:52 +0000)
  patch by Shinjiman

RELEASE-NOTES
languages/classes/LanguageVi.php [deleted file]
languages/messages/MessagesVi.php

index 73a8a36..3c3d3d1 100644 (file)
@@ -319,6 +319,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 9220) Removed obsoletes functions in install-utils.inc.
 * Removed obsoletes Title::getRelatedCache and Title:touchArray
 * (bug 7285) Check MySQL username length during install
+* (bug 6910) Correct date/time formats in Vietnamese (vi)
 
 == Maintenance ==
 
@@ -401,6 +402,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Ukrainian (uk)
 * Urdu (ur)
 * Uzbek (uz)
+* Vietnamese (vi)
 * Zealandic (zea)
 * Chinese (PRC) (zh-cn)
 * Chinese (Taiwan) (zh-tw)
diff --git a/languages/classes/LanguageVi.php b/languages/classes/LanguageVi.php
deleted file mode 100644 (file)
index 94c4aaa..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-/**
-  * Based on Language.php 1.645
-  * @addtogroup Language
-  * Compatible to MediaWiki 1.5
-  * Initial translation by Trần Thế Trung and Nguyễn Thanh Quang
-  * Last update 28 August 2005 (UTC)
-  */
-
-class LanguageVi extends Language {
-       function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
-               if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
-
-               $datePreference = $this->dateFormat( $format );
-
-               $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
-               $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
-               $year = $this->formatNum( substr( $ts, 0, 4 ), true );
-
-               switch( $datePreference ) {
-                       case 3:
-                       case 4: return "$day/$month/$year";
-                       case MW_DATE_ISO: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
-                       default: return "$day $month năm $year";
-               }
-       }
-
-       function timeSeparator( $format ) {
-               $datePreference = $this->dateFormat($format);
-                       switch ( $datePreference ) {
-                               case '4': return 'h';
-                               default:  return ':';
-                       }
-       }
-
-       function timeDateSeparator( $format ) {
-               $datePreference = $this->dateFormat($format);
-                       switch ( $datePreference ) {
-                               case '0':
-                               case '1':
-                               case '2': return ', ';
-                               default:  return ' ';
-                       }
-       }
-
-       function formatMonth( $month, $format ) {
-               $datePreference = $this->dateFormat($format);
-                       switch ( $datePreference ) {
-                               case '0':
-                               case '1': return 'tháng ' . ( 0 + $month );
-                               case '2': return 'tháng ' . $this->getSpecialMonthName( $month );
-                               default:  return 0 + $month;
-                       }
-       }
-
-       function formatDay( $day, $format ) {
-               $datePreference = $this->dateFormat($format);
-                       switch ( $datePreference ) {
-                               case '0':
-                               case '1':
-                               case '2': return 'ngày ' . (0 + $day);
-                               default:  return 0 + $day;
-                       }
-       }
-
-       function getSpecialMonthName( $key ) {
-               $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';
-               $names = explode(', ', $names);
-               return $names[$key-1];
-       }
-}
-
-?>
index 6396f73..8860ae7 100644 (file)
@@ -85,9 +85,9 @@ $magicWords = array(
 $datePreferences = array(
        'default',
        'vi normal',
-       'vi longmonth',
+       'vi spelloutmonth',
        'vi shortcolon',
-       'vi short',
+       'vi shorth',
        'ISO 8601',
 );
 
@@ -95,20 +95,20 @@ $defaultDateFormat = 'vi normal';
 
 $dateFormats = array(
        'vi normal time' => 'H:i',
-       'vi normal date' => '"ngày" j M "năm" Y',
-       'vi normal both' => 'H:i, "ngày" j M "năm" Y',
+       'vi normal date' => '"ngày" j "tháng" n "năm" Y',
+       'vi normal both' => 'H:i, "ngày" j "tháng" n "năm" Y',
 
-       'vi longmonth time' => 'H:i',
-       'vi longmonth date' => '"ngày" j F "năm" Y',
-       'vi longmonth both' => 'H:i, "ngày" j F "năm" Y',
+       'vi spelloutmonth time' => 'H:i',
+       'vi spelloutmonth date' => '"ngày" j xg "năm" Y',
+       'vi spelloutmonth both' => 'H:i, "ngày" j xg "năm" Y',
 
        'vi shortcolon time' => 'H:i',
        'vi shortcolon date' => 'j/n/Y',
        'vi shortcolon both' => 'H:i, j/n/Y',
 
-       'vi short time' => 'H"h"i',
-       'vi short date' => 'j/n/Y',
-       'vi short both' => 'H"h"i, j/n/Y',
+       'vi shorth time' => 'H"h"i',
+       'vi shorth date' => 'j/n/Y',
+       'vi shorth both' => 'H"h"i, j/n/Y',
 );
 
 $datePreferenceMigrationMap = array(
@@ -165,18 +165,37 @@ $messages = array(
 'thursday' => 'thứ năm',
 'friday' => 'thứ sáu',
 'saturday' => 'thứ bảy',
-'january'   => 'tháng Một',
-'february'  => 'tháng Hai',
-'march'     => 'tháng Ba',
-'april'     => 'tháng Tư',
-'may_long'  => 'tháng Năm',
-'june'      => 'tháng Sáu',
-'july'      => 'tháng Bảy',
-'august'    => 'tháng Tám',
-'september' => 'tháng Chín',
-'october'   => 'tháng Mười',
-'november'  => 'tháng Mười một',
-'december'  => 'tháng Mười hai',
+'sun' => 'thứ 1',
+'mon' => 'thứ 2',
+'tue' => 'thứ 3',
+'wed' => 'thứ 4',
+'thu' => 'thứ 5',
+'fri' => 'thứ 6',
+'sat' => 'thứ 7',
+'january' => 'tháng 1',
+'february' => 'tháng 2',
+'march' => 'tháng 3',
+'april' => 'tháng 4',
+'may_long' => 'tháng 5',
+'june' => 'tháng 6',
+'july' => 'tháng 7',
+'august' => 'tháng 8',
+'september' => 'tháng 9',
+'october' => 'tháng 10',
+'november' => 'tháng 11',
+'december' => 'tháng 12',
+'january-gen'   => 'tháng Một',
+'february-gen'  => 'tháng Hai',
+'march-gen'     => 'tháng Ba',
+'april-gen'     => 'tháng Tư',
+'may-gen'  => 'tháng Năm',
+'june-gen'      => 'tháng Sáu',
+'july-gen'      => 'tháng Bảy',
+'august-gen'    => 'tháng Tám',
+'september-gen' => 'tháng Chín',
+'october-gen'   => 'tháng Mười',
+'november-gen'  => 'tháng Mười một',
+'december-gen'  => 'tháng Mười hai',
 'jan' => 'tháng 1',
 'feb' => 'tháng 2',
 'mar' => 'tháng 3',