Changes

Ja Name hack
Line 16: Line 16:     
     local row1 = '<tr>' .. Cards .. '<th style="text-align: center;">' .. shipNum .. '</th>' .. Banners .. '</tr>'
 
     local row1 = '<tr>' .. Cards .. '<th style="text-align: center;">' .. shipNum .. '</th>' .. Banners .. '</tr>'
     local JaName = '<ruby lang="ja" xml:lang="ja"><rb>' .. shipmodule.data[shipNum]["name"][1] .. '</rb><rp> (</rp><rt>' .. shipmodule.data[shipNum]["name"][2] .. '</rt><rp>) </rp></ruby>'
+
 
 +
     local kanji, form
 +
local baseName = mw.ustring.find(shipmodule.data["name"][1], "")
 +
if baseName == nil then
 +
kanji = shipmodule.data["name"][1]
 +
form = ""
 +
else
 +
kanji = mw.ustring.sub(ship.Name.Ja, 1, baseName - 1)
 +
form = mw.ustring.sub(ship.Name.Ja, baseName , -1)
 +
end
 +
local JaName = frame:expandTemplate{ title = 'ruby-ja', args = { kanji , shipmodule.data["name"][2] } } .. form
    
     local row2 = '<tr><th colspan="2">' .. JaName .. '</th><th colspan="2">' .. shipmodule.data[shipNum]["name"][3] .. '</th></tr>'
 
     local row2 = '<tr><th colspan="2">' .. JaName .. '</th><th colspan="2">' .. shipmodule.data[shipNum]["name"][3] .. '</th></tr>'
5,421

edits