模组讨论:CGroupViewer
添加话题外观
Jimmy-bot在话题“可否不对Item('与', '之间的内容转换繁简?”中的最新留言:2个月前
编辑请求 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)