Module:Sandbox/Vergir: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Probe: avoid next() on mw.loadJsonData tables (with help from vergir-bot LLM) |
Probe: candidate localization keys for table headers (with help from vergir-bot LLM) |
||
| Line 1: | Line 1: | ||
-- TEMPORARY probe | -- TEMPORARY probe: check which localization keys exist for table headers. | ||
-- {{#invoke:Sandbox/Vergir|headers}} | |||
-- {{#invoke:Sandbox/Vergir| | |||
local p = {} | local p = {} | ||
local lang_module = require('Module:Lang') | local lang_module = require('Module:Lang') | ||
local dictionary_module = require('Module:Dictionary') | local dictionary_module = require('Module:Dictionary') | ||
local LANG_KEYS = { | |||
'Hero', 'hero', 'Scaling', 'Stat', 'Stats', | |||
'StatDesc_Hero', 'citadel_hero', 'Citadel_Hero', | |||
'StatCategory_Weapon', 'StatDesc_Scaling', 'SpiritScaling', | |||
'StatDesc_TechPower', 'TechPower_label', | |||
} | |||
local | local DICT_KEYS = { 'Hero', 'Heroes', 'Stat', 'Stats', 'Scaling', 'Spirit Power' } | ||
function p. | function p.headers(frame) | ||
local out = {} | local out = {'Module:Lang lookups:'} | ||
for _, key in ipairs(LANG_KEYS) do | |||
table.insert(out, '* <code>' .. key .. '</code> → "' .. | |||
for _, | tostring(lang_module.get_string(key)) .. '"') | ||
end | end | ||
table.insert(out, '') | table.insert(out, '') | ||
table.insert(out, ' | table.insert(out, 'Module:Dictionary lookups:') | ||
for _, | for _, key in ipairs(DICT_KEYS) do | ||
table.insert(out, '* <code>' .. key .. '</code> → "' .. | |||
tostring(dictionary_module.translate(key)) .. '"') | |||
table.insert(out, '* <code>' .. | |||
tostring( | |||
end | end | ||
table.insert(out, '') | |||
table.insert(out, 'search_string("Hero") → "' .. | |||
tostring(lang_module._search_string('Hero')) .. '"') | |||
return table.concat(out, '\n') | return table.concat(out, '\n') | ||
end | end | ||
return p | return p | ||