Jump to content

Module talk:Lang-zh/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 01:36, 7 October 2014 (Archiving 1 discussion(s) from Module talk:Zh) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2Archive 3Archive 4Archive 5

Zh-xx consolidation dicussion (copy)

The more I look, the more I feel the mess at Category:Chinese multilingual support templates is out of control. There seems to be a lot of redundancy with all these templates...redundancy in of itself isn't bad, but it causes problems when one template is updated (like I recently did), since there are like a hundred others that need to be updated as well, and it can't necessarily be done with AWB.

So, to that end, I just created User:Rjanag/zh, a template that I believe has the functionality of all of these templates. The only difference is that you have to use named parameters, not numbered...but I think most of these template calls used named parameters anyway (ie, {{zh-cp|c=某|p=something}}, rather than {{zh-cp|某|something}}). When making it, I was careful to make sure that I didn't lose any of the functionalities contained in any of the other templates. Ideally, this template could be moved to {{zh}} and then all articles could just use that one, and display the relevant Chinese and romanizations based on what templates are used (for example, some would use {{zh|c=something|p=something|l=something}}, while others might use {{zh|s=something|t=something|p=something}}, the difference being that the second one gives both simplified and traditional). Currently, though, {{zh}} is a redirect to {{zh icon}} and a lot of pages seem to use it; it might be used in other ways, too, because its WhatLinksHere says it's included in some random pages (for instance, Quiznos) but I can't find it in the wikitext, suggesting that it's a transclusion within a transclusion....

Anyway, I'm thinking that if it's possible some day for me to go through and manually replace the {{zh}}s with {{zh icon}}s, then I can move this new template to there and slowly start replacing specific templates (like {{zh-cp}}) with this one, in all the articles where they're used. Do you have any thoughts on this? rʨanaɢ talk/contribs 06:35, 18 September 2009 (UTC)

Good idea, a lot of work. You might want to put your template in mainspace under "zh-testing" or s.t., redirect a common zh-xx template to it, and wait for the complaints to flood in if you've missed s.t., then try another, etc., until you're confident you've got it right, meanwhile migrating from zh to zh icon with AWB (preparse?). Of course, it might not be possible to rd some of the zh-xx templates until the individual articles have named parameters; that could be done with AWB and regex, though I don't know if I'm up to that kind of complexity in regex--I can't get some things to work that look simple on paper. Anyway, no point in editing the individual articles (except for named parameters) until you've redirected all the templates and they're working well. I wouldn't spend my time on it even then; there are bots that can automate the task. kwami (talk) 07:43, 18 September 2009 (UTC)
Impressive, having a template where Cantonese is nor forced to Jyutping would be really good! Akerbeltz (talk) 22:47, 18 September 2009 (UTC)
One comment: first=t puts Tongyong before Hanyu, but since Taiwan's switched to Hanyu, do we want them linked like that? Would it be possible to have a generic n=x, where n is any ordinal, and x is any parameter, and repeatable (1=t, 2=s, 3=p, etc.)? kwami (talk) 06:35, 19 September 2009 (UTC)
Ah, I didn't think about that. I could just get rid of the Tongyong-before-Hanyu bit...the important thing is allowing trad. to go before simp., but I'm not so concerned about the different Pinyin styles. I also considered adding something like first=j to allow Jyutping to go before Pinyin (for Cantonese-related articles), but then again I'm not sure how widely accepted/used Jyutping is as compared to others.
As for an n=x setup, it should be possible, it would just require lots of messy code—as you can see with the trad./simp. characters, the only way I really know to do it so far is to repeat the code over and over again in different parts of the template. Another option would be to divide the templates into core and shell templates...ie, put all the messy code for displaying simplified characters (for example) into {{zh-s}} (after usurping that...or I could just give it a new name), do that for everything, and then make {{zh}} itself be nothing more than a shell template that has a big #switch statement deciding which thing to show and when. It sounds like something I can play around with in my userspace for a while...these things always seem to work out better in my head than they do in actual code!
If enough functionality gets added to that, it might even be better to divide this across two templates, the current {{zh}} template left more or less as-is to be used in most cases (where people aren't concerned about ordering and the current version is sufficient), and something new, like {{zh-full}} or something, which would have extended functionality but also more parameters and more complicated syntax. rʨanaɢ talk/contribs 15:12, 19 September 2009 (UTC)

The people behind Jyutping are just pushy (off Wiki I mean); it has flaws, especially for an English speaking audience, especially the j for [j] and c for [tʃ] thing. Is it not possible to have the ordering flexible, as in, that if you move one above the other manually, they display that way? I must confess to a high degree of ignorance regarding templates. Akerbeltz (talk) 18:02, 19 September 2009 (UTC)

I don't foresee too much need for flexibility apart from traditional before simplified. Actually, I'd think we'd want that as the default, with "first=s" as an option. After all, traditional is the international form, with simplified being restricted to mainland China (and maybe Singapore?). kwami (talk) 19:41, 19 September 2009 (UTC)
Perhaps...although at this point it will be difficult to change. I didn't notice your message before I started replacing, and now I've basically gone through and replaced many of the traditional-first templates with {{zh | ....... | first=t}}, and many of the simplified-first with just {{zh}} (but I haven't done all of them...there are still several thousand more, so rather than trying to do them by hand I'm starting to fiddle with bot stuff). So things that already have first=t won't be changed if I update the template, but things that don't (i.e., any articles about mainland China stuff) will be changed, unless a simple way can be found to go and insert first=s into all of them. rʨanaɢ talk/contribs 00:19, 20 September 2009 (UTC)
AWB can insert first=s into templates which do not contain first=t, and I assume other bots could easily do the same. It should be ignored unless and until it's defined. kwami (talk) 07:02, 20 September 2009 (UTC)
It would have to be done by a bot, since there are over 6,000 articles that would need to be edited.
Also, about the suggetsion above for a template with more flexibility... I threw together a mock-up at User:Rjanag/zh-full (with an example in my sandbox), which gives the user full control (I think) over the order in which they display things. In most cases that much control isn't necessary (and indeed, the vast majority of combinations would be illogical...for instance, you would never put the literal translation or any of the romanizations before the Chinese characters), but after some more tweaks I could probably put it into mainspace in the off-chance that anyone wants more control (over, for example, the order in which various romanizations are displayed in a given article). rʨanaɢ talk/contribs 16:34, 20 September 2009 (UTC)
Well, if it's easy to do and not code intensive, why not. But you might wait until there is an actual demand for a particular option - it might never materialize, or materialize in a way we didn't expect. kwami (talk) 22:37, 20 September 2009 (UTC)


I agree we should not make first=s as the default. Further we should create {{zh-tw}} and {{zh-hk}}, to make first=t default (and Cantonese too for articles related to Hong Kong). 14.0.144.63 (talk) 16:56, 4 April 2013 (UTC)

I do not understand what you're saying. First of all, something has to be the default (unless we give it no default, which means that there will be an error when |first= is not provided, and that would just make it a pain for people to use). So if you're saying the default should not be simplified characters, then I guess you're saying you think traditional should be the default. As far as I have seen, there is no strong argument for or against making either one the default. I happen to be a user of mainland Chinese and thus I made the simplified stuff first, but nevertheless there is no compelling reason to change it.
Regarding your suggestion of making separate templates with different defaults, I must respectfully disagree. The entire purpose of creating this template was to consolidate everything into one template; before I did this, there were scores of different "zh" templates on Wikipedia and they were not internally consistent (i.e., some were no longer maintained, or didn't format in the same way as others). Your suggestion would re-introduce that problem. It's much better to have one template that does everything, and then when changes need to be made they only need to be made here. Furthermore, I don't see what problem your suggestion solves. It lets people not have to type "first=t" to get traditional characters first, but they still have to type that extra "-tw" or "-hk", so really you're only saving them a few characters. In fact you're costing them more characters, since this template has the option of setting a |first= default for the whole page (and thus you can get traditional characters first for the whole page, without having to enter |first=t every time), whereas under your suggestion if someone were writing a long article they'd have to use zh-tw or zh-hk over and over again. Quite simply, the current template is better. rʨanaɢ (talk) 22:13, 4 April 2013 (UTC)

Items should be comma-delimited

Where a term is given in more than one lang, the langs are usually separated by semicolons and items of a particular lang are separated by commas, e.g. <the language>: <the term itself>, <the transliteration>, <the transcription>; <another language>: <the term in that language>, ... . This one's items being comma-separated makes things a little confusing and disorderly. — Lfdder (talk) 19:30, 22 September 2013 (UTC)

I've added a delim param in the sandbox, compare:
Would anyone be against importing it? — Lfdder (talk) 19:39, 22 September 2013 (UTC)
Already discussed at length above. rʨanaɢ (talk) 09:57, 23 September 2013 (UTC)

There doesn't seem to be any opposition to this change.Lfdder (talk) 11:18, 23 September 2013 (UTC)

 Not done Then you don't seem to have read the discussion. rʨanaɢ (talk) 18:37, 23 September 2013 (UTC)
I've read it. The possibility of an optional param never came up. What's wrong with adding a delim param that'll have no effect on existing transclusions, but will make sense for when there's other langs listed? — Lfdder (talk) 18:47, 23 September 2013 (UTC)
I don't see the point of this, adding extra complexity and unnecessary variation. You write that 'items of a particular lang are separated by commas' but these are not terms in a language, as Chinese is not a single language, which causes particular problems. To illustrate:
  • {{zh | t=香港| s=香港| p=Xiānggǎng| j=Hoeng1gong2}}
    Chinese: 香港; pinyin: Xiānggǎng; Jyutping: Hoeng1gong2
Cantonese (represented by the Jyutping) and Mandarin are two separate languages, but they have the same written form. So they should be separated by semicolons except with 香港 where commas should appear. Which is impossible. And this is a relatively simple example. --JohnBlackburnewordsdeeds 19:37, 23 September 2013 (UTC)
You must be proud for having come up with such a brilliant distraction. Plainly, "Chinese", "pinyin" and "Jyutping" are related; Uyghur is not. Separating them all with semicolons is inappropriate. — Lfdder (talk) 19:58, 23 September 2013 (UTC)
Pinyin and Jyutping are no more related than French and Spanish. Also, as I already pointed out multiple times in the previous discussions, if you absolutely must use commas, {{zh-full}} already allows that. rʨanaɢ (talk) 04:27, 24 September 2013 (UTC)
What about my suggestion from that discussion back in 2011 about using semicolons to delimit within language families ("Chinese", "Japanese", "Mongolian", etc.) in the template while using commas to delimit varieties within those families ("pinyin", "Jyutping", "Peh-oe-ji", etc.)? Maybe that would be an acceptable compromise.  White Whirlwind  咨  06:03, 24 September 2013 (UTC)
Like I said in 2011, {{zh-full}} already allows that. Delimiters between families are usually not part of any template (because the different families are added by separate template), so anyone can use a semicolon there if they want. {{zh-full}} allows you to use commas between Chinese-related things. So I don't really see what the issue is. rʨanaɢ (talk) 08:00, 24 September 2013 (UTC)

Please change the link for "Cantonese Yale" to Yale romanization of Cantonese, as done in the sandbox[1]. Kanguole 22:40, 23 November 2013 (UTC)

Done thank you. Callanecc (talkcontribslogs) 05:11, 24 November 2013 (UTC)

Using Nihongo template and zh template together

There are some difficulties when trying to use both Nihongo and zh template together. Please see Template talk:Nihongo#Using Nihongo template and zh template together Rincewind42 (talk) 06:45, 1 January 2014 (UTC)

Language tagging for pinyin

It feels odd that, when multiple parameters are supplied (such as simplified Chinese: 优酷; traditional Chinese: 優酷; pinyin: yōukù, that the pinyin isn't tagged with {{lang}}.

Is there a reason why the pinyin isn't output as ''{{lang|zh-Latn|yōukù}}'' or ''{{lang|zh-Latn-pinyin|yōukù}}'' (yōukù) ? — OwenBlacker (Talk) 17:42, 8 April 2014 (UTC)

Agree. The pinyin is still Chinese, not English and so should be tagged as such. Either the using the template:lang and zh-latin / zh-Latn-pinyin as OwenBlacker said or else by using the template:transl such as ''{{transl|zh|yōukù}}''. Both have the same end result in the html code. Not just the pinyin, all the transliterations should be tagged similarly. Rincewind42 (talk) 05:35, 9 April 2014 (UTC)