Module:Nihongo: Difference between revisions

Content deleted Content added
+yesno;
remove ambiguous references to "_transl"
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 paranthesisparenthesis
 
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._transl_xlit() so is not wrapped in parentheses
 
]]
Line 125:
end
 
local romanized_text = romanized:gsub ('%b<>', ''):gsub ('\'\'+', ''):gsub ('%[%[', ''):gsub ('%]%]', ''); -- strip htmlHTML tags
 
romanized = romanized:gsub ('([%(%)%.%%%+%-%*%?%[%^%$%]])', '%%%1'); -- escape lua pattern characters
Line 177:
end
if romanized then
romanized = (lead and english and (cfg[template].system_link .. ': ') or '') .. lang_module._transl_xlit ({'ja', cfg[template].system, romanized, ['template']=template}) or nil;
end
 
Line 227:
end
native = native and lang_module._lang ({cfg[template].tag, native, ['template']=template}) or nil;
romanized = romanized and lang_module._transl_xlit ({cfg[template].tag, cfg[template].system, romanized, ['template']=template}) or nil;
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
Line 273:
end
native = native and lang_module._lang ({cfg[template].tag, native, ['template']=template}) or nil;
romanized = romanized and lang_module._transl_xlit ({cfg[template].tag, cfg[template].system, romanized, ['template']=template}) or nil;
local formatting = { -- <5p4n> and </5p4n>: place holders for font-weight style spans; akin to stripmarkers, replaced before function returns
Line 329:
end
if romanized then
romanized = (lead and (cfg[template].system_link .. ': ') or '') .. lang_module._transl_xlit ({'ja', cfg[template].system, romanized, ['template']=template}) or nil;
end
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 preceededpreceded with <comma><space>
<extra2> is rendered as presented preceededpreceded with <space>
 
]=]
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 preceededpreceded with <comma><space>
<extra2> is rendered as presented preceededpreceded with <space>
 
]=]
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 preceededpreceded with <comma><space>
<extra2> is rendered as presented preceededpreceded with <space>
<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;