Template talk:Year in various calendars

WikiProject Time (Rated Template-class)
WikiProject icon This template is within the scope of WikiProject Time, a collaborative effort to improve the coverage of Time on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
  Template  This template does not require a rating on the project's quality scale.
 

Minguo calendar (2) Semi-protected edit request

This is a replacement for the preceding section

The Lua implementation of the Minguo calendar contains a Wikilink to the Republic of China (ROC). Unfortunately this has run foul of a change in the target page where it now redirects to Taiwan with the period when the Republic was on the mainland covered by the page Republic of China (1912–49). I believe this should be fixed either by removing the wikilink to the ROC, or by making pre-1950 references point to the 1912-1949 version.

I have created a version with the second change (below). I am an experienced programmer, but have not previously used Lua, I have tested this both in the sandbox and at home as a stand-alone file. I have added a test case for the year 1948 to test one of the years where the ROC was on the mainland.

        local minguo = calendar:new()
        minguo:setLink( 'Minguo calendar' )
        if year > 1949 then
                local minguoYear = year - 1911
                minguo:setYear( string.format( '[[Taiwan|ROC]] %d<br /><small>民國%d年</small>', minguoYear, minguoYear ) )
        elseif year > 1911 then
                local minguoYear = year - 1911
                minguo:setYear( string.format( '[[Republic of China (1912–1949)|ROC]] %d<br /><small>民國%d年</small>', minguoYear, minguoYear ) )
        else
                local minguoYear = 1911 - year + 1
                minguo:setYear( string.format( '%d before [[Republic of China (1912–1949)|ROC]]<br /><small>民前%d年</small>', minguoYear, minguoYear ) )
        end
        box:addCalendar( minguo )

Thank you Kiore ( talk) 19:52, 24 December 2016 (UTC)

Not done: This request should be made on the template's talk page. - Mlpearc ( open channel) 19:56, 24 December 2016 (UTC)
This is the Template's talk page. If you mean the Module's talk page, that redirects to here. Repeating request to change Module:Year in other calendars Kiore ( talk) 21:07, 24 December 2016 (UTC)
@ Kiore: Yes, I meant the module, sorry didn't know about the redirect. Cheers, - Mlpearc ( open channel) 21:10, 24 December 2016 (UTC)
Cancelling request. I've changed the module myself Kiore ( talk) 20:51, 25 December 2016 (UTC)