Module talk:Lang-zh: Difference between revisions
Line 76: | Line 76: | ||
::::[[User:Pppery|Pppery]], Actually, I made several revisions to the module from the initial one, making initial fixes. Could you merge the newest revision of the sandbox?<span id="Remsense:1698366611655:Module_talkFTTCLNLang-zh" class="FTTCmt"> — [[User:Remsense|<span style="border-radius:3px 0 0 3px;padding:4px 3px;background:#1E816F;color:#fff">'''Remsense'''</span>]][[User talk:Remsense|<span lang="zh" style="border:1px solid #1E816F;border-radius:0 2px 2px 0;padding:2px;color:#000">聊</span>]] 00:30, 27 October 2023 (UTC)</span> |
::::[[User:Pppery|Pppery]], Actually, I made several revisions to the module from the initial one, making initial fixes. Could you merge the newest revision of the sandbox?<span id="Remsense:1698366611655:Module_talkFTTCLNLang-zh" class="FTTCmt"> — [[User:Remsense|<span style="border-radius:3px 0 0 3px;padding:4px 3px;background:#1E816F;color:#fff">'''Remsense'''</span>]][[User talk:Remsense|<span lang="zh" style="border:1px solid #1E816F;border-radius:0 2px 2px 0;padding:2px;color:#000">聊</span>]] 00:30, 27 October 2023 (UTC)</span> |
||
::::: {{done}} Those too. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 00:44, 27 October 2023 (UTC) |
::::: {{done}} Those too. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 00:44, 27 October 2023 (UTC) |
||
{{re|Pppery|Remsense}} Was it after these edits that the lead of [[Prunus kansuensis]] started to look so bold? [[Special:Contributions/77.223.109.164|77.223.109.164]] ([[User talk:77.223.109.164|talk]]) 17:09, 19 December 2023 (UTC) |
|||
== Preventing problems with italic and literals == |
== Preventing problems with italic and literals == |
Revision as of 17:10, 19 December 2023
This module does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
To help centralize discussions and keep related topics together, Template talk:Lang-zh and Template talk:Lang-zh/doc redirect here. |
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Foochow Romanized/Bàng-uâ-cê
Hello, can a parameter for Foochow Romanized be created? --Lousysofa (talk) 17:02, 27 March 2023 (UTC)
Template-protected edit request on 14 October 2023
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Diff with my sandbox implementation: diff
This does three major things, things that address real perennial limitations with the {{zh}}
template:
- It adds a new
|out=
parameter, allowing one to select one of the terms to place before the rest, which are then put in brackets, an extremely common presentation format when writing Chinese text inline in paragraphs and tables. - It now uses double quotes for the
|tr=
parameter, for "full translations" instead of glosses, as is prescribed in MOS:FOREIGN and MOS:ZH. - It enables the use of multiple, correctly quoted glosses (literal translations,
|l=
), delineated by commas.
Examples:
{{Lang-zh/sandbox|c=我|p=wǒ|l=I, me|j=ngo<sup>5</sup>|out=j}}
- ↓
- Jyutping: ngo5 (Chinese: 我; pinyin: wǒ; lit. 'I', 'me')⸻
|out=j
puts the value for|j=
outside the brackets {{Lang-zh/sandbox|s=中华|t=中華|p=Zhōnghuá|l=China|out=p|labels=no}}
- ↓
- Zhōnghuá (中华; 中華; 'China')
{{Lang-zh/sandbox|s=她刚刚离开了|l=she's just left|out=l}}
- ↓
- lit. 'she's just left' (Chinese: 她刚刚离开了)
{{Lang-zh/sandbox|s=电脑|t=電腦|tr=computer|p=diànnǎo|l=electric brain|out=tr|labels=no}}
- ↓
- "computer" (电脑; 電腦; diànnǎo; 'electric brain')⸻double quotes now used for
|tr=
I was apprehensive about patching the template, but I'm pretty sure I haven't broken anything, I'm sure someone more experienced than I will take a look-see before it gets merged. :) Remsense聊 17:20, 14 October 2023 (UTC)
- Remsense, would you be so kind in adding testcases for this change at Template:Lang-zh/testcases? SWinxy (talk) 20:36, 14 October 2023 (UTC)
- Certainly! I'll try to cover all the edge cases I can think of. Remsense聊 20:37, 14 October 2023 (UTC)
- I've gone ahead and added some! if you'd like me to be more thorough/any test cases you need to see, let me know. (Oh, and I found a bug in the process.) Remsense聊 21:17, 14 October 2023 (UTC)
- I fixed the (very obvious!) bug, and added the ability to put both simplified and traditional outside the parentheses. hopefully everything is good now! Remsense聊 00:37, 18 October 2023 (UTC)
- I have had a look at the testcases, and it's unclear from them what the use case for this is, what articles it would be used in. I mean when you have something like
- "computer" (电脑; 電腦; diànnǎo; 'electric brain')
- It would be normal to use the template for everything inside the bracket, and normal text for "computer". The ones where that wouldn't work such as:
- pinyin: Cài Yīngwén (Chinese: 蔡英文)
- I can't see a use for. You would never put pinyin like that in body text, with the Chinese characters in brackets. Generally in an article both the Chinese and Romanisations should go in brackets so as not to upset the flow of the English text, with the Chinese first. When the Chinese is being discussed, such as in an article on the language, this template isn't really suited for it.--2A04:4A43:90AF:FAB6:29E3:5D64:C243:2A6D (talk) 02:08, 15 October 2023 (UTC)
- You are able to put any field outside the brackets: gloss, characters, or romanization. There are situations where any of the three are appropriate, usually depending on whether the orthography, semantics, or phonetics are the focus of the prose. I've worked with all of them editing Chinese-related articles. The Tsai Ing-wen example was copied from above, I wouldn't actually write a personal name in such a way in an article. The cases were meant to demonstrate that all the features are working properly.
- Here is a tweaked excerpt from Chinese characters where a pinyin-first example is the best-flowing, in my opinion.
- The barrier between pronunciation and meaning is never total, however: in the Chinese system, phonetic characters may be deliberately chosen as to create certain connotations. This regularly happens for corporate brand names: for example, 'Coca-Cola' is translated phonetically as Kěkǒu Kělè (可口可乐; 可口可樂), with the characters selected so as to possess an additional meaning of 'delicious and enjoyable'. A more literal translation would be 'the mouth can be happy', though the phrase is technically grammatically sound.
- Also, I think it's worth putting non-diacritical pinyin in
|lang=
tags when you can, because it will still be pronounced better by a screenreader than an English voice selected will attempting to read it aloud, e.g.{{zh|labels=no|c=蔡英文|p=Cai Yingwen|out=p}}
is better for screenreaders than justCai Yingwen ({{zh|labels=no|c=蔡英文}})
. - Remsense聊 02:13, 15 October 2023 (UTC)
- Done * Pppery * it has begun... 00:01, 27 October 2023 (UTC)
- Pppery, thank you so much! — Remsense聊 00:13, 27 October 2023 (UTC)
- Pppery, Actually, I made several revisions to the module from the initial one, making initial fixes. Could you merge the newest revision of the sandbox? — Remsense聊 00:30, 27 October 2023 (UTC)
- Done Those too. * Pppery * it has begun... 00:44, 27 October 2023 (UTC)
- Done * Pppery * it has begun... 00:01, 27 October 2023 (UTC)
@Pppery and Remsense: Was it after these edits that the lead of Prunus kansuensis started to look so bold? 77.223.109.164 (talk) 17:09, 19 December 2023 (UTC)
Preventing problems with italic and literals
Hi! I noticed a problem when someone wants to use literals with italic next to a bold word. For example the line below...
'''Pak Mong''' ({{zh|t=白芒|l=white ''[[miscanthus]]''}})
will produce something like...
Pak Mong (Chinese: 白芒; lit. 'white miscanthus')
instead of...
Pak Mong (Chinese: 白芒; lit. 'white miscanthus')
In order to solve the problem we could just change the line 193 from...
val = "'" .. val .. "'"
to...
val = "<nowiki>'</nowiki>" .. val .. "<nowiki>'</nowiki>"
What do you think? (@Underwaterbuffalo:) -- Basilicofresco (msg) 17:16, 19 October 2023 (UTC)
- Thank you for raising the issue encountered by FrescoBot at Pak Mong article. I don't have any expertise with modules. As long as the fix solves the issue and does not create others, I am all in favor! Underwaterbuffalo (talk) 09:34, 21 October 2023 (UTC)
- Yes, the single quotes used to mark literal glosses should not be interpreted as wiki markup. Kanguole 09:42, 21 October 2023 (UTC)
- The pending revision I have to the module currently produces an output of
- Chinese: 白芒; lit. 'white miscanthus', which i'm noticing isn't entirely correct. i'll fix it asap.
- Remsense聊 21:37, 21 October 2023 (UTC)
- And there we are! Properly escaping quotes now has
'''Pak Mong''' ({{Lang-zh/sandbox|t=白芒|l=white ''[[miscanthus]]''}})
- output
- Pak Mong (Chinese: 白芒; lit. 'white miscanthus')
- Remsense聊 17:13, 23 October 2023 (UTC)
- And there we are! Properly escaping quotes now has
Template-protected edit request
Allow specifying t variant: zh-Hant-HK vs zh-Hant-TW. See this image for an example of 返 vs 返. NM 02:45, 20 November 2023 (UTC)
- I will write a patch for this ASAP. Here's the question: how should it work? I am thinking just additional parameters
|tw=
and|th=
. But how the module presently works, if only one character field is specified, it just gets tagged aszh
. But it should be trivial to tweak the code so that the more specific language tag is used when specifying only|t=
or|s=
, et al.Remsense聊 02:54, 20 November 2023 (UTC)- I don’t think there’s a need to modify the logic for
|t=
and|s=
. Sometimes the region is really irrelevant that you only want to specify the script (for example, in a page that talks about the history of the writing system). - We should also avoid ambiguous abbreviations and just go with a slightly longer format like
t_hk
ands_sg
. - NM 05:08, 26 November 2023 (UTC)
- fair—it's really difficult, re: abbreviations, because after the 10th time entering it in an article, you might wish concision was favored over disambiguation, but yeah. I still haven't started on this, but I'll keep this in mind when I get to it shortly. Remsense聊 05:26, 26 November 2023 (UTC)
- I don’t think there’s a need to modify the logic for
- Template-Class Writing system pages
- NA-importance Writing system pages
- Template-Class China-related pages
- NA-importance China-related pages
- Template-Class China-related articles of NA-importance
- WikiProject China articles
- Template-Class Taiwan pages
- NA-importance Taiwan pages
- WikiProject Taiwan articles
- Template-Class Hong Kong pages
- NA-importance Hong Kong pages
- WikiProject Hong Kong articles
- NA-Class Macau pages
- NA-importance Macau pages
- WikiProject Macau articles
- Template-Class Singapore pages
- NA-importance Singapore pages
- WikiProject Singapore articles
- Template-Class Malaysia pages
- NA-importance Malaysia pages
- WikiProject Malaysia articles