Module:TNT: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
update manually from mw
(and one more optimization)
(update manually from mw)
Line 59:
 
-- Identical to p.msg() above, but used from other lua modules
function-- Parameters: name of p.format(dataset, message key, params,optional lang)arguments
-- Example with 2 params: format('I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.format(dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('format', 1, dataset, 'string')
checkType('format', 2, key, 'string')
return formatMessage(dataset, key, params, lang{...})
checkType('format', 3, params, 'table', true)
end
checkType('format', 4, lang, 'string', true)
 
return formatMessage(dataset, key, params, lang)
 
-- Identical to p.msg() above, but used from other lua modules with the language param
-- Parameters: language code, name of dataset, message key, optional arguments
-- Example with 2 params: formatInLanguage('es', I18n/Module:TNT', 'error_bad_msgkey', 'my-key', 'my-dataset')
function p.formatInLanguage(lang, dataset, key, ...)
local checkType = require('libraryUtil').checkType
checkType('formatformatInLanguage', 41, lang, 'string', true)
checkType('formatInLanguage', 2, dataset, 'string')
checkType('formatformatInLanguage', 3, paramskey, 'tablestring', true)
return formatMessage(dataset, key, {...}, lang)
end
 
0

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu