Module:Template test case: Difference between revisions

    (add a shared message method)
    (add more messages and use the sandboxSubpage config value to generate sandbox template names)
    Line 170: Line 170:
    for i = 3, highestNum do
    for i = 3, highestNum do
    if not options['template' .. i] then
    if not options['template' .. i] then
    error(string.format(
    error(self:message(
    "one or more options ending in '%d' were " ..
    'missing-template-option-error',
    "detected, but no 'template%d' option was found",
    i, i
    i, i
    ), 2)
    ), 2)
    Line 191: Line 190:
    templateOptions[2] = templateOptions[2] or {}
    templateOptions[2] = templateOptions[2] or {}
    if templateOptions[1].template and not templateOptions[2].template then
    if templateOptions[1].template and not templateOptions[2].template then
    templateOptions[2].template = templateOptions[1].template .. '/sandbox'
    templateOptions[2].template = templateOptions[1].template
    .. '/' .. obj.cfg.sandboxSubpage
    end
    end
    if not templateOptions[1].template then
    if not templateOptions[1].template then
    Line 197: Line 197:
    end
    end
    if not templateOptions[2].template then
    if not templateOptions[2].template then
    templateOptions[2].title = templateOptions[1].title:subPageTitle('sandbox')
    templateOptions[2].title = templateOptions[1].title:subPageTitle(
    obj.cfg.sandboxSubpage
    )
    end
    end


    Line 273: Line 275:
    :cssText(self.options.style)
    :cssText(self.options.style)
    :tag('caption')
    :tag('caption')
    :wikitext(self.options.caption or 'Side by side comparison')
    :wikitext(self.options.caption or self:message('columns-header'))


    -- Headings
    -- Headings