模組討論:CGroupViewer
外观
編輯請求 2020-01-06
[编辑] 请求已拒绝
把函數main改成這樣:
function z.main( frame )
local name = frame.args[1]
if not name or name == '' then
return ''
end
local data = require( 'Module:CGroup/' .. name )
if type( data ) ~= 'table' or not data.name or data.name == '' then
return error.error{ '指定-{zh-hans:模块;zh-hant:模組}-“' .. name .. '”不是有效的转换组' }
end
if data.name ~= name then
return frame:expandTemplate{ title = 'Template:CGroup redirect', args = { 'Module:CGroup/' .. data.name } }
end
local text = '<strong>-{H|zh-hans:模块;zh-hant:模組}-以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。</strong>\n\n'
for i, v in ipairs( data.content ) do
if v.type == 'text' then
text = text .. makeText( frame, v )
elseif v.type == 'item' then
text = text .. makeItem( frame, v )
end
end
text = text .. '[[Category:公共轉換組模板|' .. name .. ']][[Category:公共转换组模块|' .. name .. ']]'
return text
end
-- Sunny00217 2020年1月6日 (一) 15:21 (UTC)
未完成,嘗試修改後部分頁面出現以下錯誤:「Lua錯誤:not enough memory。」。--Xiplus#Talk 2020年1月6日 (一) 23:01 (UTC)
那如果改成這樣呢:
function z.main( frame )
local name = frame.args[1]
if not name or name == '' then
return ''
end
local data = require( 'Module:CGroup/' .. name )
if type( data ) ~= 'table' or not data.name or data.name == '' then
return error.error{ '指定-{zh-hans:模块;zh-hant:模組}-“' .. name .. '”不是有效的转换组' }
end
if data.name ~= name then
return frame:expandTemplate{ title = 'Template:CGroup redirect', args = { 'Module:CGroup/' .. data.name } }
end
local pieces = { '-{H|zh-hans:模块;zh-hant:模組}-<strong>以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。</strong>\n\n' }
for i, v in ipairs( data.content ) do
if v.type == 'text' then
table.insert( pieces, makeText( frame, v ) )
elseif v.type == 'item' then
table.insert( pieces, makeItem( frame, v ) )
end
end
table.insert( pieces, '[[Category:公共轉換組模板|' .. name .. ']][[Category:公共转换组模块|' .. name .. ']]' )
return table.concat( pieces )
end
-- Sunny00217 2020年1月7日 (二) 13:42 (UTC)
- 為什麼要這樣修改?這樣做有什麼好處?有什麼壞處?--Temp3600(留言) 2020年2月12日 (三) 17:51 (UTC)
- 兩個
- 加入-{H|zh-hans:模块;zh-hant:模組}-強制轉換
- 強制插入分類Category:公共转换组模块
- -- Sunny00217 2020年2月24日 (一) 14:07 (UTC)
- 這樣做有什麼好處?有什麼壞處?有那些人和事會受到影響?--Temp3600(留言) 2020年4月21日 (二) 17:14 (UTC)
- 兩個
未完成,過久未回覆。—— Eric Liu(留言.留名.學生會) 2020年5月24日 (日) 07:02 (UTC)
編輯請求 2021-03-13
[编辑] 请求已处理--Xiplus#Talk 2021年3月23日 (二) 02:18 (UTC)
加入Bot use warning。--Xiplus#Talk 2021年3月13日 (六) 02:24 (UTC)
可否不對Item('與', '之間的內容轉換繁簡?
[编辑]目前仍對公共轉換組Item('
與', '
、{ type = 'item', original = '
與', rule = '
等之間的內容在預覽/顯示效果轉換繁簡,日韓等漢字文化圈事物原名亦被轉換,以致部分人士在其中插入-{
與}-
阻止繁簡轉換。隔斷字符既阻礙搜查原名進而引致編修費時甚或不慎重複設置轉換規則,又導致去除重複轉換規則的機械人無法解析而妨礙去重作業。由於以上種種弊端,加之此部分轉換繁簡毫無價值,提議此部分不再轉換繁簡。--— Gohan 2025年1月25日 (六) 03:29 (UTC)
NoteTA解析時根本沒有把原文插入轉換規則裡-- 我無法理解你在講什麼,SunAfterRain 2025年1月27日 (一) 15:41 (UTC)- 喔,看懂了,改過來了--SunAfterRain 2025年1月27日 (一) 15:48 (UTC)
- 極好!謝謝!但上述未提及的CItem、CItemLan語句在預覽處似乎依然轉換。--— Gohan 2025年1月28日 (二) 07:08 (UTC)