Content deleted Content added
sync from sandbox; |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 19:
--[[--------------------------< C O N F I G U R A T I O N >----------------------------------------------------
configuration setting for the various templates. keys to this table are the template names without
]]
Line 110:
--[[--------------------------< R O M A N I Z E D _ K E R N >--------------------------------------------------
Add kerning when first or last character of romanized text contacts adjacent opening or closing
In this example, without kerning, the romanized characters 'j' and 'V' are italicized so will contact the parentheses
Line 116:
<ret_string> is the formatted template output (except that the magic string '<5p4n>' has not yet been replaced)
<romanized> is the return from lang_module.
]]
Line 125:
end
local romanized_text = romanized:gsub ('%b<>', ''):gsub ('\'\'+', ''):gsub ('%[%[', ''):gsub ('%]%]', ''); -- strip
romanized = romanized:gsub ('([%(%)%.%%%+%-%*%?%[%^%$%]])', '%%%1'); -- escape lua pattern characters
Line 167:
args[4] = extra or args[4]; -- ensure that extra is 'positional' for use by renderer()
local lead = require ('
if not (native or romanized) then -- not present, return an error message
Line 177:
end
if romanized then
romanized = (lead and english and (cfg[template].system_link .. ': ') or '') .. lang_module.
end
Line 185:
{'%s<5p4n> (%s)', {romanized, extra}}, -- 3 - romanized (extra)
{'<5p4n>(%s)', {native}}, -- 4 - native
{'<5p4n>(%s
{'%s<5p4n> (%s)', {romanized, native}}, -- 6 - romanized (native)
{'%s<5p4n> (%s
{'%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<5p4n> (%s)', {english, native}}, -- 12 - english (native)
{'%s<5p4n> (%s
{'%s<5p4n> (%s, %s)', {english, native, romanized}}, -- 14 - english (native, romanized)
{'%s<5p4n> (%s, %s
}
Line 227:
end
native = native and lang_module._lang ({cfg[template].tag, native, ['template']=template}) or nil;
romanized = romanized and lang_module.
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
Line 234:
{'%s<5p4n> (%s)', {romanized, extra}}, -- 3 - romanized (extra)
{'<5p4n>(%s)', {native}}, -- 4 - native
{'<5p4n>(%s
{'%s<5p4n> (%s)', {romanized, native}}, -- 6 - romanized (native)
{'%s<5p4n> (%s
{'%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<5p4n> (%s)', {english, native}}, -- 12 - english (native)
{'%s<5p4n> (%s
{'%s<5p4n> (%s, %s)', {romanized, native, english}}, -- 14 - romanized (native, english)
{'%s<5p4n> (%s, %s
}
Line 273:
end
native = native and lang_module._lang ({cfg[template].tag, native, ['template']=template}) or nil;
romanized = romanized and lang_module.
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
Line 282:
{'<5p4n>%s (%s)', {native, extra}}, -- 5 - native (extra)
{'<5p4n>%s (%s)', {native, romanized}}, -- 6 - native (romanized)
{'<5p4n>%s (%s
{'%s<5p4n>', {english}}, -- 8 - english
{'%s<5p4n> (%s)', {english, extra}}, -- 9 - english (extra)
{'%s<5p4n> (%s)', {romanized, english}}, -- 10 - romanized (english)
{'%s<5p4n> (%s
{'<5p4n>%s (%s)', {native, english}}, -- 12 - native (english)
{'<5p4n>%s (%s
{'<5p4n>%s (%s, %s)', {native, romanized, english}}, -- 14 - native (romanized, english)
{'<5p4n>%s (%s, %s
}
Line 319:
local group = args.group;
local ref_name = args.ref_name
local lead = require ('
if not (native or romanized) then -- not present, return an error message
Line 329:
end
if romanized then
romanized = (lead and (cfg[template].system_link .. ': ') or '') .. lang_module.
end
Line 335:
{'%s', {extra}}, -- 1 - extra
{'%s', {romanized}}, -- 2 - romanized
{'%s
{'%s', {native}}, -- 4 - native
{'%s
{'%s, %s', {native, romanized}}, -- 6 - native romanized
{'%s, %s
-- 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
{'%s
{'%s', {native}}, -- 12 - native
{'%s
{'%s, %s', {native, romanized}}, -- 14 - native romanized
{'%s, %s
}
Line 412:
<romaji>: Hepburn romanization (transliteration); TODO: in Module:Lang/data change tooltip text to 'Hepburn romanization'?
<extra> and <extra2> are positional or named: |extra= and |extra2=; mixing can be problematic
<extra> is rendered as presented
<extra2> is rendered as presented
]=]
Line 435:
<romaji>: Hepburn romanization (transliteration); TODO: in Module:Lang/data change tooltip text to 'Hepburn romanization'?
<extra> and <extra2> are positional or named: |extra= and |extra2=; mixing can be problematic
<extra> is rendered as presented
<extra2> is rendered as presented
]=]
Line 456:
<romaji>: Hepburn romanization (transliteration); TODO: in Module:Lang/data change tooltip text to 'Hepburn romanization'?
<extra> and <extra2> are positional or named: |extra= and |extra2=; mixing can be problematic
<extra> is rendered as presented
<extra2> is rendered as presented
<post> is positional or named: |post= is a postscript character preceding the <ref>..</ref> tag (after <English>)
|lead=: takes one value 'yes'; renders language name same as {{langx|ja}} but also adds [[Hepburn romanization|Hepburn]]:<space> ahead of the romanization;
|