Changes

Jump to: navigation, search

Module:Template translation

51 bytes added, 10:40, 24 May 2013
m
fix
local p = {}
function p.renderTranslatedTemplate(frame, template)
--[[ If on a translation subpage (like Foobar/de), this function renders
a given template in the same language, if the translation is available.
Otherwise, the template is rendered in its default language, without
modification. This is aimed at replacing Template:TNT. ]]
local langcode = ''
if ( mw.language.isValidCode( subpage ) )
then
local translation = mw.title.new( frame[template]..'/'..subpage, 'Template' )
if ( translation.id ~= 0)
then
Anonymous user

Navigation menu