Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 11: Строка 11:


     local foundData = nil
     local foundData = nil
     for _, item in ipairs(accentData) do
     for _, item in ipairs(accentData) do
         if item.id == targetId then
         if item.id == targetId then
Строка 24: Строка 23:


     local output = {}
     local output = {}
table.insert(output, '{| class="sortable-grid sortable-grid--small-column sortable"')
    table.insert(output, '{| class="sortable-grid sortable-grid--small-column sortable"')
table.insert(output, '! Сортировка (по алфавиту)')
    table.insert(output, '! Сортировка (по алфавиту)')
table.insert(output, '|-')
    table.insert(output, '|-')


     for key, value in pairs(foundData.wordReplacements) do
     for key, value in pairs(foundData.wordReplacements) do
         table.insert(output, "|")
         table.insert(output, "|")
         table.insert(output, frame:preprocess(string.format("{{Cut-Layout|arrow=1|background-color=var(--bg-color-message-subtle)|{{#invoke:Ftl|main|translation|%s}}|{{#invoke:Ftl|main|translation|%s}}}}", key, value)))
         table.insert(
            output,
            frame:preprocess(
                string.format(
                    "{{Cut-Layout|arrow=1|background-color=var(--bg-color-message-subtle)|{{#invoke:Ftl|main|translation|%s}}|{{#invoke:Ftl|main|translation|%s}}}}",
                    key,
                    value
                )
            )
        )
         table.insert(output, "|-")
         table.insert(output, "|-")
     end
     end


table.insert(output, '|}')
    table.insert(output, '|}')
 
     return table.concat(output, "\n")
     return table.concat(output, "\n")
end
end


return p
return p