Модуль:CargoConverter: различия между версиями
Lord (обсуждение | вклад) Нет описания правки |
Lord (обсуждение | вклад) Нет описания правки |
||
| Строка 256: | Строка 256: | ||
local short_name = data[1] | local short_name = data[1] | ||
local full_name = data[2] or short_name | local full_name = data[2] or short_name | ||
local conf_num = data[3] | local conf_num = data[3] | ||
local cases = data[4] or {} | local cases = data[4] or {} | ||
local name_gen = cases.gen or full_name | local name_gen = cases.gen or full_name | ||
local name_loc = cases.loc or full_name | local name_loc = cases.loc or full_name | ||
local twc = data.twc | local twc = data.twc | ||
table.insert(out, string.format("{{TWC_Teams|Code=%s|ShortName=%s|FullName=%s|Confederation=%s|NameGen=%s|NameLoc=%s|IsActive=%s}}", | table.insert(out, string.format("{{TWC_Teams|Code=%s|ShortName=%s|FullName=%s|Confederation=%s|NameGen=%s|NameLoc=%s|IsActive=%s}}", | ||
| Строка 270: | Строка 270: | ||
-- ========================================================= | -- ========================================================= | ||
-- 4. КОНВЕРТЕР СПРАВОЧНИКА ТУРНИРОВ (в TWC_Tournaments) | -- 4. КОНВЕРТЕР СПРАВОЧНИКА ТУРНИРОВ (в TWC_Tournaments) — ИСПРАВЛЕНО | ||
-- ========================================================= | -- ========================================================= | ||
function p.runTournamentsList(frame) | function p.runTournamentsList(frame) | ||
| Строка 314: | Строка 314: | ||
local yr = tournaments[tourn_id] | local yr = tournaments[tourn_id] | ||
-- | -- Используем Unicode-совместимый mw.ustring.match вместо string.match! | ||
local prefix, parsed_yr, t_type = | local prefix, parsed_yr, t_type = mw.ustring.match(tourn_id, "^(%a+)_*(%d+)_*(%a+)") | ||
local display_name = tourn_id -- фоллбэк | local display_name = tourn_id -- фоллбэк | ||