Wikibooks
siwikibooks
https://si.wikibooks.org/wiki/%E0%B6%B8%E0%B7%94%E0%B6%BD%E0%B7%8A_%E0%B6%B4%E0%B7%92%E0%B6%A7%E0%B7%94%E0%B7%80
MediaWiki 1.48.0-wmf.1
first-letter
මාධ්යය
විශේෂ
සාකච්ඡාව
පරිශීලක
පරිශීලක සාකච්ඡාව
විකිපොත්
විකිපොත් සාකච්ඡාව
ගොනුව
ගොනුව සාකච්ඡාව
මාධ්යවිකි
මාධ්යවිකි සාකච්ඡාව
සැකිල්ල
සැකිලි සාකච්ඡාව
උදවු
උදවු සාකච්ඡාව
ප්රවර්ගය
ප්රවර්ග සාකච්ඡාව
විෂයය
විෂයය සාකච්ඡාව
කණිෂ්ඨ විකි
කණිෂ්ඨ විකි සාකච්ඡාව
TimedText
TimedText talk
Module
Module talk
Event
Event talk
ප්රවර්ගය:Edit user templates
14
6723
39447
14306
2026-10-29T10:14:07Z
Lee
15
39447
wikitext
text/x-wiki
{{ප්රවර්ගය සිංහලට ගෙනයන්න}}
[[ප්රවර්ගය:සැකිලි]]
7tjzu0j0wtpyj5qyutgeycvogydsoa6
ප්රවර්ගය:Empty tag templates
14
8033
39448
17590
2026-10-29T10:14:24Z
Lee
15
39448
wikitext
text/x-wiki
{{ප්රවර්ගය සිංහලට ගෙනයන්න}}
[[ප්රවර්ගය:සැකිලි]]
7tjzu0j0wtpyj5qyutgeycvogydsoa6
39449
39448
2026-10-29T10:54:13Z
Lee
15
39449
wikitext
text/x-wiki
{{ප්රවර්ගය සිංහලට ගෙනයන්න|හිස් ටැග සැකිලි}}
[[ප්රවර්ගය:සැකිලි]]
kcbijuoxfh3n9npbgss4d4ktlp50aas
Module:CategoryRename
828
19189
39441
2026-10-29T09:41:31Z
Lee
15
ජෙමිනි සහායෙන් නිර්මාණය
39441
Scribunto
text/plain
local p = {}
function p.renderNotice(frame)
-- සැකිල්ලෙන් ලබාගන්නා පරාමිති (Arguments)
local args = frame:getParent().args
local sinhalaName = args[1] or args.sinhala
-- වත්මන් පිටුවේ මාතෘකාව ලබා ගැනීම
local currentTitle = mw.title.getCurrentTitle()
local currentFullText = currentTitle.fullText
local currentPrefixedText = currentTitle.prefixedText
-- සිංහල නම ලබා දී නොමැති නම් අනතුරු ඇඟවීමක් පෙන්වීම
if not sinhalaName or sinhalaName == "" then
return '<div class="alert alert-danger" style="border: 2px solid #d9534f; padding: 15px; background-color: #f2dede; color: #a94442; border-radius: 5px;">'
.. '<strong>දෝෂයකි:</strong> කරුණාකර සිංහල නාමය ඇතුළත් කරන්න. උදා: <tb>{{ප්රවර්ගය සිංහලට ගෙනයන්න|සිංහල නම}}</tb>'
.. '</div>'
end
-- ප්රවර්ගය සඳහා සම්පූර්ණ සිංහල නම සකස් කිරීම
local targetTitle = "ප්රවර්ගය:" .. sinhalaName
-- ගෙනයාමේ පිටුවට (Move Page) අදාළ URL එක සකස් කිරීම
local moveUrl = mw.uri.fullUrl('Special:MovePage', {
target = currentPrefixedText,
wpNewTitle = targetTitle,
wpReason = "ඉංග්රීසි බසින් පවතින ප්රවර්ග නාමය සිංහල නාමයට ගෙනයාම."
})
-- නිවේදන කොටුව (Notice Box) HTML මඟින් නිර්මාණය කිරීම
local html = mw.html.create('div')
html:css({
['border'] = '1px solid #a2a9b1',
['background-color'] = '#f8f9fa',
['padding'] = '12px',
['margin'] = '10px 0',
['border-radius'] = '4px',
['box-shadow'] = '0 1px 4px rgba(0,0,0,0.05)',
['display'] = 'flex',
['justify-content'] = 'space-between',
['align-items'] = 'center',
['flex-wrap'] = 'wrap'
})
-- වම්පස ඇති පණිවිඩය
local messageDiv = mw.html.create('div')
messageDiv:css({ ['flex'] = '1', ['min-width'] = '250px', ['margin-right'] = '15px' })
messageDiv:wikitext('ℹ️ <strong>මෙම ප්රවර්ගයේ නාමය ඉංග්රීසි බසින් පවතී:</strong> මෙම ප්රවර්ගය වර්ථමානයේ පවතින්නේ <code>' .. currentTitle.text .. '</code> ලෙසය. මෙය <strong><span style="color: #0b2265;">' .. targetTitle .. '</span></strong> යන සිංහල නාමය වෙත ගෙනයාමට (Rename) යෝජනා කර ඇත.')
-- දකුණුපස ඇති ක්ලිකබල් බොත්තම (Button)
local buttonAnchor = mw.html.create('a')
buttonAnchor:attr('href', tostring(moveUrl))
buttonAnchor:css({
['display'] = 'inline-block',
['background-color'] = '#36c',
['color'] = '#fff',
['font-weight'] = 'bold',
['padding'] = '8px 16px',
['text-decoration'] = 'none',
['border-radius'] = '2px',
['box-shadow'] = '0 1px 1px rgba(0,0,0,0.1)',
['text-align'] = 'center',
['white-space'] = 'nowrap',
['margin'] = '5px 0'
})
buttonAnchor:wikitext('සිංහල නමට ගෙනයන්න')
-- කොටස් එකතු කිරීම
html:node(messageDiv)
html:node(buttonAnchor)
-- ප්රවර්ග පිටුවලට ස්වයංක්රීයව නඩත්තු ප්රවර්ගයක් එකතු කිරීම (විකල්ප)
local trackingCategory = ""
if currentTitle.namespace == 14 then -- 14 යනු Category Namespace එකයි
trackingCategory = "[[ප්රවර්ගය:සිංහල නාමයන්ට ගෙනයා යුතු ප්රවර්ග]]"
end
return tostring(html) .. trackingCategory
end
return p
l7mpit0uj7mpzadm7awoz7ccguu45yk
39444
39441
2026-10-29T09:49:33Z
Lee
15
ජෙමිනි සහායෙන් නිර්මාණය
39444
Scribunto
text/plain
local p = {}
-- ඉංග්රීසි වචන සිංහලට හැරවීමේ සහ Regex රටා ගැළපීමේ ශ්රිතය
local function matchRegexRules(currentText)
-- දත්ත පිටුව සම්බන්ධ කර ගැනීම (Protected call මඟින් දෝෂ මඟහරවයි)
local success, rules = pcall(require, "Module:CategoryRename/Data")
if not success or not rules then
return nil
end
for _, rule in ipairs(rules) do
-- ප්රවර්ග නාමය Regex රටාවට ගැළපේදැයි බැලීම
local match = mw.ustring.match(currentText, rule.pattern)
if match then
local finalMatch = match
-- උප-දත්ත කෝෂයක් (Dictionary) පවතී නම්, අදාළ ඉංග්රීසි වචනය සිංහල කරන්න
if rule.dictionary and rule.dictionary[match] then
finalMatch = rule.dictionary[match]
end
-- අවසාන සිංහල නාමය ගොඩනැඟීම
local sName = mw.ustring.gsub(currentText, rule.pattern, rule.replacement)
sName = mw.ustring.gsub(sName, match, finalMatch) -- සිංහල කළ වචනය ආදේශය
return sName
end
end
return nil -- කිසිදු රටාවකට නොගැළපේ නම්
end
function p.renderNotice(frame)
local args = frame:getParent().args
local currentTitle = mw.title.getCurrentTitle()
local currentText = currentTitle.text
local currentPrefixedText = currentTitle.prefixedText
-- 1. පරිශීලකයා අතින් නමක් දී ඇත්නම් එය මුලින්ම ගනී
-- 2. නැතහොත් Regex මඟින් ස්වයංක්රීයව සොයාගනී
local sinhalaName = args[1] or args.sinhala or matchRegexRules(currentText)
-- සිංහල නමක් සොයාගත නොහැකි වූයේ නම් සහ පරිශීලකයාද ලබාදී නැත්නම්
if not sinhalaName or sinhalaName == "" then
return '<div class="alert alert-warning" style="border: 2px solid #f0ad4e; padding: 15px; background-color: #fcf8e3; color: #8a6d3b; border-radius: 5px;">'
.. '⚠️ <strong>දැනුම්දීමයි:</strong> මෙම ප්රවර්ගය සඳහා සිංහල නාමයක් ස්වයංක්රීයව හඳුනාගත නොහැකි විය. කරුණාකර අතින් සිංහල නාමය ඇතුළත් කරන්න. <br>උදා: <code>{{ප්රවර්ගය සිංහලට ගෙනයන්න|සිංහල නම}}</code>'
.. '</div>'
end
local targetTitle = "ප්රවර්ගය:" .. sinhalaName
-- URL එක සකස් කිරීම
local moveUrl = mw.uri.fullUrl('Special:MovePage', {
target = currentPrefixedText,
wpNewTitle = targetTitle,
wpReason = "Regex රටා ඇසුරින් ඉංග්රීසි ප්රවර්ග නාමය සිංහල නාමයට ගෙනයාම."
})
-- HTML නිවේදන කොටුව නිර්මාණය
local html = mw.html.create('div')
html:css({
['border'] = '1px solid #a2a9b1',
['background-color'] = '#f8f9fa',
['padding'] = '12px',
['margin'] = '10px 0',
['border-radius'] = '4px',
['box-shadow'] = '0 1px 4px rgba(0,0,0,0.05)',
['display'] = 'flex',
['justify-content'] = 'space-between',
['align-items'] = 'center',
['flex-wrap'] = 'wrap'
})
local messageDiv = mw.html.create('div')
messageDiv:css({ ['flex'] = '1', ['min-width'] = '250px', ['margin-right'] = '15px' })
messageDiv:wikitext('ℹ️ <strong>ප්රවර්ග නාමය සිංහලට හැරවීම:</strong> මෙම ප්රවර්ගය <strong><span style="color: #0b2265;">' .. targetTitle .. '</span></strong> යන සිංහල නාමය වෙත ගෙනයාමට (Rename) යෝජනා කර ඇත.')
local buttonAnchor = mw.html.create('a')
buttonAnchor:attr('href', tostring(moveUrl))
buttonAnchor:css({
['display'] = 'inline-block',
['background-color'] = '#36c',
['color'] = '#fff',
['font-weight'] = 'bold',
['padding'] = '8px 16px',
['text-decoration'] = 'none',
['border-radius'] = '2px',
['text-align'] = 'center',
['white-space'] = 'nowrap'
})
buttonAnchor:wikitext('සිංහල නමට ගෙනයන්න')
html:node(messageDiv)
html:node(buttonAnchor)
local trackingCategory = ""
if currentTitle.namespace == 14 then
trackingCategory = "[[ප්රවර්ගය:සිංහල නාමයන්ට ගෙනයා යුතු ප්රවර්ග]]"
end
return tostring(html) .. trackingCategory
end
return p
a1ej7982raiwd58xleqewd0z865nuuz
සැකිල්ල:ප්රවර්ගය සිංහලට ගෙනයන්න
10
19190
39442
2026-10-29T09:42:15Z
Lee
15
ජෙමිනි සහායෙන් නිර්මාණය
39442
wikitext
text/x-wiki
{{ප්රවර්ගය සිංහලට ගෙනයන්න|ශ්රී ලංකාවේ ඉතිහාසය}}
fqetbyi3skawx96ux8qzjxnxtvkny61
39445
39442
2026-10-29T10:11:04Z
Lee
15
ජෙමිනි සහායෙන් නිර්මාණය
39445
wikitext
text/x-wiki
{{#invoke:CategoryRename|renderNotice}}
5p1l6emib3icxw6cyl8jeglxuip6iiv
39446
39445
2026-10-29T10:12:58Z
Lee
15
39446
wikitext
text/x-wiki
<includeonly>{{#invoke:CategoryRename|renderNotice}}
</includeonly><noinclude>
{{උපදෙස්}}
</noinclude>
0cs02um7smewr06c0qx1obhb54nj4v7
Module:CategoryRename/Data
828
19191
39443
2026-10-29T09:47:13Z
Lee
15
ජෙමිනි සහායෙන් නිර්මාණය
39443
Scribunto
text/plain
local rules = {
-- 1. "History of [Country]" -> "[Country] හි ඉතිහාසය" රටාව
{
pattern = "^History of (.+)$",
replacement = "%1 හි ඉතිහාසය",
-- රටා පරිවර්තන (උදා: Country names සිතියම් කරණය)
dictionary = {
["Sri Lanka"] = "ශ්රී ලංකාව",
["India"] = "ඉන්දියාව",
["England"] = "එංගලන්තය"
}
},
-- 2. "Districts of [Country]" -> "[Country] හි දිස්ත්රික්ක" රටාව
{
pattern = "^Districts of (.+)$",
replacement = "%1 හි දිස්ත්රික්ක",
dictionary = {
["Sri Lanka"] = "ශ්රී ලංකාව"
}
},
-- 3. "[Year] births" -> "[Year] උපත්" රටාව (Numbers සඳහා)
{
pattern = "^(%d+) births$",
replacement = "%1 උපත්"
},
-- 4. "[Year] deaths" -> "[Year] මරණ" රටාව
{
pattern = "^(%d+) deaths$",
replacement = "%1 මරණ"
}
}
return rules
torvz19ptf024sfc0xcls064xfiqp91