{'%s<5p4n> (%s, %s)', {romanized, native, extra}}, -- 7 - romanized (native, extra)
{'%s<5p4n>', {english}}, -- 8 - english
{'%s<5p4n> (%s)', {english, extra}}, -- 9 - english (extra)
{'%s<5p4n> (%s)', {english, romanized}}, -- 10 - english (romanized)
{'%s<5p4n> (%s, %s)', {english, romanized, extra}}, -- 11 - english (romanized, extra)
{'%s<5p4n> (%s)', {english, native}}, -- 12 - english (native)
{'%s<5p4n> (%s, %s)', {english, native, extra}}, -- 13 - english (native, extra)
{'%s<5p4n> (%s, %s)', {english, native, romanized}}, -- 14 - english (native, romanized)
{'%s<5p4n> (%s, %s, %s)', {english, native, romanized, extra}}, -- 15 - english (native, romanized, extra)
}  
local ret_string = renderer (args, formatting, extra2)
ret_string = romanized_kern (ret_string, romanized); -- kern romanized text when appropriate
ret_string = ret_string:gsub ('<5p4n>', '<span>'):gsub ('</5p4n>', '</span>'); -- replace 'secret' tags with proper tags  
return ret_string; -- because gsub returns the number of replacements made as second return value
end  
----------------------------< C O M M O N _ R O M A N I Z E D _ N A T I V E _ T R A N S L A T E D >----------  
Common support for and  
render order: is romanized, native, translated (English)  
<template> is used to select the appropriate cfg table  
local function common_romanized_native_translated (, template)
local lang_module = require ('Module:Lang' .. (:getTitle:match ('/sandbox') or '')); -- if this module is the sandbox, use Module:lang/sandbox; Module:Lang else
local args = require ('Module:Arguments').getArgs ;  
local english, native, romanized, extra, extra2 = args[1], args[2], args[3], args.extra or args[4], args.extra2 or args[5]; -- meaningful names
args[4] = extra or args[4]; -- ensure that extra is 'positional' for use by renderer  
if not (native or romanized) then -- not present, return an error message
return error_message (template);
end
native = native and lang_module._lang ({cfg[template].tag, native}) or nil;
romanized = romanized and lang_module._transl ({cfg[template].tag, cfg[template].system, romanized}) or nil;  
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
{'<5p4n>(%s)', {extra}}, -- 1 - (extra)
{'%s<5p4n>', {romanized}}, -- 2 - romanized
{'%s<5p4n> (%s)', {romanized, extra}}, -- 3 - romanized (extra)
{'<5p4n>(%s)', {native}}, -- 4 - native
{'<5p4n>(%s, %s)', {native, extra}}, -- 5 - (native, extra)
{'%s<5p4n> (%s)', {romanized, native}}, -- 6 - romanized (native)
{'%s<5p4n> (%s, %s)', {romanized, native, extra}}, -- 7 - romanized (native, extra)
{'%s<5p4n>', {english}}, -- 8 - english
{'%s<5p4n> (%s)', {english, extra}}, -- 9 - english (extra)
{'%s<5p4n> (%s)', {romanized, english}}, -- 10 - romanized (english)
{'%s<5p4n> (%s, %s)', {romanized, english, extra}}, -- 11 - romanized (english, extra)
{'%s<5p4n> (%s)', {english, native}}, -- 12 - english (native)
{'%s<5p4n> (%s, %s)', {english, native, extra}}, -- 13 - english (native, extra)
{'%s<5p4n> (%s, %s)', {romanized, native, english}}, -- 14 - romanized (native, english)
{'%s<5p4n> (%s, %s, %s)', {romanized, native, english, extra}}, -- 15 - romanized (native, english, extra)
}  
local ret_string = renderer (args, formatting, extra2)
ret_string = ret_string:gsub ('<5p4n>', '<span>'):gsub ('</5p4n>', '</span>'); -- replace 'secret' tags with proper tags
return ret_string; -- because gsub returns the number of replacements made as second return value
end  
----------------------------< C O M M O N _ N A T I V E _ R O M A N I Z E D _ T R A N S L A T E D >----------  
Common support for and  
render order: is native, romanized, translated (English)  
<template> is used to select the appropriate cfg table  
local function common_native_romanized_translated (, template)
local lang_module = require ('Module:Lang' .. (:getTitle:match ('/sandbox') or '')); -- if this module is the sandbox, use Module:lang/sandbox; Module:Lang else
local args = require ('Module:Arguments').getArgs ;  
local english, native, romanized, extra, extra2 = args[1], args[2], args[3], args.extra or args[4], args.extra2 or args[5]; -- meaningful names
args[4] = extra or args[4]; -- ensure that extra is 'positional' for use by renderer  
if not (native or romanized) then -- not present, return an error message
return error_message (template);
end
native = native and lang_module._lang ({cfg[template].tag, native}) or nil;
romanized = romanized and lang_module._transl ({cfg[template].tag, cfg[template].system, romanized}) or nil;  
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
{'<5p4n>(%s)', {extra}}, -- 1 - (extra)
{'%s<5p4n>', {romanized}}, -- 2 - romanized
{'%s<5p4n> (%s)', {romanized, extra}}, -- 3 - romanized (extra)
{'<5p4n>%s', {native}}, -- 4 - native
{'<5p4n>%s (%s)', {native, extra}}, -- 5 - native (extra)
{'<5p4n>%s (%s)', {native, romanized}}, -- 6 - native (romanized)
{'<5p4n>%s (%s, %s)', {native, romanized, extra}}, -- 7 - native (romanized, extra)
{'%s<5p4n>', {english}}, -- 8 - english
{'%s<5p4n> (%s)', {english, extra}}, -- 9 - english (extra)
{'%s<5p4n> (%s)', {romanized, english}}, -- 10 - romanized (english)
{'%s<5p4n> (%s, %s)', {romanized, english, extra}}, -- 11 - romanized (english, extra)
{'<5p4n>%s (%s)', {native, english}}, -- 12 - native (english)
{'<5p4n>%s (%s, %s)', {native, english, extra}}, -- 13 - native (english, extra)
{'<5p4n>%s (%s, %s)', {native, romanized, english}}, -- 14 - native (romanized, english)
{'<5p4n>%s (%s, %s, %s)', {native, romanized, english, extra}}, -- 15 - native (romanized, english, extra)
}  
local ret_string = renderer (args, formatting, extra2)
ret_string = romanized_kern (ret_string, romanized); -- kern romanized text when appropriate
ret_string = ret_string:gsub ('<5p4n>', '<span>'):gsub ('</5p4n>', '</span>'); -- replace 'secret' tags with proper tags
return ret_string; -- because gsub returns the number of replacements made as second return value
end  
----------------------------< C O M M O N _ F O O T >--------------------------------------------------------  
Common support for and  
render order: is English  
<template> is used to select the appropriate cfg table  
local function common_foot (, template)
local lang_module = require ('Module:Lang' .. (:getTitle:match ('/sandbox') or '')); -- if this module is the sandbox, use Module:lang/sandbox; Module:Lang else
local args = require ('Module:Arguments').getArgs ;  
local english, native, romanized, extra, extra2 = args[1], args[2], args[3], args.extra or args[4], args.extra2 or args[5]; -- meaningful names
args[4] = extra or args[4]; -- ensure that extra is 'positional' for use by renderer
local post = args[6] or args.post;
local group = args.group;
local ref_name = args.ref_name
local lead = 'yes' == args.lead; -- make boolean  
if not (native or romanized) then -- not present, return an error message
return error_message (template);
end
if native then
native = lead and lang_module._lang_xx_inherit ({['code']=cfg[template].tag, native}) or lang_module._lang ({cfg[template].tag, native}); -- add ja script with/without language prefix
end
if romanized then
romanized = (lead and (cfg[template].system_link .. ': ') or '') .. lang_module._transl ({'ja', cfg[template].system, romanized}) or nil;
end  
local formatting = {
{'%s', {extra}}, -- 1 - extra
{'%s', {romanized}}, -- 2 - romanized
{'%s, %s', {romanized, extra}}, -- 3 - romanized, extra
{'%s', {native}}, -- 4 - native
{'%s, %s', {native, extra}}, -- 5 - native, extra
{'%s, %s', {native, romanized}}, -- 6 - native romanized
{'%s, %s, %s', {native, romanized, extra}}, -- 7 - native romanized, extra
-- from here english is used in the mapping but not rendered by renderer so not included in the table
{*, {*}}, -- 8 - english
{'%s', {extra}}, -- 9 - extra
{'%s', {romanized}}, -- 10 - romanized