You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local p = {}
function p.localize( strToTrans, page )
local frame = mw.getCurrentFrame()
if ( page == nil or page == '' ) then
page = 'All'
end
local timeStart = os.clock()
local langSuffix = frame:expandTemplate{ title = 'GetLangSuffix' }
local timeEnd = os.clock()
mw.log('Utilities:localize (globalLangSuffix, timeNeeded): '..globalLangSuffix..', '..timeEnd-timeStart)
-- check if input is a number
if ( tonumber(strToTrans) == nil ) then
return strToTrans
end
local strFromTrans = frame:callParserFunction( '#lst', { 'Localization:'..page..langSuffix, strToTrans})
-- did translation work?
if ( strFromTrans ~= '') then
return strFromTrans
000
1:0
Template used on this page:
Return to Module:Utilities.