Content deleted Content added
Archiving 1 discussion(s) from Module talk:Zh) (bot |
m Archiving 1 discussion(s) from Module talk:Zh) (bot |
||
Line 100:
:::I should add that having looked at it again there are at least two bugs in the output of {{tl|CJKV}} that need fixing. See [[Template talk:CJKV#Problems]]. The problems are precisely the sorts of problems that arise in complex parser code (the extra semi-colon was happening here too, with s = t, before it was converted to Lua). That template's code is particularly tricky though, even worse than this one before it was converted to Lua, so by far the easiest fix would be to convert it to Lua.--<small>[[User:JohnBlackburne|JohnBlackburne]]</small><sup>[[User_talk:JohnBlackburne|words]]</sup><sub style="margin-left:-2.0ex;">[[Special:Contributions/JohnBlackburne|deeds]]</sub> 13:41, 26 May 2014 (UTC)
== First=tj ==
Breaking this out into a new section as I think this is ready for rolling out, but I'll summarise it again as it's embedded a few subsections back.
I've added support (to the sandbox) for putting Cantonese Romanisations 'first', that is before Mandarin Romanisations. So Jyutping and/or Cantonese Yale (whichever is specified) go before pinyin, Tongyong pinyin and Wade–Giles (again whichever is/are specified). The thinking is similar to putting traditional before simplified Chinese chars, it won't be used as much but it's there for when editors need it. My survey of the uses of {{tl|zh-full}} suggest it's the only ordering not supported by the current template that there's any need for.
The way it works is by overloading the <code>first=</code> parameter, so as well as specifying <code>first=t</code> an editor can supply <code>first=j</code>, or combine them in one as <code>first=tj</code> or <code>first=jt</code>. If 't' is supplied then traditional Chinese characters go first. If 'j' is supplied then Cantonese Romanisations go first. Anything else is ignored (which allows for future support for other reordering rules using other letters). Here it is in action and, examples have also been added to [[Template:Zh/testcases|the testcases]]:
* <nowiki>{{Zh/sandbox|s=中国|t=中國|p=zhōngguó|j=Gwong²zau¹|first=t|labels=no}}</nowiki>: {{Zh/sandbox|s=中国|t=中國|p=zhōngguó|j=Gwong²zau¹|first=t|labels=no}}
* <nowiki>{{Zh/sandbox|s=中国|t=中國|p=zhōngguó|j=Gwong²zau¹|first=j, t|labels=no}}</nowiki>: {{Zh/sandbox|s=中国|t=中國|p=zhōngguó|j=Gwong²zau¹|first=j, t|labels=no}}
This is better than other options considered.
* Having Cantonese first when traditional is first works with most but not with all articles, and would change existing articles perhaps incorrectly.
* Using regions (HK, TW, CN, SG, etc.) might work better but would be very disruptive and not handle all cases, such as [[Jao Tsung-I]].
* Adding another parameter would be unnecessary clutter, especially for something so little used.
* Doing it optionally based on the order parameters are listed, like {{tl|zh-full}}, is incompatible with the Visual Editor.
It doesn't change any existing instances of the template, so is very safe. It's also interesting as perhaps the first change that would be almost impossible to do with parser functions, i.e. without Lua (sure there would be a way but it would be horribly complex).
So I think this is ready to roll out to the main template/module.--<small>[[User:JohnBlackburne|JohnBlackburne]]</small><sup>[[User_talk:JohnBlackburne|words]]</sup><sub style="margin-left:-2.0ex;">[[Special:Contributions/JohnBlackburne|deeds]]</sub> 03:15, 30 May 2014 (UTC)
:I would prefer that the 'tj' be delimited in some way such as a comma. e.g. 't,j'. This is because at some time in the future you may want to expand the list of accepted values for 'first' and some future attributes might not be single letters. This would future proof the template somewhat. [[User:Rincewind42|Rincewind42]] ([[User talk:Rincewind42|talk]]) 14:43, 30 May 2014 (UTC)
::Done. I might have quibbled over this if it were just for the reason given, as 26 letters of the alphabet should enough for as many options in future as we might need. But I think it also helps visually: it's easier to see that there are two things, not one, as "jt" could e.g. be an odd abbreviation for jyutping. The delimeter can be anything non-alphabetic; comma, comma-space, slash, space should all work. The code supports multiple-character specifiers though it only recognises 't' and 'j' at the moment. I've updated the testcases and the examples above.--<small>[[User:JohnBlackburne|JohnBlackburne]]</small><sup>[[User_talk:JohnBlackburne|words]]</sup><sub style="margin-left:-2.0ex;">[[Special:Contributions/JohnBlackburne|deeds]]</sub> 15:28, 30 May 2014 (UTC)
{{edit template-protected|answered=yes}}
Again please update the main module from its sandbox, to effect the changes described immediately above and in more detail in [[#Cantonese first issues]].--<small>[[User:JohnBlackburne|JohnBlackburne]]</small><sup>[[User_talk:JohnBlackburne|words]]</sup><sub style="margin-left:-2.0ex;">[[Special:Contributions/JohnBlackburne|deeds]]</sub> 23:23, 31 May 2014 (UTC)
:[[File:Yes check.svg|20px|link=]] '''Done'''<!-- Template:ETp --> [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 18:53, 1 June 2014 (UTC)
|