Module:Abilities/utils: Difference between revisions

Jump to navigation Jump to search
m made ability_card_data accept hero_key
Sur (talk | contribs)
m get_notes_source_page_name moved from AbilityData/Hero
Line 65: Line 65:


return value_and_uom
return value_and_uom
end
function p.get_notes_source_page_name(ability_key)
local ability_name_en = ability_data["Name"]
local ability_name_localized = lang_module.get_string(ability_key)
local notes_str_localized = dictionary_module.translate('Notes', nil, '')
--Determine notes link
local notes_source_page
local notes_untranslated_msg = ''
-- if either "Notes" string or ability_name is not able to be localized,
-- use an english link instead, as transcluded content relies on it
if (ability_name_localized == '') or (notes_str_localized == '') then
notes_source_page = ability_name_en .. '/' .. dictionary_module.translate('Notes', 'en', '')
if notes_str_localized=='' then
notes_untranslated_msg = '<br>' .. dictionary_module.translate('NotesNeedsTranslation') .. ' [[Template:Translate]]' .. "<br>"
end
else
notes_source_page = ability_name_localized .. '/' .. notes_str_localized
end
notes_source_page = "User:Sur/" .. notes_source_page --temp
return notes_source_page
end
end


return p
return p