r21315 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21314‎ | r21315 | r21316 >
Date:05:52, 17 April 2007
Author:raymond
Status:old
Tags:
Comment:
* (bug 6910) Correct date/time formats in Vietnamese (vi)
patch by Shinjiman
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/languages/classes/LanguageVi.php (deleted) (history)
  • /trunk/phase3/languages/messages/MessagesVi.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesVi.php
@@ -85,9 +85,9 @@
8686 $datePreferences = array(
8787 'default',
8888 'vi normal',
89 - 'vi longmonth',
 89+ 'vi spelloutmonth',
9090 'vi shortcolon',
91 - 'vi short',
 91+ 'vi shorth',
9292 'ISO 8601',
9393 );
9494
@@ -95,20 +95,20 @@
9696
9797 $dateFormats = array(
9898 'vi normal time' => 'H:i',
99 - 'vi normal date' => '"ngày" j M "năm" Y',
100 - 'vi normal both' => 'H:i, "ngày" j M "năm" Y',
 99+ 'vi normal date' => '"ngày" j "tháng" n "năm" Y',
 100+ 'vi normal both' => 'H:i, "ngày" j "tháng" n "năm" Y',
101101
102 - 'vi longmonth time' => 'H:i',
103 - 'vi longmonth date' => '"ngày" j F "năm" Y',
104 - 'vi longmonth both' => 'H:i, "ngày" j F "năm" Y',
 102+ 'vi spelloutmonth time' => 'H:i',
 103+ 'vi spelloutmonth date' => '"ngày" j xg "năm" Y',
 104+ 'vi spelloutmonth both' => 'H:i, "ngày" j xg "năm" Y',
105105
106106 'vi shortcolon time' => 'H:i',
107107 'vi shortcolon date' => 'j/n/Y',
108108 'vi shortcolon both' => 'H:i, j/n/Y',
109109
110 - 'vi short time' => 'H"h"i',
111 - 'vi short date' => 'j/n/Y',
112 - 'vi short both' => 'H"h"i, j/n/Y',
 110+ 'vi shorth time' => 'H"h"i',
 111+ 'vi shorth date' => 'j/n/Y',
 112+ 'vi shorth both' => 'H"h"i, j/n/Y',
113113 );
114114
115115 $datePreferenceMigrationMap = array(
@@ -165,18 +165,37 @@
166166 'thursday' => 'thứ năm',
167167 'friday' => 'thứ sáu',
168168 'saturday' => 'thứ bảy',
169 -'january' => 'tháng Một',
170 -'february' => 'tháng Hai',
171 -'march' => 'tháng Ba',
172 -'april' => 'tháng Tư',
173 -'may_long' => 'tháng Năm',
174 -'june' => 'tháng Sáu',
175 -'july' => 'tháng Bảy',
176 -'august' => 'tháng Tám',
177 -'september' => 'tháng Chín',
178 -'october' => 'tháng Mười',
179 -'november' => 'tháng Mười một',
180 -'december' => 'tháng Mười hai',
 169+'sun' => 'thứ 1',
 170+'mon' => 'thứ 2',
 171+'tue' => 'thứ 3',
 172+'wed' => 'thứ 4',
 173+'thu' => 'thứ 5',
 174+'fri' => 'thứ 6',
 175+'sat' => 'thứ 7',
 176+'january' => 'tháng 1',
 177+'february' => 'tháng 2',
 178+'march' => 'tháng 3',
 179+'april' => 'tháng 4',
 180+'may_long' => 'tháng 5',
 181+'june' => 'tháng 6',
 182+'july' => 'tháng 7',
 183+'august' => 'tháng 8',
 184+'september' => 'tháng 9',
 185+'october' => 'tháng 10',
 186+'november' => 'tháng 11',
 187+'december' => 'tháng 12',
 188+'january-gen' => 'tháng Một',
 189+'february-gen' => 'tháng Hai',
 190+'march-gen' => 'tháng Ba',
 191+'april-gen' => 'tháng Tư',
 192+'may-gen' => 'tháng Năm',
 193+'june-gen' => 'tháng Sáu',
 194+'july-gen' => 'tháng Bảy',
 195+'august-gen' => 'tháng Tám',
 196+'september-gen' => 'tháng Chín',
 197+'october-gen' => 'tháng Mười',
 198+'november-gen' => 'tháng Mười một',
 199+'december-gen' => 'tháng Mười hai',
181200 'jan' => 'tháng 1',
182201 'feb' => 'tháng 2',
183202 'mar' => 'tháng 3',
Index: trunk/phase3/languages/classes/LanguageVi.php
@@ -1,73 +0,0 @@
2 -<?php
3 -/**
4 - * Based on Language.php 1.645
5 - * @addtogroup Language
6 - * Compatible to MediaWiki 1.5
7 - * Initial translation by Trần Thế Trung and Nguyễn Thanh Quang
8 - * Last update 28 August 2005 (UTC)
9 - */
10 -
11 -class LanguageVi extends Language {
12 - function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
13 - if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
14 -
15 - $datePreference = $this->dateFormat( $format );
16 -
17 - $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference );
18 - $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference );
19 - $year = $this->formatNum( substr( $ts, 0, 4 ), true );
20 -
21 - switch( $datePreference ) {
22 - case 3:
23 - case 4: return "$day/$month/$year";
24 - case MW_DATE_ISO: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
25 - default: return "$day $month năm $year";
26 - }
27 - }
28 -
29 - function timeSeparator( $format ) {
30 - $datePreference = $this->dateFormat($format);
31 - switch ( $datePreference ) {
32 - case '4': return 'h';
33 - default: return ':';
34 - }
35 - }
36 -
37 - function timeDateSeparator( $format ) {
38 - $datePreference = $this->dateFormat($format);
39 - switch ( $datePreference ) {
40 - case '0':
41 - case '1':
42 - case '2': return ', ';
43 - default: return ' ';
44 - }
45 - }
46 -
47 - function formatMonth( $month, $format ) {
48 - $datePreference = $this->dateFormat($format);
49 - switch ( $datePreference ) {
50 - case '0':
51 - case '1': return 'tháng ' . ( 0 + $month );
52 - case '2': return 'tháng ' . $this->getSpecialMonthName( $month );
53 - default: return 0 + $month;
54 - }
55 - }
56 -
57 - function formatDay( $day, $format ) {
58 - $datePreference = $this->dateFormat($format);
59 - switch ( $datePreference ) {
60 - case '0':
61 - case '1':
62 - case '2': return 'ngày ' . (0 + $day);
63 - default: return 0 + $day;
64 - }
65 - }
66 -
67 - function getSpecialMonthName( $key ) {
68 - $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';
69 - $names = explode(', ', $names);
70 - return $names[$key-1];
71 - }
72 -}
73 -
74 -?>
Index: trunk/phase3/RELEASE-NOTES
@@ -319,6 +319,7 @@
320320 * (bug 9220) Removed obsoletes functions in install-utils.inc.
321321 * Removed obsoletes Title::getRelatedCache and Title:touchArray
322322 * (bug 7285) Check MySQL username length during install
 323+* (bug 6910) Correct date/time formats in Vietnamese (vi)
323324
324325 == Maintenance ==
325326
@@ -401,6 +402,7 @@
402403 * Ukrainian (uk)
403404 * Urdu (ur)
404405 * Uzbek (uz)
 406+* Vietnamese (vi)
405407 * Zealandic (zea)
406408 * Chinese (PRC) (zh-cn)
407409 * Chinese (Taiwan) (zh-tw)

Follow-up revisions

RevisionCommit summaryAuthorDate
r21326* (bug 6910) minor correction in Vietnamese (vi)...raymond15:17, 17 April 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r17977* (bug 6910) Dates in Vietnamese localization brokennikerabbit16:58, 28 November 2006