Module:HeroData: Difference between revisions

Sur (talk | contribs)
m only call lang if not nil
Sur (talk | contribs)
mNo edit summary
Line 107: Line 107:
      
      
     -- Add the main parameters
     -- Add the main parameters
     template_args["name"] = lang_module.search_string(hero_name)
     template_args["name_english"] = hero_name
   
    template_args["name_localized"] = lang_module.search_string(hero_name)
      
      
     local wep_name = hero_data["WeaponName"]
     local wep_name = hero_data["WeaponName"]
     if (wep_name ~= nil) then template_args["weapon_name"] = lang_module.get_string(wep_name) end
     if (wep_name ~= nil) then template_args["weapon_name"] = lang_module._get_string(wep_name) end
      
      
     local wep_desc = hero_data["WeaponDescription"]
     local wep_desc = hero_data["WeaponDescription"]
     if (wep_desc ~= nil) then template_args["weapon_description"] = lang_module.get_string(wep_desc) end
     if (wep_desc ~= nil) then template_args["weapon_description"] = lang_module._get_string(wep_desc) end
      
      
     local role = hero_data["Role"]
     local role = hero_data["Role"]
     if (role ~= nil) then template_args["role"] = lang_module.get_string(role) end
     if (role ~= nil) then template_args["role"] = lang_module._get_string(role) end
      
      
     local playstyle = hero_data["Playstyle"]
     local playstyle = hero_data["Playstyle"]
     if (playstyle ~= nil) then template_args["playstyle"] = lang_module.get_string(playstyle) end
     if (playstyle ~= nil) then template_args["playstyle"] = lang_module._get_string(playstyle) end
      
      
     -- Iterate attribute categories
     -- Iterate attribute categories