Module talk:Lang-zh
Module:Lang-zh is permanently protected from editing because it is a heavily used or highly visible module. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit.
|
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. |
Template-protected edit request on 5 April 2024
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I would like to enable the option "first=poj" analogously to "first=j". The "first=j" option allows Cantonese romanisations to be given before Mandarin romanisations, in articles where Cantonese is more relevant. The proposed "first=poj" option would allow Hokkien romanisation (POJ) to be given first, in articles where Hokkien more relevant, e.g. for Bukit Ho Swee, Hong-Gah Museum, Tamsui District.
I believe this could be achieved by adding the following:
From line 114, after:
local j1 = false -- whether Cantonese Romanisations go first
insert:
local poj1 = false -- whether Hokkien Romanisations go first
From line 121, after:
if (testChar == "j") then j1 = true end
insert:
if (testChar == "poj") then poj1 = true end
(The variable is named "testChar" but it is defined by the regular expression "%a+", which will match not only a single character but also longer strings.)
(On a separate note, there seems to be a superfluous space before "end" on lines 120 and 123.)
From line 137, after:
if (j1) then orderlist[4] = "j" orderlist[5] = "cy" orderlist[6] = "sl" orderlist[7] = "p" orderlist[8] = "tp" orderlist[9] = "w" end
insert:
if (poj1) then orderlist[4] = "poj" orderlist[5] = "p" orderlist[6] = "tp" orderlist[7] = "w" orderlist[8] = "j" orderlist[9] = "cy" orderlist[10] = "sl" end
This puts POJ before the Mandarin and Cantonese romanisations. Freelance Intellectual (talk) 08:49, 5 April 2024 (UTC)
Double-quotes around glosses
Is there a reason we use double-quotes rather than single-quotes to show the output of |tr=
? MOS:SIMPLEGLOSS suggests we should prefer singles. — OwenBlacker (he/him; Talk) 17:37, 18 June 2024 (UTC)
- Because
|l=
is used for literal translations & glosses, and|tr=
is (much more rarely) used for non-literal translations. Remsense诉 17:39, 18 June 2024 (UTC)- Aha, that makes sense. So I have probably been misusing
|tr=
when I should have been using|l=
. Thank you! — OwenBlacker (he/him; Talk) 18:03, 18 June 2024 (UTC)
- Aha, that makes sense. So I have probably been misusing
Commas within literal glosses
What should we do if there needs to be a comma within a literal translation? I noticed this on Yi Jian Mei (song), where the quotes should be placed around the whole comma-separated phrase, not individually around each side of the comma. pacificboy (talk) 03:56, 11 July 2024 (UTC)
- My assumption when adding this feature was that if one needed to add a comma, it should probably be treated as a proper translation, not a gloss. It turns out I never use this formatting, so I could very plausibly disable it. Remsense诉 05:49, 11 July 2024 (UTC)
- Ah, that makes sense! I’ll convert it to a translation. Thanks. pacificboy (talk) 02:45, 12 July 2024 (UTC)
Template-protected edit request on 17 August 2024
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
I propose the following changes to add Tâi-lô romanization support. Of course, POJ covers 95% of Hokkien/Minnan use cases (hence why I have added the "tailo" IANA subtag) but it could still be useful for Taiwanese-specific pages. Additions and modifications below:
--- Module:Lang-zh
+++ Module:Lang-zh
@@ after line 29 @@ local labels = {
["sl"] = "Sidney Lau",
["poj"] = "Pe̍h-ōe-jī",
+ ["tl"] = "Tâi-lô",
["zhu"] = "Zhuyin Fuhao",
["l"] = "lit.",
@@ after line 46 @@ local wlinks = {
["poj"] = "Pe̍h-ōe-jī",
+ ["tl"] = "Tâi-uân Lô-má-jī Phing-im Hong-àn",
@@ after line 63 @@ local ISOlang = {
["poj"] = "nan-Latn",
+ ["tl"] = "nan-Latn-tailo",
@@ after line 74 @@ local italic = {
["poj"] = true,
+ ["tl"] = true,
@@ at line 136 @@
- local orderlist = {"c", "s", "t", "p", "tp", "w", "j", "cy", "sl", "poj", "zhu", "l", "tr"}
+ local orderlist = {"c", "s", "t", "p", "tp", "w", "j", "cy", "sl", "poj", "tl", "zhu", "l", "tr"}
@@ after line 150 @@ if (poj1) then
orderlist[4] = "poj"
- orderlist[5] = "p"
- orderlist[6] = "tp"
- orderlist[7] = "w"
- orderlist[8] = "j"
- orderlist[9] = "cy"
- orderlist[10] = "sl"
+ orderlist[5] = "tl"
+ orderlist[6] = "p"
+ orderlist[7] = "tp"
+ orderlist[8] = "w"
+ orderlist[9] = "j"
+ orderlist[10] = "cy"
+ orderlist[11] = "sl"
end
MSG17 (talk) 15:53, 17 August 2024 (UTC)
- @MSG17: This sounds reasonable, and would be helpful on pages such as Penang Hokkien where both POJ and TL are used in the article text. @Pppery or @Jonesey95, would you be able to help here? Freelance Intellectual (talk) 13:03, 19 September 2024 (UTC)
- I'll take a look at this ASAP, thank you for your improvements! Remsense ‥ 论 13:06, 19 September 2024 (UTC)
- Done Remsense ‥ 论 13:48, 19 September 2024 (UTC)
Further romanization discussion
Coming off of my request to add Tâi-lô, what other romanization systems should be added to the template? I feel like Pha̍k-fa-sṳ annd Wugniu could be helpful. I don't see any IANA latn subtages for other Sinitic languages however. MSG17 (talk) 15:53, 17 August 2024 (UTC)
Trailing bold in l= not being removed
In
{{zh|t=竹子林站|j=Zuk1 Zi2 Lam4 Zaam6|l = '''Bamboo Forest station'''}}
, the opening bold markup is properly removed, but the trailing bold markup is not removed. It looks like the regular expression at
term = string.gsub(term, "^([ \"']*)(.*)([ \"']*)$", "%2")
needs some adjustment to the middle wildcard search. – Jonesey95 (talk) 13:23, 16 September 2024 (UTC)
- @Jonesey95: This is because the * operator is greedy, so .* matches everything else in the string. Changing .* to .*? would make it lazy, so that the final term catches all trailing characters. In other words, change the line of code to: Freelance Intellectual (talk) 13:51, 16 September 2024 (UTC)
term = string.gsub(term, "^([ \"']*)(.*?)([ \"']*)$", "%2")
- Thanks! That fixed the problem at Zhuzilin station and probably other pages. – Jonesey95 (talk) 17:26, 16 September 2024 (UTC)
- Thank you for fixing my shoddy regex, by the way. Remsense ‥ 论 13:05, 19 September 2024 (UTC)
- 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