Last modified: 2009-05-20 07:16:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7755, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5755 - Have CURRENTMONTH render without the leading digit
Have CURRENTMONTH render without the leading digit
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-29 08:25 UTC by Shinjiman
Modified: 2009-05-20 07:16 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
the patch for the Language.php including the new CURRENTMONTH magic word (722 bytes, patch)
2006-04-29 08:27 UTC, Shinjiman
Details
the patch for the MagicWord.php including the new CURRENTMONTH magic word (544 bytes, patch)
2006-04-29 08:27 UTC, Shinjiman
Details
the patch for the Parser.php including the new CURRENTMONTH magic word (560 bytes, patch)
2006-04-29 08:28 UTC, Shinjiman
Details

Description Shinjiman 2006-04-29 08:25:59 UTC
Currently, the CURRENTMONTH magic word outputs the current month in two digits,
however, some languages are mostly uses the single digit for the first nine
months, the proposed changes will add the ability to render the current month
number in single digit for the first nine months, this magic word is useful
especially for the East Asian languages. Although there's a magic word
CURRENTDAY and CURRENTDAY2 already, changes are provided in below for consistency:

* the existing CURRENTMONTH will be changed into CURRENTMONTH2 (same functionary);
* the new CURRENTMONTH magic word is used to render the currentmonth in single
digit for first nine months.

For example:
The current month is April,
the output of the {{CURRENTMONTH}} is 4, and using {{CURRENTMONTH2}} is 04.
And if the current month is May,
the output of the {{CURRENTMONTH}} is 5, and using {{CURRENTMONTH2}} is 05.

For applying the proposed changes, those files are need to be changed:
* includes/MagicWord.php
* includes/Parser.php
* languages/Language.php

hope my patch works. :)
Man
Comment 1 Shinjiman 2006-04-29 08:27:18 UTC
Created attachment 1622 [details]
the patch for the Language.php including the new CURRENTMONTH magic word
Comment 2 Shinjiman 2006-04-29 08:27:46 UTC
Created attachment 1623 [details]
the patch for the MagicWord.php including the new CURRENTMONTH magic word
Comment 3 Shinjiman 2006-04-29 08:28:02 UTC
Created attachment 1624 [details]
the patch for the Parser.php including the new CURRENTMONTH magic word
Comment 4 Shinjiman 2006-04-29 08:31:48 UTC
The discussions regarding dor this bug is at wikitech-l: Getting the current
month number without leading zero
http://mail.wikipedia.org/pipermail/wikitech-l/2006-April/034833.html

Man
Comment 5 Shinjiman 2006-04-29 09:42:59 UTC
The recent discussions in Chinese wiki is at:
http://zh.wikipedia.org/wiki/Talk:%E9%A6%96%E9%A1%B5/%E6%A1%A3%E6%A1%882#.E6.95.B0.E5.AD.97.E9.A1.AF.E7.A4.BA

This discussion is in Chinese language which the discussion is logged at June 2003.
Comment 6 Rob Church 2006-04-29 18:54:30 UTC
What about the other wikis, using the old format for their own purposes? This
will break quite a bit of existing data.
Comment 7 Shinjiman 2006-04-30 03:02:18 UTC
This is the similar case as the CURRENTDAY and CURRENTDAY2 magic word.

I've considered to use the CURRENTMONTH1 magic word (more atomic). But however, 
make a new magic word CURRENTMONTH2 is more consistent then the CURRENTMONTH1 
magic word.

it's like: (first resolution, more consistent)

Month/Day in one digit    Month/Day in two digit
======================    ======================
CURRENTMONTH              CURRENTMONTH2
CURRENTDAY                CURRENTDAY2

or like: (second resolution, more atomic)

Month/Day in one digit    Month/Day in two digit
======================    ======================
CURRENTMONTH1              CURRENTMONTH
CURRENTDAY                 CURRENTDAY2

I think if the first solution is taken, it need to notify other local wikis to 
announce the change of the magic word, this announcement can be done on 
Announcements part on meta. If the second resolution is taken, it's make the 
variable name of MediaWiki software not consistent. (see the above discussion on 
wikitech-l as I've posted on the comment #4 before)
Comment 8 Shinjiman 2006-05-01 18:42:30 UTC
in addition, I think there's an idea how to apply the new CURRENTMONTH magic word, 
which can be divided into two phases:

First phase (CURRENTMONTH2 rollout):
Make a magic word CURRENTMONTH2 which do the same functionality as the 
CURRENTMONTH magic world. During this stage, it's need to notify other wikis to 
going have the changes on the magic word, this stage maybe last for one to one and 
half month, this buffer time can be called as migration period.

Second phase (CURRENTMONTH rollout):
After the migration period endes, apply the changes for CURRENTMONTH magic word  
from two digits to one digit.
Comment 9 Filip Maljkovic [Dungodung] 2006-05-03 22:50:49 UTC
one to one and half month?! That's hell long. A python bot or a php script could
do it in a day or so.
Comment 10 Shinjiman 2006-05-04 02:32:14 UTC
(In reply to comment #9)
> one to one and half month?! That's hell long. A python bot or a php script 
coulddo it in a day or so.

Haven't you considered in other wikis that do not have a bot, or they did nont 
know the changes prior of implementation of this set of code? I think that the 
migration period is necessary. but hopefully this one can be fully implemented in 
version 1.7 (seems currently cannot choose v1.7 in target milestone in BugZilla :D)
Comment 11 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-24 13:59:27 UTC

*** This bug has been marked as a duplicate of 7116 ***
Comment 12 Shinjiman 2009-05-20 07:01:42 UTC
This request was intended to be done on the core, neither on its extensions, REOPENING.
Comment 13 Shinjiman 2009-05-20 07:16:17 UTC
Applied on r50811.

While the {{CURRENTMONTH}} keyword is still works in the same manner for transparency,
thus a new magic word {{CURRENTMONTH1}} can be used instead.

Also {{CURRENTMONTH2}} has been added for consistency with other magic words. :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links