Module talk:Lang-zh

This is an old revision of this page, as edited by Jim101 (talk | contribs) at 00:41, 30 November 2009 (VANDALISM: Vampire sightings?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 15 years ago by Jim101 in topic VANDALISM: Vampire sightings?

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)Reply

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)Reply
Impressive, having a template where Cantonese is nor forced to Jyutping would be really good! Akerbeltz (talk) 22:47, 18 September 2009 (UTC)Reply
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)Reply
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)Reply

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)Reply

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)Reply
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)Reply
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)Reply
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)Reply
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)Reply

Pinyin italicization

Is there a particular reason for Pinyin to be the only romanization that's italicized? I feel like all of them should either be italicized or not italicized, not a mix of the two. Arsonal (talk) 07:48, 28 September 2009 (UTC)Reply

I did think about that after I added the pinyin italics, but I'm not totally sure about standards. I agree that it's best to italicize all, but I'm not sure if there are some that aren't usually italicized; I'll leave a quick query at WT:CHINESE and then see. rʨanaɢ talk/contribs 12:05, 28 September 2009 (UTC)Reply
Please de-italicize the pinyin in this template. It renders the diacritics difficult to read, and we generally don't italicize pinyin at WP. Badagnani (talk) 02:27, 21 October 2009 (UTC)Reply
I added this to make italicization optional. (The default is now set to no italics; this can be changed if there is a consensus to do so). Italics can now be forced by either adding a |ital=yes parameter to the template call, or by just putting '' '' around the pinyin text in the template. rʨanaɢ talk/contribs 02:51, 21 October 2009 (UTC)Reply
Thank you. Badagnani (talk) 02:43, 3 November 2009 (UTC)Reply

Simple use

The basic use like {{zh|厚朴}} doesn't work. Could you fix this? --Apoc2400 (talk) 14:59, 7 November 2009 (UTC)Reply

Fixed. But it's better to specify what you want using {{zh|c=厚朴}}, {{zh|s=厚朴}}, etc. rʨanaɢ talk/contribs 17:40, 7 November 2009 (UTC)Reply
Yes, you're right, but sometimes I don't know which it is. It still doesn't seem to work, {{zh|厚朴}}: Chinese: 厚朴. --Apoc2400 (talk) 18:40, 7 November 2009 (UTC)Reply
Oops! I had fixed the code in my sandbox, and forgot to move the fixed code to the real template. Should be working now. rʨanaɢ talk/contribs 18:43, 7 November 2009 (UTC)Reply
Thanks. Can you make {{zh|厚朴|foo}} do something resonable too? Either default to pinyin or just output foo with no description before. --Apoc2400 (talk) 18:57, 7 November 2009 (UTC)Reply
Hm... I think after a point, it gets a bit dangerous to try to guess what users mean when they didn't input the parameter names, so for that reason just ouputting "foo" by itself would be better. But even in that case, I'm not sure if that's the best way to go...if you output "foo", the user might not realize that anything was wrong. If someone uses {{zh|厚朴|foo}} and the second parameter doesn't show up, then at least he'll notice there's a problem and go check the template documentation to see how to fix it, and therefore won't make the same result again. I think this is probably the best option. Besides, forms like {{zh|厚朴|foo}} are not really being used as far as I know; when you see them they're just a result of replacements that happened during the bot run, and they seem to be pretty rare (and I'm figuring that when they do happen, people watching the page will fix them manually). rʨanaɢ talk/contribs 19:20, 7 November 2009 (UTC)Reply
I saw a case in Gua Sha, that you just fixed. For the trade off, it depends on how important is it to specify what kind of romanization is used. --Apoc2400 (talk) 19:56, 7 November 2009 (UTC)Reply

Also, is there a way to mark something as Chinese, without producing the 'Chinese:' text? Like {{nihongo}} does for Japanese? --Apoc2400 (talk) 18:44, 7 November 2009 (UTC)Reply

For that it's better just to use the {{lang|zh}} template, which puts it in Chinese font and stuff. It would look like {{lang|zh|厚朴}}. For example, see Chinese classifier, which has this template all over the place. rʨanaɢ talk/contribs 18:51, 7 November 2009 (UTC)Reply
Ok, that's kind of complex though. Didn't {{lang-zh}} use to do just that? --Apoc2400 (talk) 18:57, 7 November 2009 (UTC)Reply
Hm, as far as I can tell that template always did what this one does, which is make "Chinese: ___". I think {{lang}} is more versatile.
And actually, lang-zh should have been replaced with the others when ZhBot did his run... I didn't realize that template existed, so I'll go quickly run the bot again. rʨanaɢ talk/contribs 19:00, 7 November 2009 (UTC)Reply
Ok, I guess I remember wrong. {{lang}} seems fine. I added an other question above. --Apoc2400 (talk) 19:11, 7 November 2009 (UTC)Reply

Template malfuction on Battle of Triangle Hill

I don't know how the vandals inserted stuffs into the template, but once I remove the template, the vandalism is gone. Jim101 (talk) 00:30, 30 November 2009 (UTC)Reply

VANDALISM: Vampire sightings?

I cannot edit this page, but the current version appears to be vandalized. In addition to the usual text, it includes the following nonsense blurb, whose origin I cannot trace:

There has only ever been 12 reports of vampire siteings and the picturs and Bite's have been breath takingly scary Creepy. a long time ago in 1945 a woman called Mara valances was drained of her blood Throu to Pin sized hole's in her neck just below her Left cheek. The strange thing doctor's noticed is her hole body was dry, But she continued to breath slowly but strong asif she was in a deep sleep. Doctor's reported this to the police shortly after the attack in south Texas. Is was belived she had found maby proof of Existance of vampier's and she was silenced. Mara Valances story was kept secret so that tourisim didnt Get inturupted.

This is of course a really significant issue since it appears on all pages that use the template, which is pretty much all pages that have to do with anything Chinese. Miranche (talk) 00:32, 30 November 2009 (UTC)Reply

Some idiot vandalized Template:;...fixed now. Jim101 (talk) 00:41, 30 November 2009 (UTC)Reply