Модуль:GetField: различия между версиями
Pok (обсуждение | вклад) Отмена версии 199244, сделанной Pok (обсуждение) Метка: отмена |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
local p = {} | local p = {} | ||
local lang = mw.language.getContentLanguage() | |||
local JsonPaths = require('Module:JsonPaths') | local JsonPaths = require('Module:JsonPaths') | ||
| Строка 363: | Строка 364: | ||
local templatePath = tplPath | local templatePath = tplPath | ||
if project ~= nil and project ~= "" then | if project ~= nil and project ~= "" then | ||
templatePath = project .. ":" .. tplPath | templatePath = project .. ":" .. lang:ucfirst(tplPath) | ||
templatePath = "{{#ifexist:Шаблон:" .. templatePath .. "|" .. templatePath .. "|" .. tplPath .. "}}" | templatePath = "{{#ifexist:Шаблон:" .. templatePath .. "|" .. templatePath .. "|" .. tplPath .. "}}" | ||
end | end | ||
local tplStr = "{{" .. templatePath .. "|id=" .. tostring(id) | local tplStr = "{{Шаблон:" .. templatePath .. "|id=" .. tostring(id) | ||
if extra ~= "" then | if extra ~= "" then | ||
tplStr = tplStr .. "|" .. extra | tplStr = tplStr .. "|" .. extra | ||
| Строка 858: | Строка 859: | ||
local projectPath = nil | local projectPath = nil | ||
if project ~= nil and project ~= "" then | if project ~= nil and project ~= "" then | ||
projectPath = project .. ":" .. tplPath | projectPath = project .. ":" .. lang:ucfirst(tplPath) | ||
end | end | ||
local function makeTemplatePrefix() | local function makeTemplatePrefix() | ||
if projectPath then | if projectPath then | ||
return "{{{{#ifexist:Шаблон:" .. projectPath .. "|" .. projectPath .. "|" .. tplPath .. "}}" | return "{{Шаблон:{{#ifexist:Шаблон:" .. projectPath .. "|" .. projectPath .. "|" .. tplPath .. "}}" | ||
end | end | ||