Module:AbilityData/hero: Difference between revisions

Sur (talk | contribs)
m tab content now includes ability card
Sur (talk | contribs)
m notes warning added
Line 24: Line 24:
local notes_str_localized = dictionary_module.translate('Notes', nil, '')
local notes_str_localized = dictionary_module.translate('Notes', nil, '')
local tab_name = "|-|(" .. ability_num .. ") " .. ability_name_en .. "="
local tab_name = "|-|(" .. ability_num .. ") " .. ability_name_en .. "="
--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 = dictionary_module.translate('NotesNeedsTranslation') .. ' [[Template:Translation]]' .. "<br>"
end
else
notes_source_page = ability_name_localized .. '/' .. notes_str_localized
end
notes_source_page = "User:Sur/" .. notes_source_page --temp
--Determine tab content
--Determine tab content
Line 29: Line 44:
'TranscludedNotesFrom',  
'TranscludedNotesFrom',  
'https://en.wikipedia.org/wiki/Help:Transclusion',  
'https://en.wikipedia.org/wiki/Help:Transclusion',  
'[[User:Sur/'..ability_name_localized..'/'..notes_str_localized..']]',  
'[['..notes_source_page..']]',  
'https://deadlocked.wiki/index.php?title=User:Sur/'..util_module.url_encode(ability_name_localized)..'/'..notes_str_localized..'&action=edit'
'https://deadlocked.wiki/index.php?title='..util_module.url_encode(notes_source_page)..'&action=edit'
) .. "</i>\n"
) .. "</i><br>" .. notes_untranslated_msg
local tab_content = tab_content .. ability_module.get_ability_card_from_key(
local tab_content = tab_content .. ability_module.get_ability_card_from_key(
Line 37: Line 52:
ability_num,  
ability_num,  
'true',
'true',
'{{User:Sur/'..ability_name_localized..'/'..notes_str_localized..'}}'
'{{'..notes_source_page..'}}'
)
)