Module:HeroData: Difference between revisions

Sur (talk | contribs)
m write_role_playstyle_quote initial
Sur (talk | contribs)
m write_infobox now uses hero_key instead of hero_name
Line 199: Line 199:
p.write_infobox = function(frame)
p.write_infobox = function(frame)
-- Get hero data
-- Get hero data
     hero_name = frame.args[1]
     hero_key = frame.args[1]
     hero_data = p.get_json_item(hero_name)
     hero_data = heroes_data[hero_key]
     if(hero_data == nil) then return "Hero Not Found" end
     if(hero_data == nil) then return "Hero " .. hero_key .. " Not Found" end
      
      
     local infobox_attributes = {
     local infobox_attributes = {
Line 224: Line 224:
      
      
     -- Add the main parameters
     -- Add the main parameters
     template_args["name_english"] = hero_name
     template_args["name_english"] = lang_module.get_string(hero_key, 'en')
    local hero_key = p.get_hero_key(hero_name)
     template_args["name_localized"] = localize(hero_key, hero_key)
     template_args["name_localized"] = localize(hero_key, hero_key)