Modul:Documentation: Perbedaan antara revisi

6 bita ditambahkan ,  2 tahun yang lalu
tidak ada ringkasan suntingan
Tidak ada ringkasan suntingan
Tag: Dikembalikan
Tidak ada ringkasan suntingan
Tag: Pengembalian manual Dikembalikan
Baris 2: Baris 2:


-- Get required modules.
-- Get required modules.
local getArgs = require('Modul:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local messageBox = require('Modul:Message box')
local messageBox = require('Module:Message box')


-- Get the config table.
-- Get the config table.
local cfg = mw.loadData('Modul:Documentation/config')
local cfg = mw.loadData('Module:Documentation/config')
local i18n = mw.loadData('Modul:Documentation/i18n')
local i18n = mw.loadData('Module:Documentation/i18n')
local p = {}
local p = {}


Baris 33: Baris 33:
expectType = expectType or 'string'
expectType = expectType or 'string'
if type(msg) ~= expectType then
if type(msg) ~= expectType then
error(require('Modul:TNT').format('I18n/Documentation', 'cfg-error-msg-type', cfgKey, expectType, type(msg)), 2)
error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-type', cfgKey, expectType, type(msg)), 2)
end
end
if not valArray then
if not valArray then
Baris 41: Baris 41:
local function getMessageVal(match)
local function getMessageVal(match)
match = tonumber(match)
match = tonumber(match)
return valArray[match] or error(require('Modul:TNT').format('I18n/Documentation', 'cfg-error-msg-empty', '$' .. match, cfgKey), 4)
return valArray[match] or error(require('Module:TNT').format('I18n/Documentation', 'cfg-error-msg-empty', '$' .. match, cfgKey), 4)
end
end