Wikisumber
mswikisource
https://ms.wikisource.org/wiki/Laman_Utama
MediaWiki 1.46.0-wmf.24
first-letter
Media
Khas
Perbincangan
Pengguna
Perbincangan pengguna
Wikisumber
Perbincangan Wikisumber
Fail
Perbincangan fail
MediaWiki
Perbincangan MediaWiki
Templat
Perbincangan templat
Bantuan
Perbincangan bantuan
Kategori
Perbincangan kategori
Gerbang
Perbincangan gerbang
Pengarang
Perbincangan pengarang
Karya
Perbincangan karya
Terjemahan
Perbincangan terjemahan
Laman
Perbincangan laman
Indeks
Perbincangan indeks
TimedText
TimedText talk
Modul
Perbincangan modul
Acara
Perbincangan acara
Laman:Hikayat pelanduk jenaka.pdf/74
250
4158
22839
22838
2026-04-17T02:46:41Z
Hadithfajri
36
22839
proofread-page
text/x-wiki
<noinclude><pagequality level="1" user="ErniFarzana" /></noinclude>ايتفون ترلالوله ايلقڽ ستله سمفي مك دليهت اوله
راج كرا اكن سارڠ تبوھن ايت مك ايفون ترلالو
ساڠت حيرانڽ مک برفيكرلە اي دالم هاتيڽ سڠݢهله
سفرتي كات فلندق هيتم اين كارن زمان برزمان درڧد
داتق نينق فون تياد فرنه اک مليهت فتي سروف
اين ساڠتله انده فربواتنڽ فتي اين فاتتله تمفت
اي راره ڽاوان حرام زاده ايت مک ايتله حكمتڽ فون
كفداڽ سده برفيكر دمكين ايت مک لالو اي فرݢيله
همفر سارڠ تبوهن ايت سرت دغن سكل منتري
هلبالغ رعيتن سكلين فركيله برسام؟ دغن راج كرا
ايت سرت سيفى مك دليهت اوله فلندق جناك ايت
كلكون راج كرا ايت مى شاه عالم درمبفون اندر
فرلاعن” اي فركي برسيبوني دودق مليهت فرنتة راج
كرا حرام زادة ايت سرت دغنى سكل منتري هلبالفن
سرت سمفي مك اولة راج كرا دعن سكل منترين فون
دتمفغرن سرت دتنلغن دغنى تراجغ كوجة فول سورع
سديكت م سارغ تبرعن ايتفرن فجهله ستله
فجه مک تبوهن ايتفون سرت مرساࢨ كنا تمفر دان
تراجڠ ساريڠن مک ايفون ترهمبورن کلور دردالم سارڠڽ
تربڠ مڽڠت راج كرا سرت دڠن سݢل منتريڽ مک
راج كرا دڠن سݢل منتري هلبالڠ رعيتڽ ايتفون لاريله<noinclude></noinclude>
3t04vm9nupxks4xvsqq6bzd3ahwjra9
Modul:Index template
828
5998
22840
22828
2026-04-17T06:30:28Z
Hakimi97
9
Make indicator logo dark mode compatible
22840
Scribunto
text/plain
--[=[
Latest update: 15th April 2026
This is a module to implement logic for [[MediaWiki:Proofreadpage index template]],
to render the book/index metadata panel for Malay Wikisource index pages.
]=]
local ISO_639 = require('Modul:ISO 639')
local messageBox = require('Module:Message box')
local category_handler = require('Module:Category handler')._main
local cfg = require('Modul:Index template/config')
-- Low-level markup helpers
local function construct_cat(cat)
return '[[Kategori:' .. cat .. ']]'
end
local function construct_cat_link(cat, text)
return '[[:Kategori:' .. cat .. '|' .. (text or cat) .. ']]'
end
-- Builds a single labelled metadata row.
local function construct_field(id, content)
if id == nil or content == nil then return nil end
if not cfg.headings[id] then error(cfg.missing_heading_id(id)) end
return mw.html.create('tr')
:attr('id', 'ws-index-' .. id .. '-row')
:addClass('ws-index-row')
:tag('th')
:attr('scope', 'row')
:attr('id', 'ws-index-' .. id .. '-label')
:addClass('ws-index-label')
:wikitext(cfg.headings[id].txt)
:done()
:tag('td')
:attr('id', 'ws-index-' .. id .. '-value')
:addClass('ws-index-value')
:wikitext(content)
:allDone()
end
-- Conditionally adds a metadata row and the appropriate tracking category.
-- If `content` is truthy the row is added plus `with_cat` (if given).
-- Otherwise only `without_cat` is emitted (if given).
local function add_field(tbl, html, id, content, with_cat, without_cat)
if content then
tbl:node(construct_field(id, content))
if with_cat then html:wikitext(construct_cat(with_cat)) end
elseif without_cat then
html:wikitext(construct_cat(without_cat))
end
end
-- Wikidata link helpers
local function addWikidataToLink(page, label, category)
local title = mw.title.new(page)
if title == nil then
return '[[' .. page .. '|' .. label .. ']]'
end
if title.isRedirect then title = title.redirectTarget end
local tag = mw.html.create('span')
local itemId = mw.wikibase.getEntityIdForTitle(title.fullText)
tag:wikitext('[[' .. page .. '|' .. label .. ']]')
if itemId then
tag:wikitext(
' [[Image:Wikidata.svg|10px|link=d:' .. itemId .. '|Lihat maklumat di Wikidata]]'
)
if category then tag:wikitext('[[Kategori:' .. category .. ']]') end
end
return tostring(tag)
end
-- Walks wikilinks inside `wikitext` and augments each with a Wikidata icon
-- when the linked page has a Wikidata entity.
local function withWikidataLink(wikitext, category)
if wikitext == nil then return nil end
-- Try bare [[Page]] links first …
local result = mw.ustring.gsub(wikitext, '%[%[([^|%]]*)%]%]', function(page)
return addWikidataToLink(page, mw.ustring.gsub(page, '%.*/', ''), category)
end)
if result ~= wikitext then return result end
-- … then [[Page|Label]] links.
return mw.ustring.gsub(wikitext, '%[%[([^|]*)|([^|%]]*)%]%]', function(page, link)
return addWikidataToLink(page, link, category)
end)
end
-- Formats a contributor field (author / translator / editor).
-- With a Wikidata item: augments links with Wikidata icons.
-- Without: wraps bare (non-wikilinked) names in {{Al|}}.
local function format_person(value, item)
if item then return withWikidataLink(value) end
if value:find('%[%[') then return value end
return '{{Al|' .. value .. '}}'
end
-- Progress / transclusion status rows
local function construct_status_field(args, statusArgs)
local key = statusArgs.key
local config_key = statusArgs.config_key or key
local index_status = args[key] or '_missing'
local sd = cfg[config_key][index_status] or cfg[config_key]['_default']
local txt = sd.txt
if type(txt) == 'function' then txt = txt(index_status) end
local display = sd.error
and ('<span class="error">' .. txt .. '</span>')
or construct_cat_link(sd.cat, txt)
return {
row = construct_field(key, display),
cat = construct_cat(sd.cat),
}
end
-- Indicator builder
-- Builds one <indicator> tag from an indicator config entry.
-- `link` and `caption` may be plain strings or functions called with `args`.
-- An optional `include` predicate (also called with `args`) gates rendering;
-- defaults to always-show when absent.
local function construct_indicator(args, iData)
local include = iData.include or cfg.indicator_defaults.include
if not include(args) then return '' end
local parts = { iData.image, iData.width or cfg.indicator_defaults.width }
if iData.alt then table.insert(parts, 'alt=' .. iData.alt) end
if iData.class then table.insert(parts, 'class=' .. iData.class) end
local link = iData.link
if type(link) == 'function' then link = link(args) end
if link then table.insert(parts, 'link=' .. link) end
local caption = iData.caption
if type(caption) == 'function' then caption = caption(args) end
if caption then table.insert(parts, caption) end
return mw.getCurrentFrame():extensionTag{
name = 'indicator',
content = '[[' .. table.concat(parts, '|') .. ']]',
args = { name = iData.name },
}
end
-- Talk-page remarks
local p = {}
function p._index_talk_remarks(args)
if not args.talkPageTitle then
args.talkPageTitle = mw.title.getCurrentTitle().talkPageTitle
end
local text = cfg.talkremarks.text(args)
local cat = category_handler({ construct_cat(cfg.talkremarks.cat) }) or ''
local notes = ''
if args.notes then
notes = mw.html.create('div')
:addClass('ombox-content')
:css({
['text-align'] = 'left',
['max-height'] = '5.5em',
['overflow'] = 'scroll',
['padding'] = '0.25em',
['margin'] = '0.25em',
['border-style'] = 'dashed',
})
:newline()
:wikitext(args.notes .. cat)
:newline()
:allDone()
end
return messageBox.main('ombox', {
type = 'content',
image = '[[File:Ambox important.svg|24px]]',
style = 'box-sizing:border-box;margin:-0.93em auto 0.0em;text-align:center;width:100%;',
textstyle = 'font-size:93%;text-decoration:none;',
text = text .. tostring(notes),
})
end
function p.index_talk_remarks(frame)
local args = {}
for k, v in pairs(frame.args) do args[k] = v end
args.talkPageTitle = mw.title.getCurrentTitle().talkPageTitle
return p._index_talk_remarks(args)
end
-- Language resolution
-- Resolves the display language string and emits language-related tracking
-- categories onto `html`. Returns the display string, or nil if unavailable.
local function resolve_language(args, item, html)
local displayLang = nil
local languageCount = 0
if item then
local languages = item:formatPropertyValues(
'P407', { mw.wikibase.entity.claimRanks.RANK_NORMAL }
).value
if languages and mw.text.trim(languages) ~= '' then
displayLang = languages
for language in languages:gmatch('([^,]+)') do
language = mw.text.trim(language)
if language ~= '' then
languageCount = languageCount + 1
html:wikitext(construct_cat(
'Laman indeks karya yang asal dalam ' .. language
))
end
end
end
end
if not displayLang and args.language then
local displayLangs = {}
for _, l in ipairs(mw.text.split(args.language, ',%s*', false)) do
local lang = mw.text.trim(l)
if lang ~= '' then
local langName = ISO_639.language_name(lang, lang)
table.insert(displayLangs, langName)
languageCount = languageCount + 1
html:wikitext(construct_cat(
'Laman indeks karya yang asal dalam bahasa ' .. langName
))
end
end
if #displayLangs > 0 then
displayLang = table.concat(displayLangs, ', ')
end
end
if displayLang then
html:wikitext(construct_cat('Karya dengan maklumat bahasa'))
if languageCount > 1 then
html:wikitext(construct_cat('Laman indeks karya yang asal dalam pelbagai bahasa'))
end
else
html:wikitext(construct_cat('Laman indeks karya tanpa maklumat bahasa'))
end
return displayLang
end
-- Metadata table
local function build_metadata(args, item, html)
local t = mw.html.create('table'):attr('id', 'ws-index-metadata')
-- Title
if args.title then
local titleContent
if item then
titleContent = withWikidataLink(args.title)
elseif args.title:find('%[%[') then
titleContent = args.title
else
titleContent = '[[' .. args.title .. ']]'
end
t:node(construct_field('title', titleContent))
else
mw.addWarning('Anda perlu isi medan tajuk borang.')
end
-- Subtitle
add_field(t, html, 'subtitle', withWikidataLink(args.subtitle))
-- Language (complex; categories emitted inside resolve_language)
add_field(t, html, 'language', resolve_language(args, item, html))
-- Simple bibliographic fields
add_field(t, html, 'volume',
args.volume,
'Karya dengan maklumat nombor jilid',
'Karya tanpa maklumat nombor jilid')
add_field(t, html, 'edition',
args.edition,
'Karya dengan maklumat edisi',
'Karya tanpa maklumat edisi')
-- Author (also emits per-author categories from Wikidata)
if args.author then
t:node(construct_field('author', format_person(args.author, item)))
html:wikitext(construct_cat('Karya dengan maklumat pengarang'))
if item then
local authors = item:formatPropertyValues(
'P50', { mw.wikibase.entity.claimRanks.RANK_NORMAL }
).value or ''
for author in authors:gmatch('([^,]+)') do
html:wikitext(construct_cat('Karya ' .. mw.text.trim(author)))
end
end
else
html:wikitext(construct_cat('Karya tanpa maklumat pengarang'))
end
-- Contributor fields
add_field(t, html, 'translator',
args.translator and format_person(args.translator, item),
'Karya dengan maklumat penterjemah',
'Karya tanpa maklumat penterjemah')
add_field(t, html, 'editor',
args.editor and format_person(args.editor, item),
'Karya dengan maklumat penyunting',
'Karya tanpa maklumat penyunting')
add_field(t, html, 'illustrator',
args.illustrator and withWikidataLink(args.illustrator),
'Karya dengan maklumat pengilustrasi',
'Karya tanpa maklumat pengilustrasi')
add_field(t, html, 'publisher',
args.publisher and withWikidataLink(args.publisher),
'Karya dengan maklumat penerbit',
'Karya tanpa maklumat penerbit')
-- Address / Published-in (mutually exclusive)
if args.address then
t:node(construct_field('address', withWikidataLink(args.address)))
html:wikitext(construct_cat('Karya dengan maklumat alamat'))
elseif args.publishedin then
t:node(construct_field('publishedin', withWikidataLink(args.publishedin)))
html:wikitext(construct_cat('Karya dengan maklumat alamat penerbitan'))
else
html:wikitext(construct_cat('Karya tanpa maklumat alamat penerbitan'))
end
-- Year / Inception (mutually exclusive)
if args.year then
t:node(construct_field('year', withWikidataLink(args.year)))
html:wikitext(construct_cat('Karya dengan maklumat tarikh'))
html:wikitext(construct_cat('Karya tahun ' .. args.year))
elseif args.inception then
t:node(construct_field('inception', withWikidataLink(args.inception)))
html:wikitext(construct_cat('Karya dengan maklumat tarikh terawal'))
else
html:wikitext(construct_cat('Karya tanpa maklumat tarikh'))
end
add_field(t, html, 'printer',
args.printer and withWikidataLink(args.printer),
'Karya dengan maklumat pencetak',
'Karya tanpa maklumat pencetak')
-- Source (linkable formats get a file-page link)
local src = args.source
t:node(construct_field('source',
src and cfg.linkable_sources[src]
and '[[:Fail:' .. mw.title.getCurrentTitle().text .. '|' .. src .. ']]'
or src
))
-- Progress & transclusion status
local progress_data = construct_status_field(args, { key = 'progress', config_key = 'status' })
local transclusion_data = construct_status_field(args, { key = 'transclusion' })
t:node(progress_data.row); html:wikitext(progress_data.cat)
t:node(transclusion_data.row); html:wikitext(transclusion_data.cat)
-- Validation date
local vdate = args.validation_date
if vdate then
local vcat = cfg.validation_cats.dated(vdate)
t:node(construct_field('validation_date', construct_cat_link(vcat, vdate)))
html:wikitext(construct_cat(vcat))
elseif args.progress == 'T' then
html:wikitext(construct_cat(cfg.validation_cats.undated))
end
-- Standard identifiers
for _, id in ipairs({ 'isbn', 'oclc', 'lccn', 'ark', 'doi' }) do
local val = args[id]
if val then
local link_fn = cfg.url_gens[id]
t:node(construct_field(id, link_fn and link_fn(val, val) or val))
end
end
add_field(t, html, 'volumes', args.volumes)
return t
end
-- Cover image
--[=[
Decision tree (evaluated in order):
1. Full [[...]] wikilink spec supplied → use as-is
2. Bare filename (has extension) → strip namespace prefix, rewrap
3. Audiovisual timestamp string → treat as thumbtime= value (→ case 5)
4. Multipage (DjVu/PDF) + file exists → page= thumbnail
5. Audiovisual + file exists → thumbtime= thumbnail
6. Any other type + file exists → plain file link
7. File does not exist → placeholder + missing category
--]=]
local function build_cover(args)
local image_number = tonumber(args.image)
-- Treat a bare timestamp string (e.g. "83" or "1:23") as a thumbtime value.
if args.image and not image_number
and args.source_type == 'audiovisual'
and mw.ustring.match(args.image, '^%d+[%d:]*$') then
image_number = args.image
end
local image_spec
local cats = {}
if not image_number and args.image and mw.ustring.find(args.image, '^%[%[') then
-- Case 1: full wikilink spec
image_spec = args.image
if args.source_type ~= 'image' then
table.insert(cats, construct_cat(cfg.cover_cats.fullspec))
end
elseif not image_number and args.image and mw.ustring.find(args.image, '%.%w+$') then
-- Case 2: bare filename — strip any recognised File namespace prefix
local image_name = args.image
local file_ns = mw.site.namespaces[6]
local prefixes = { file_ns.name, file_ns.canonicalName }
for _, alias in ipairs(file_ns.aliases) do
table.insert(prefixes, alias)
end
for _, prefix in ipairs(prefixes) do
image_name = mw.ustring.gsub(image_name, '^' .. prefix .. ':', '')
image_name = mw.ustring.gsub(image_name, '^' .. prefix:lower() .. ':', '')
end
image_spec = '[[' .. mw.title.makeTitle('Fail', image_name).prefixedText
.. '|' .. cfg.cover.width .. '|class=ws-cover]]'
if args.source_type ~= 'image' then
table.insert(cats, construct_cat(cfg.cover_cats.fullspec))
end
elseif args.source_type == 'multipage' and args.file_exists then
-- Case 4: DjVu / PDF page thumbnail
image_spec = '[[' .. args.fileTitle.prefixedText
.. '|' .. cfg.cover.width
.. '|page=' .. (image_number or 1)
.. '|class=ws-cover]]'
elseif args.source_type == 'audiovisual' and args.file_exists then
-- Case 5: audio / video timestamp thumbnail
image_spec = '[[' .. args.fileTitle.prefixedText
.. '|' .. cfg.cover.width
.. '|thumbtime=' .. (image_number or 0)
.. '|class=ws-cover]]'
elseif args.file_exists then
-- Case 6: image or unknown type
image_spec = '[[' .. args.fileTitle.prefixedText
.. '|' .. cfg.cover.width .. '|class=ws-cover]]'
else
-- Case 7: file missing — fall back to placeholder
local image_link = args.fileTitle.prefixedText
if not mw.ustring.find(args.fileTitle.rootText, '^.*%.%w+') then
image_link = 'Special:Upload'
end
image_spec = '[[' .. cfg.cover.image
.. '|' .. cfg.cover.width
.. '|link=' .. image_link
.. '|class=ws-cover]]'
table.insert(cats, construct_cat(cfg.cover_cats.missing))
end
return image_spec .. table.concat(cats)
end
-- Argument setup
-- Resolves all derived values and performs every expensive DB lookup exactly
-- once. Anything that touches the DB (file.exists, title.exists) lives here
-- and nowhere else, making the cost immediately visible to maintainers.
local function process_args(args)
-- Apply config defaults for any args not supplied by the template.
for k, v in pairs(cfg.defaults or {}) do
if args[k] == nil then args[k] = v end
end
-- Allow pageTitle to be pre-set (e.g. from a sandbox or test harness).
-- In normal template rendering it is always nil, so getCurrentTitle() is used.
args.pageTitle = (args.pageTitle and mw.title.new(args.pageTitle))
or mw.title.getCurrentTitle()
args.talkPageTitle = args.pageTitle.talkPageTitle
args.fileTitle = mw.title.makeTitle('Fail', args.pageTitle.rootText)
args.source_type = cfg.cover_cats.file_types[args.source]
args.file_exists = args.fileTitle.file.exists -- expensive: DB lookup
args.talk_exists = args.talkPageTitle.exists -- expensive: DB lookup
return args
end
-- Main entry point
local function indexTemplate(frame)
local styles = frame:extensionTag{
name = 'templatestyles',
args = { src = 'Modul:Index template/styles.css' },
}
local data = (require 'Modul:Index_template/data').indexDataWithWikidata(frame)
local args, item = data.args, data.item
args = process_args(args)
-- Sort index pages correctly in categories (falls back to page title).
local sortkey = mw.getCurrentFrame():callParserFunction(
'DEFAULTSORT', { args.pageTitle.text }
)
-- Scan the talk page for formatting notes unless notes were supplied directly.
local talkremarks = ''
local talk_page_exists = args.talk_exists
if talk_page_exists and not args.notes then
local content = args.talkPageTitle.content
for _, keyword in ipairs(cfg.talkremarks.keywords) do
local pattern = keyword.alone
and '==( *' .. keyword.pattern .. ' *)=='
or '==([^=%n]*' .. keyword.pattern .. '[^=%n]*)=='
local section = mw.ustring.match(content, pattern)
if section then
args.notes = mw.getCurrentFrame():callParserFunction(
'#lsth',
args.talkPageTitle.prefixedText,
mw.text.trim(section)
)
break
end
end
end
if talk_page_exists then
talkremarks = p._index_talk_remarks(args)
end
local html = mw.html.create()
-- Wikidata indicator
if item then
html:wikitext('[[Kategori:Karya dengan ID Wikidata]]')
html:wikitext(
'<indicator name="wikidata">[[File:Wikidata.svg|20px|ID Wikidata|link=d:'
.. item.id .. ']]</indicator>'
)
else
html:wikitext('[[Kategori:Karya tanpa ID Wikidata]]')
end
-- Tool indicators
for _, v in ipairs(cfg.indicators) do
html:wikitext(construct_indicator(args, v))
end
local metadataTable = build_metadata(args, item, html)
local coverImage = build_cover(args)
-- Outer layout: [cover + metadata + pagelist] | [remarks]
local outerRow = html:tag('table')
:attr('id', 'ws-index-container')
:tag('tr')
outerRow:tag('td')
:attr('id', 'ws-index-main-cell')
:tag('table')
:attr('id', 'ws-index-main-table')
:tag('tr'):tag('td')
:tag('div')
:attr('id', 'ws-index-cover-container')
:wikitext(coverImage)
:done()
:node(metadataTable)
:done()
:tag('tr'):tag('td')
:tag('div')
:attr('id', 'ws-index-pagelist-container')
:addClass('mw-collapsible')
:tag('em'):wikitext(cfg.pagelist.pages.txt):done()
:wikitext(' ')
:tag('span')
:attr('id', 'ws-index-pagelist-legend')
:wikitext(cfg.pagelist.legend.txt)
:done()
:tag('div')
:attr('id', 'ws-index-pagelist')
:addClass('index-pagelist mw-collapsible-content')
:newline()
:wikitext(args.pages and mw.text.trim(args.pages))
:newline()
if args.remarks then
outerRow:tag('td')
:attr('id', 'ws-index-remarks')
:newline()
:wikitext(frame:preprocess(args.remarks))
else
outerRow:tag('td'):attr('id', 'ws-index-remarks-empty')
end
-- Notes block
if args.notes then
html:tag('div'):attr('id', 'ws-index-notes'):wikitext(args.notes)
end
-- Tracking categories
if cfg.type_cats[args.type] then
html:wikitext(construct_cat(cfg.type_cats[args.type]))
end
if cfg.source_cats[args.source] then
html:wikitext(construct_cat(cfg.source_cats[args.source]))
elseif args.source ~= 'lain-lain' then
html:wikitext(construct_cat('Indeks fail format lain'))
end
html:wikitext(construct_cat('Indeks'))
if not args.remarks then
html:wikitext(construct_cat('Laman berindeks'))
end
return talkremarks .. styles .. tostring(html) .. sortkey
end
function p.indexTemplate(frame)
return indexTemplate(frame)
end
return p
55x1l609t8rf2bcv40kfsgsjwl2r2z7
Modul:Index template/config
828
7955
22841
22827
2026-04-17T06:31:32Z
Hakimi97
9
Make indicator logo dark mode compatible
22841
Scribunto
text/plain
local function any_case(str)
return str:gsub('.', function(chr)
if chr:match('%a') then
return '[' .. chr:lower() .. chr:upper() .. ']'
else
return chr
end
end)
end
-- Inverted param_map: maps lua-key → Title-Case wikitext key.
-- Used by Modul:Arguments in the data module to resolve template parameters.
local param_map = {
['Type'] = 'type',
['Title'] = 'title',
['Subtitle'] = 'subtitle',
['Language'] = 'language',
['Volume'] = 'volume',
['Edition'] = 'edition',
['Author'] = 'author',
['Translator'] = 'translator',
['Editor'] = 'editor',
['Illustrator'] = 'illustrator',
['Publisher'] = 'publisher',
['Address'] = 'address',
['Printer'] = 'printer',
['Year'] = 'year',
['Source'] = 'source',
['Image'] = 'image',
['Progress'] = 'progress',
['Transclusion'] = 'transclusion',
['Validation_date'] = 'validation_date',
['ISBN'] = 'isbn',
['OCLC'] = 'oclc',
['LCCN'] = 'lccn',
['ARK'] = 'ark',
['DOI'] = 'doi',
['Volumes'] = 'volumes',
['Notes'] = 'notes',
['Pages'] = 'pages',
['Remarks'] = 'remarks',
['wikidata_item'] = 'wikidata_item',
}
local translate = {}
for titleCase, lowerCase in pairs(param_map) do
translate[lowerCase] = titleCase
end
local validation_cats = {
['dated'] = function(vdate)
return 'Indeks disahkan pada ' .. vdate
end,
['undated'] = 'Indeks disahkan tanpa tarikh',
}
return {
['param_map'] = param_map,
['translate'] = translate,
['headings'] = {
['title'] = { ['txt'] = 'Tajuk' },
['subtitle'] = { ['txt'] = 'Subtajuk' },
['language'] = { ['txt'] = 'Bahasa' },
['volume'] = { ['txt'] = 'Jilid' },
['edition'] = { ['txt'] = 'Edisi' },
['author'] = { ['txt'] = 'Pengarang' },
['translator'] = { ['txt'] = 'Penterjemah' },
['editor'] = { ['txt'] = 'Penyunting' },
['illustrator'] = { ['txt'] = 'Pengilustrasi' },
['publisher'] = { ['txt'] = 'Penerbit' },
['address'] = { ['txt'] = 'Alamat' },
['publishedin'] = { ['txt'] = 'Alamat penerbitan' },
['year'] = { ['txt'] = 'Tahun' },
['inception'] = { ['txt'] = 'Tarikh terawal' },
['printer'] = { ['txt'] = 'Pencetak' },
['source'] = { ['txt'] = 'Sumber' },
['progress'] = { ['txt'] = 'Kemajuan' },
['transclusion'] = { ['txt'] = 'Transklusi' },
['validation_date'] = { ['txt'] = 'Tarikh pengesahan' },
['isbn'] = { ['txt'] = 'ISBN' },
['oclc'] = { ['txt'] = 'OCLC' },
['lccn'] = { ['txt'] = 'LCCN' },
['ark'] = { ['txt'] = 'ARK' },
['doi'] = { ['txt'] = 'DOI' },
['volumes'] = { ['txt'] = 'Siri' },
},
['status'] = {
['T'] = {
['cat'] = 'Indeks disahkan',
['txt'] = 'Selesai disahkan',
},
['V'] = {
['cat'] = 'Indeks telah dibacaprufkan',
['txt'] = 'Akan disahkan',
},
['C'] = {
['cat'] = 'Indeks belum dibacaprufkan',
['txt'] = 'Akan dibacaprufkan',
},
['OCR'] = {
['cat'] = 'Indeks - Lapisan Teks Diperlukan',
['txt'] = 'Perlu tambah lapisan teks OCR',
},
['L'] = {
['cat'] = 'Indeks - Fail yang perlu dibaiki',
['txt'] = 'Fail sumber cacat',
['error'] = true,
},
['X'] = {
['cat'] = 'Indeks - Fail untuk disemak',
['txt'] = 'Semak kesemua muka surat pada fail sumber sebelum memulakan proses baca pruf (untuk mengesahkan fail tersebut tidak ada masalah)',
['error'] = true,
},
['_missing'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = 'Kemajuan tidak diketahui (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = function(index_status)
return 'Kemajuan tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['transclusion'] = {
['yes'] = {
['cat'] = 'Ditransklusi sepenuhnya',
['txt'] = 'Ditransklusi sepenuhnya',
},
['notimg'] = {
['cat'] = 'Imej belum ditransklusi sepenuhnya',
['txt'] = 'Imej belum ditransklusi sepenuhnya',
},
['notadv'] = {
['cat'] = 'Bahan pengiklanan belum ditransklusi',
['txt'] = 'Bahan pengiklanan belum ditransklusi',
},
['held'] = {
['cat'] = 'Transklusi ditangguhkan',
['txt'] = 'Transklusi ditangguhkan',
},
['check'] = {
['cat'] = 'Semakan transklusi diperlukan',
['txt'] = 'Semakan transklusi diperlukan',
},
['no'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Indeks belum ditransklusi mahupun diperiksa',
},
['_missing'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Status transklusi tiada (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = function(index_status)
return 'Status transklusi tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['validation_cats'] = validation_cats,
['url_gens'] = {
['isbn'] = function(id, text)
return require('Module:ISBN')._ISBN({id})
end,
['oclc'] = function(id, text)
return '[https://www.worldcat.org/oclc/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['lccn'] = function(id, text)
return '[https://lccn.loc.gov/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['ark'] = function(id, text)
return '[https://n2t.net/' .. mw.uri.encode(id, 'QUERY') .. ' ' .. text .. ']'
end,
['doi'] = function(id, text)
return '[https://doi.org/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
},
['cover'] = {
['width'] = '250px',
['image'] = 'File:Placeholder book.svg'
},
['cover_cats'] = {
['file_types'] = {
['jpg'] = 'image',
['png'] = 'image',
['gif'] = 'image',
['tif'] = 'image',
['ogg'] = 'audiovisual',
['ogv'] = 'audiovisual',
['webm'] = 'audiovisual',
['pdf'] = 'multipage',
['djvu'] = 'multipage',
['_empty_'] = 'unknown',
},
['image'] = 'Indeks fail imej',
['audiovisual'] = 'Indeks fail audiovizual',
['unknown'] = 'Indeks jenis tidak diketahui',
['missing'] = 'Indeks dengan fail hilang',
['fullspec'] = 'Indeks bukan imej dengan imej kulit ditentukan sepenuhnya',
},
['type_cats'] = {
['book'] = 'Indeks - Buku',
['journal'] = 'Indeks - Jurnal',
['collection'] = 'Indeks - Koleksi',
['dictionary'] = 'Indeks - Kamus',
['phdthesis'] = 'Indeks - Tesis',
},
['linkable_sources'] = {
djvu=true, pdf=true, png=true, gif=true,
tif=true, ogg=true, ogv=true, webm=true,
},
['source_cats'] = {
['djvu'] = 'Indeks fail DjVu',
['pdf'] = 'Indeks fail PDF',
['jpg'] = 'Indeks fail JPG',
['png'] = 'Indeks fail PNG',
['gif'] = 'Indeks fail GIF',
['tif'] = 'Indeks fail TIF',
['ogg'] = 'Indeks fail OGG',
['ogv'] = 'Indeks fail OGV',
['webm'] = 'Indeks fail WebM',
},
['pagelist'] = {
['pages'] = { ['txt'] = 'Senarai muka surat' },
['legend'] = { ['txt'] = '(kunci kepada [[Bantuan:Status_laman|Status Laman]])' }
},
['missing_heading_id'] = function(id)
return 'Tidak jumpa tajuk untuk ID: ' .. id
end,
['indicator_defaults'] = {
['width'] = '20px',
['include'] = function(args) return true end,
},
['indicators'] = {
{
name = 'pagegame',
image = 'File:OOjs UI icon page number.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl('toolforge:ws-page-game', {
wikisource = 'ms',
index = mw.uri.encode(args.fileTitle.rootText),
lang = 'ms',
}))
end,
caption = 'Permainan Laman Wikisumber (pembina senarai muka surat langkah-demi-langkah)',
},
{
name = 'purge file',
image = 'File:OOjs UI icon reload.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'Indeks:' .. args.pageTitle.text, { action = 'purge' }
))
end,
caption = 'Bersihkan fail',
},
{
name = 'book2scroll',
image = 'File:Library-logo-blue-outline.png',
width = '18px',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:book2scrollv2/read/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka pada Book2Scroll',
},
{
name = 'bookreader',
image = 'File:BookReader-favicon.svg',
width = '18px',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:bookreader/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka fail pada BookReader',
},
{
name = 'validated-index-date',
image = 'File:Yes Check Circle.svg',
width = '15px',
alt = 'Laman indeks yang disahkan.',
link = function(args)
local vdate = args.validation_date
return vdate
and tostring(mw.uri.fullUrl(
'Kategori:' .. validation_cats.dated(vdate)
))
or ''
end,
caption = function(args)
local vdate = args.validation_date
return vdate and 'Disahkan pada ' .. vdate or nil
end,
include = function(args)
return args.validation_date ~= nil
end,
},
},
['talkremarks'] = {
['text'] = function(args)
return 'Garis panduan pemformatan khusus untuk karya ini mungkin telah ditetapkan. Sila semak [[' .. args.talkPageTitle.prefixedText .. '|laman perbincangan Indeks ini]] dan patuhi sebarang kelaziman yang berkaitan.'
end,
['cat'] = 'Laman yang menggunakan catatan perbincangan indeks dengan parameter nota',
['keywords'] = {
-- Kata kunci Melayu
{
['pattern'] = any_case('nota?'),
['alone'] = true,
},
{
['pattern'] = any_case('nota? ringkas'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? bacapruf'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? tataletak'),
['alone'] = false,
},
{
['pattern'] = any_case('konvensyen? pemformatan'),
['alone'] = false,
},
{
['pattern'] = any_case('pemformatan'),
['alone'] = true,
},
{
['pattern'] = any_case('konvensyen?'),
['alone'] = true,
},
{
['pattern'] = any_case('tataletak'),
['alone'] = true,
},
{
['pattern'] = any_case('petikan'),
['alone'] = true,
},
{
['pattern'] = any_case('tanda petikan'),
['alone'] = false,
},
{
['pattern'] = any_case('tipografi'),
['alone'] = false,
},
{
['pattern'] = any_case('ejaan'),
['alone'] = false,
},
{
['pattern'] = any_case('panduan gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('garis? panduan?'),
['alone'] = false,
},
{
['pattern'] = any_case('laman? hilang'),
['alone'] = true,
},
-- Kata kunci Inggeris (untuk keserasian)
{
['pattern'] = any_case('notes?'),
['alone'] = true,
},
{
['pattern'] = any_case('formatting conventions?'),
['alone'] = false,
},
{
['pattern'] = any_case('formatt?i?n?g?'),
['alone'] = true,
},
{
['pattern'] = any_case('conventions?'),
['alone'] = true,
},
{
['pattern'] = any_case('guidelines?'),
['alone'] = false,
},
{
['pattern'] = any_case('style guide'),
['alone'] = false,
},
{
['pattern'] = any_case('spelling'),
['alone'] = false,
},
{
['pattern'] = any_case('typography'),
['alone'] = false,
},
{
['pattern'] = any_case('long[ %-]s'),
['alone'] = true,
},
},
},
}
qlux9qsv6xjxrlxovvum46t26b4zlaf
22842
22841
2026-04-17T06:34:22Z
Hakimi97
9
try to dark mode compatible
22842
Scribunto
text/plain
local function any_case(str)
return str:gsub('.', function(chr)
if chr:match('%a') then
return '[' .. chr:lower() .. chr:upper() .. ']'
else
return chr
end
end)
end
-- Inverted param_map: maps lua-key → Title-Case wikitext key.
-- Used by Modul:Arguments in the data module to resolve template parameters.
local param_map = {
['Type'] = 'type',
['Title'] = 'title',
['Subtitle'] = 'subtitle',
['Language'] = 'language',
['Volume'] = 'volume',
['Edition'] = 'edition',
['Author'] = 'author',
['Translator'] = 'translator',
['Editor'] = 'editor',
['Illustrator'] = 'illustrator',
['Publisher'] = 'publisher',
['Address'] = 'address',
['Printer'] = 'printer',
['Year'] = 'year',
['Source'] = 'source',
['Image'] = 'image',
['Progress'] = 'progress',
['Transclusion'] = 'transclusion',
['Validation_date'] = 'validation_date',
['ISBN'] = 'isbn',
['OCLC'] = 'oclc',
['LCCN'] = 'lccn',
['ARK'] = 'ark',
['DOI'] = 'doi',
['Volumes'] = 'volumes',
['Notes'] = 'notes',
['Pages'] = 'pages',
['Remarks'] = 'remarks',
['wikidata_item'] = 'wikidata_item',
}
local translate = {}
for titleCase, lowerCase in pairs(param_map) do
translate[lowerCase] = titleCase
end
local validation_cats = {
['dated'] = function(vdate)
return 'Indeks disahkan pada ' .. vdate
end,
['undated'] = 'Indeks disahkan tanpa tarikh',
}
return {
['param_map'] = param_map,
['translate'] = translate,
['headings'] = {
['title'] = { ['txt'] = 'Tajuk' },
['subtitle'] = { ['txt'] = 'Subtajuk' },
['language'] = { ['txt'] = 'Bahasa' },
['volume'] = { ['txt'] = 'Jilid' },
['edition'] = { ['txt'] = 'Edisi' },
['author'] = { ['txt'] = 'Pengarang' },
['translator'] = { ['txt'] = 'Penterjemah' },
['editor'] = { ['txt'] = 'Penyunting' },
['illustrator'] = { ['txt'] = 'Pengilustrasi' },
['publisher'] = { ['txt'] = 'Penerbit' },
['address'] = { ['txt'] = 'Alamat' },
['publishedin'] = { ['txt'] = 'Alamat penerbitan' },
['year'] = { ['txt'] = 'Tahun' },
['inception'] = { ['txt'] = 'Tarikh terawal' },
['printer'] = { ['txt'] = 'Pencetak' },
['source'] = { ['txt'] = 'Sumber' },
['progress'] = { ['txt'] = 'Kemajuan' },
['transclusion'] = { ['txt'] = 'Transklusi' },
['validation_date'] = { ['txt'] = 'Tarikh pengesahan' },
['isbn'] = { ['txt'] = 'ISBN' },
['oclc'] = { ['txt'] = 'OCLC' },
['lccn'] = { ['txt'] = 'LCCN' },
['ark'] = { ['txt'] = 'ARK' },
['doi'] = { ['txt'] = 'DOI' },
['volumes'] = { ['txt'] = 'Siri' },
},
['status'] = {
['T'] = {
['cat'] = 'Indeks disahkan',
['txt'] = 'Selesai disahkan',
},
['V'] = {
['cat'] = 'Indeks telah dibacaprufkan',
['txt'] = 'Akan disahkan',
},
['C'] = {
['cat'] = 'Indeks belum dibacaprufkan',
['txt'] = 'Akan dibacaprufkan',
},
['OCR'] = {
['cat'] = 'Indeks - Lapisan Teks Diperlukan',
['txt'] = 'Perlu tambah lapisan teks OCR',
},
['L'] = {
['cat'] = 'Indeks - Fail yang perlu dibaiki',
['txt'] = 'Fail sumber cacat',
['error'] = true,
},
['X'] = {
['cat'] = 'Indeks - Fail untuk disemak',
['txt'] = 'Semak kesemua muka surat pada fail sumber sebelum memulakan proses baca pruf (untuk mengesahkan fail tersebut tidak ada masalah)',
['error'] = true,
},
['_missing'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = 'Kemajuan tidak diketahui (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = function(index_status)
return 'Kemajuan tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['transclusion'] = {
['yes'] = {
['cat'] = 'Ditransklusi sepenuhnya',
['txt'] = 'Ditransklusi sepenuhnya',
},
['notimg'] = {
['cat'] = 'Imej belum ditransklusi sepenuhnya',
['txt'] = 'Imej belum ditransklusi sepenuhnya',
},
['notadv'] = {
['cat'] = 'Bahan pengiklanan belum ditransklusi',
['txt'] = 'Bahan pengiklanan belum ditransklusi',
},
['held'] = {
['cat'] = 'Transklusi ditangguhkan',
['txt'] = 'Transklusi ditangguhkan',
},
['check'] = {
['cat'] = 'Semakan transklusi diperlukan',
['txt'] = 'Semakan transklusi diperlukan',
},
['no'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Indeks belum ditransklusi mahupun diperiksa',
},
['_missing'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Status transklusi tiada (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = function(index_status)
return 'Status transklusi tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['validation_cats'] = validation_cats,
['url_gens'] = {
['isbn'] = function(id, text)
return require('Module:ISBN')._ISBN({id})
end,
['oclc'] = function(id, text)
return '[https://www.worldcat.org/oclc/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['lccn'] = function(id, text)
return '[https://lccn.loc.gov/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['ark'] = function(id, text)
return '[https://n2t.net/' .. mw.uri.encode(id, 'QUERY') .. ' ' .. text .. ']'
end,
['doi'] = function(id, text)
return '[https://doi.org/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
},
['cover'] = {
['width'] = '250px',
['image'] = 'File:Placeholder book.svg'
},
['cover_cats'] = {
['file_types'] = {
['jpg'] = 'image',
['png'] = 'image',
['gif'] = 'image',
['tif'] = 'image',
['ogg'] = 'audiovisual',
['ogv'] = 'audiovisual',
['webm'] = 'audiovisual',
['pdf'] = 'multipage',
['djvu'] = 'multipage',
['_empty_'] = 'unknown',
},
['image'] = 'Indeks fail imej',
['audiovisual'] = 'Indeks fail audiovizual',
['unknown'] = 'Indeks jenis tidak diketahui',
['missing'] = 'Indeks dengan fail hilang',
['fullspec'] = 'Indeks bukan imej dengan imej kulit ditentukan sepenuhnya',
},
['type_cats'] = {
['book'] = 'Indeks - Buku',
['journal'] = 'Indeks - Jurnal',
['collection'] = 'Indeks - Koleksi',
['dictionary'] = 'Indeks - Kamus',
['phdthesis'] = 'Indeks - Tesis',
},
['linkable_sources'] = {
djvu=true, pdf=true, png=true, gif=true,
tif=true, ogg=true, ogv=true, webm=true,
},
['source_cats'] = {
['djvu'] = 'Indeks fail DjVu',
['pdf'] = 'Indeks fail PDF',
['jpg'] = 'Indeks fail JPG',
['png'] = 'Indeks fail PNG',
['gif'] = 'Indeks fail GIF',
['tif'] = 'Indeks fail TIF',
['ogg'] = 'Indeks fail OGG',
['ogv'] = 'Indeks fail OGV',
['webm'] = 'Indeks fail WebM',
},
['pagelist'] = {
['pages'] = { ['txt'] = 'Senarai muka surat' },
['legend'] = { ['txt'] = '(kunci kepada [[Bantuan:Status_laman|Status Laman]])' }
},
['missing_heading_id'] = function(id)
return 'Tidak jumpa tajuk untuk ID: ' .. id
end,
['indicator_defaults'] = {
['width'] = '20px',
['include'] = function(args) return true end,
},
['indicators'] = {
{
name = 'pagegame',
image = 'File:OOjs UI icon page number.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl('toolforge:ws-page-game', {
wikisource = 'ms',
index = mw.uri.encode(args.fileTitle.rootText),
lang = 'ms',
}))
end,
caption = 'Permainan Laman Wikisumber (pembina senarai muka surat langkah-demi-langkah)',
},
{
name = 'purge file',
image = 'File:OOjs UI icon reload.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'Indeks:' .. args.pageTitle.text, { action = 'purge' }
))
end,
caption = 'Bersihkan fail',
},
{
name = 'book2scroll',
image = 'File:Library-logo-blue-outline.png',
width = '18px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:book2scrollv2/read/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka pada Book2Scroll',
},
{
name = 'bookreader',
image = 'File:BookReader-favicon.svg',
width = '18px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:bookreader/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka fail pada BookReader',
},
{
name = 'validated-index-date',
image = 'File:Yes Check Circle.svg',
width = '15px',
alt = 'Laman indeks yang disahkan.',
class = 'skin-invert',
link = function(args)
local vdate = args.validation_date
return vdate
and tostring(mw.uri.fullUrl(
'Kategori:' .. validation_cats.dated(vdate)
))
or ''
end,
caption = function(args)
local vdate = args.validation_date
return vdate and 'Disahkan pada ' .. vdate or nil
end,
include = function(args)
return args.validation_date ~= nil
end,
},
},
['talkremarks'] = {
['text'] = function(args)
return 'Garis panduan pemformatan khusus untuk karya ini mungkin telah ditetapkan. Sila semak [[' .. args.talkPageTitle.prefixedText .. '|laman perbincangan Indeks ini]] dan patuhi sebarang kelaziman yang berkaitan.'
end,
['cat'] = 'Laman yang menggunakan catatan perbincangan indeks dengan parameter nota',
['keywords'] = {
-- Kata kunci Melayu
{
['pattern'] = any_case('nota?'),
['alone'] = true,
},
{
['pattern'] = any_case('nota? ringkas'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? bacapruf'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? tataletak'),
['alone'] = false,
},
{
['pattern'] = any_case('konvensyen? pemformatan'),
['alone'] = false,
},
{
['pattern'] = any_case('pemformatan'),
['alone'] = true,
},
{
['pattern'] = any_case('konvensyen?'),
['alone'] = true,
},
{
['pattern'] = any_case('tataletak'),
['alone'] = true,
},
{
['pattern'] = any_case('petikan'),
['alone'] = true,
},
{
['pattern'] = any_case('tanda petikan'),
['alone'] = false,
},
{
['pattern'] = any_case('tipografi'),
['alone'] = false,
},
{
['pattern'] = any_case('ejaan'),
['alone'] = false,
},
{
['pattern'] = any_case('panduan gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('garis? panduan?'),
['alone'] = false,
},
{
['pattern'] = any_case('laman? hilang'),
['alone'] = true,
},
-- Kata kunci Inggeris (untuk keserasian)
{
['pattern'] = any_case('notes?'),
['alone'] = true,
},
{
['pattern'] = any_case('formatting conventions?'),
['alone'] = false,
},
{
['pattern'] = any_case('formatt?i?n?g?'),
['alone'] = true,
},
{
['pattern'] = any_case('conventions?'),
['alone'] = true,
},
{
['pattern'] = any_case('guidelines?'),
['alone'] = false,
},
{
['pattern'] = any_case('style guide'),
['alone'] = false,
},
{
['pattern'] = any_case('spelling'),
['alone'] = false,
},
{
['pattern'] = any_case('typography'),
['alone'] = false,
},
{
['pattern'] = any_case('long[ %-]s'),
['alone'] = true,
},
},
},
}
m0c51uu18bjjtri4el1cvv4ofdt9kk3
22843
22842
2026-04-17T06:35:42Z
Hakimi97
9
22843
Scribunto
text/plain
local function any_case(str)
return str:gsub('.', function(chr)
if chr:match('%a') then
return '[' .. chr:lower() .. chr:upper() .. ']'
else
return chr
end
end)
end
-- Inverted param_map: maps lua-key → Title-Case wikitext key.
-- Used by Modul:Arguments in the data module to resolve template parameters.
local param_map = {
['Type'] = 'type',
['Title'] = 'title',
['Subtitle'] = 'subtitle',
['Language'] = 'language',
['Volume'] = 'volume',
['Edition'] = 'edition',
['Author'] = 'author',
['Translator'] = 'translator',
['Editor'] = 'editor',
['Illustrator'] = 'illustrator',
['Publisher'] = 'publisher',
['Address'] = 'address',
['Printer'] = 'printer',
['Year'] = 'year',
['Source'] = 'source',
['Image'] = 'image',
['Progress'] = 'progress',
['Transclusion'] = 'transclusion',
['Validation_date'] = 'validation_date',
['ISBN'] = 'isbn',
['OCLC'] = 'oclc',
['LCCN'] = 'lccn',
['ARK'] = 'ark',
['DOI'] = 'doi',
['Volumes'] = 'volumes',
['Notes'] = 'notes',
['Pages'] = 'pages',
['Remarks'] = 'remarks',
['wikidata_item'] = 'wikidata_item',
}
local translate = {}
for titleCase, lowerCase in pairs(param_map) do
translate[lowerCase] = titleCase
end
local validation_cats = {
['dated'] = function(vdate)
return 'Indeks disahkan pada ' .. vdate
end,
['undated'] = 'Indeks disahkan tanpa tarikh',
}
return {
['param_map'] = param_map,
['translate'] = translate,
['headings'] = {
['title'] = { ['txt'] = 'Tajuk' },
['subtitle'] = { ['txt'] = 'Subtajuk' },
['language'] = { ['txt'] = 'Bahasa' },
['volume'] = { ['txt'] = 'Jilid' },
['edition'] = { ['txt'] = 'Edisi' },
['author'] = { ['txt'] = 'Pengarang' },
['translator'] = { ['txt'] = 'Penterjemah' },
['editor'] = { ['txt'] = 'Penyunting' },
['illustrator'] = { ['txt'] = 'Pengilustrasi' },
['publisher'] = { ['txt'] = 'Penerbit' },
['address'] = { ['txt'] = 'Alamat' },
['publishedin'] = { ['txt'] = 'Alamat penerbitan' },
['year'] = { ['txt'] = 'Tahun' },
['inception'] = { ['txt'] = 'Tarikh terawal' },
['printer'] = { ['txt'] = 'Pencetak' },
['source'] = { ['txt'] = 'Sumber' },
['progress'] = { ['txt'] = 'Kemajuan' },
['transclusion'] = { ['txt'] = 'Transklusi' },
['validation_date'] = { ['txt'] = 'Tarikh pengesahan' },
['isbn'] = { ['txt'] = 'ISBN' },
['oclc'] = { ['txt'] = 'OCLC' },
['lccn'] = { ['txt'] = 'LCCN' },
['ark'] = { ['txt'] = 'ARK' },
['doi'] = { ['txt'] = 'DOI' },
['volumes'] = { ['txt'] = 'Siri' },
},
['status'] = {
['T'] = {
['cat'] = 'Indeks disahkan',
['txt'] = 'Selesai disahkan',
},
['V'] = {
['cat'] = 'Indeks telah dibacaprufkan',
['txt'] = 'Akan disahkan',
},
['C'] = {
['cat'] = 'Indeks belum dibacaprufkan',
['txt'] = 'Akan dibacaprufkan',
},
['OCR'] = {
['cat'] = 'Indeks - Lapisan Teks Diperlukan',
['txt'] = 'Perlu tambah lapisan teks OCR',
},
['L'] = {
['cat'] = 'Indeks - Fail yang perlu dibaiki',
['txt'] = 'Fail sumber cacat',
['error'] = true,
},
['X'] = {
['cat'] = 'Indeks - Fail untuk disemak',
['txt'] = 'Semak kesemua muka surat pada fail sumber sebelum memulakan proses baca pruf (untuk mengesahkan fail tersebut tidak ada masalah)',
['error'] = true,
},
['_missing'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = 'Kemajuan tidak diketahui (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks - Kemajuan tidak diketahui',
['txt'] = function(index_status)
return 'Kemajuan tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['transclusion'] = {
['yes'] = {
['cat'] = 'Ditransklusi sepenuhnya',
['txt'] = 'Ditransklusi sepenuhnya',
},
['notimg'] = {
['cat'] = 'Imej belum ditransklusi sepenuhnya',
['txt'] = 'Imej belum ditransklusi sepenuhnya',
},
['notadv'] = {
['cat'] = 'Bahan pengiklanan belum ditransklusi',
['txt'] = 'Bahan pengiklanan belum ditransklusi',
},
['held'] = {
['cat'] = 'Transklusi ditangguhkan',
['txt'] = 'Transklusi ditangguhkan',
},
['check'] = {
['cat'] = 'Semakan transklusi diperlukan',
['txt'] = 'Semakan transklusi diperlukan',
},
['no'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Indeks belum ditransklusi mahupun diperiksa',
},
['_missing'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = 'Status transklusi tiada (ralat templat)',
['error'] = true,
},
['_default'] = {
['cat'] = 'Indeks belum ditransklusi',
['txt'] = function(index_status)
return 'Status transklusi tidak diketahui: ' .. index_status .. ' (ralat templat)'
end,
['error'] = true,
}
},
['validation_cats'] = validation_cats,
['url_gens'] = {
['isbn'] = function(id, text)
return require('Module:ISBN')._ISBN({id})
end,
['oclc'] = function(id, text)
return '[https://www.worldcat.org/oclc/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['lccn'] = function(id, text)
return '[https://lccn.loc.gov/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
['ark'] = function(id, text)
return '[https://n2t.net/' .. mw.uri.encode(id, 'QUERY') .. ' ' .. text .. ']'
end,
['doi'] = function(id, text)
return '[https://doi.org/' .. mw.uri.encode(id, 'PATH') .. ' ' .. text .. ']'
end,
},
['cover'] = {
['width'] = '250px',
['image'] = 'File:Placeholder book.svg'
},
['cover_cats'] = {
['file_types'] = {
['jpg'] = 'image',
['png'] = 'image',
['gif'] = 'image',
['tif'] = 'image',
['ogg'] = 'audiovisual',
['ogv'] = 'audiovisual',
['webm'] = 'audiovisual',
['pdf'] = 'multipage',
['djvu'] = 'multipage',
['_empty_'] = 'unknown',
},
['image'] = 'Indeks fail imej',
['audiovisual'] = 'Indeks fail audiovizual',
['unknown'] = 'Indeks jenis tidak diketahui',
['missing'] = 'Indeks dengan fail hilang',
['fullspec'] = 'Indeks bukan imej dengan imej kulit ditentukan sepenuhnya',
},
['type_cats'] = {
['book'] = 'Indeks - Buku',
['journal'] = 'Indeks - Jurnal',
['collection'] = 'Indeks - Koleksi',
['dictionary'] = 'Indeks - Kamus',
['phdthesis'] = 'Indeks - Tesis',
},
['linkable_sources'] = {
djvu=true, pdf=true, png=true, gif=true,
tif=true, ogg=true, ogv=true, webm=true,
},
['source_cats'] = {
['djvu'] = 'Indeks fail DjVu',
['pdf'] = 'Indeks fail PDF',
['jpg'] = 'Indeks fail JPG',
['png'] = 'Indeks fail PNG',
['gif'] = 'Indeks fail GIF',
['tif'] = 'Indeks fail TIF',
['ogg'] = 'Indeks fail OGG',
['ogv'] = 'Indeks fail OGV',
['webm'] = 'Indeks fail WebM',
},
['pagelist'] = {
['pages'] = { ['txt'] = 'Senarai muka surat' },
['legend'] = { ['txt'] = '(kunci kepada [[Bantuan:Status_laman|Status Laman]])' }
},
['missing_heading_id'] = function(id)
return 'Tidak jumpa tajuk untuk ID: ' .. id
end,
['indicator_defaults'] = {
['width'] = '20px',
['include'] = function(args) return true end,
},
['indicators'] = {
{
name = 'pagegame',
image = 'File:OOjs UI icon page number.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl('toolforge:ws-page-game', {
wikisource = 'ms',
index = mw.uri.encode(args.fileTitle.rootText),
lang = 'ms',
}))
end,
caption = 'Permainan Laman Wikisumber (pembina senarai muka surat langkah-demi-langkah)',
},
{
name = 'purge file',
image = 'File:OOjs UI icon reload.svg',
width = '20px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'Indeks:' .. args.pageTitle.text, { action = 'purge' }
))
end,
caption = 'Bersihkan fail',
},
{
name = 'book2scroll',
image = 'File:Library-logo-blue-outline.png',
width = '18px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:book2scrollv2/read/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka pada Book2Scroll',
},
{
name = 'bookreader',
image = 'File:BookReader-favicon.svg',
width = '18px',
class = 'skin-invert',
link = function(args)
return tostring(mw.uri.fullUrl(
'toolforge:bookreader/ms/' ..
mw.uri.encode(args.fileTitle.rootText)
))
end,
caption = 'Buka fail pada BookReader',
},
{
name = 'validated-index-date',
image = 'File:Yes Check Circle.svg',
width = '15px',
alt = 'Laman indeks yang disahkan.',
link = function(args)
local vdate = args.validation_date
return vdate
and tostring(mw.uri.fullUrl(
'Kategori:' .. validation_cats.dated(vdate)
))
or ''
end,
caption = function(args)
local vdate = args.validation_date
return vdate and 'Disahkan pada ' .. vdate or nil
end,
include = function(args)
return args.validation_date ~= nil
end,
},
},
['talkremarks'] = {
['text'] = function(args)
return 'Garis panduan pemformatan khusus untuk karya ini mungkin telah ditetapkan. Sila semak [[' .. args.talkPageTitle.prefixedText .. '|laman perbincangan Indeks ini]] dan patuhi sebarang kelaziman yang berkaitan.'
end,
['cat'] = 'Laman yang menggunakan catatan perbincangan indeks dengan parameter nota',
['keywords'] = {
-- Kata kunci Melayu
{
['pattern'] = any_case('nota?'),
['alone'] = true,
},
{
['pattern'] = any_case('nota? ringkas'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? bacapruf'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('nota? tataletak'),
['alone'] = false,
},
{
['pattern'] = any_case('konvensyen? pemformatan'),
['alone'] = false,
},
{
['pattern'] = any_case('pemformatan'),
['alone'] = true,
},
{
['pattern'] = any_case('konvensyen?'),
['alone'] = true,
},
{
['pattern'] = any_case('tataletak'),
['alone'] = true,
},
{
['pattern'] = any_case('petikan'),
['alone'] = true,
},
{
['pattern'] = any_case('tanda petikan'),
['alone'] = false,
},
{
['pattern'] = any_case('tipografi'),
['alone'] = false,
},
{
['pattern'] = any_case('ejaan'),
['alone'] = false,
},
{
['pattern'] = any_case('panduan gaya'),
['alone'] = false,
},
{
['pattern'] = any_case('garis? panduan?'),
['alone'] = false,
},
{
['pattern'] = any_case('laman? hilang'),
['alone'] = true,
},
-- Kata kunci Inggeris (untuk keserasian)
{
['pattern'] = any_case('notes?'),
['alone'] = true,
},
{
['pattern'] = any_case('formatting conventions?'),
['alone'] = false,
},
{
['pattern'] = any_case('formatt?i?n?g?'),
['alone'] = true,
},
{
['pattern'] = any_case('conventions?'),
['alone'] = true,
},
{
['pattern'] = any_case('guidelines?'),
['alone'] = false,
},
{
['pattern'] = any_case('style guide'),
['alone'] = false,
},
{
['pattern'] = any_case('spelling'),
['alone'] = false,
},
{
['pattern'] = any_case('typography'),
['alone'] = false,
},
{
['pattern'] = any_case('long[ %-]s'),
['alone'] = true,
},
},
},
}
pj8qubytpg86xzhgv50ezz1feympcyd