Module:zlw-opl-RQ-helper

local export = {}

local roman_numerals = require("Module:roman numerals")

function export.determine_location(frame) if mw.title.getCurrentTitle.nsText == "Template" then return end local template_name = frame.args[1] local volume = frame.args[2] local page_raw = frame.args[3] if volume == nil or page_raw == nil or page_raw == "" then return error("Please specify the volume and the page.") end local page = tonumber(page_raw) or roman_numerals.roman_to_arabic(page_raw) if page == nil then error("Could not convert page input '" .. page_raw .. "' to a number") end if template_name == "RQ:zlw-opl:AKH" then if volume == "III" then if page >= 45 and page <= 60 then return "Lublin" elseif page >= 119 and page <= 151 then return "Radom, Warsaw" elseif page >= 153 and page <= 269 then return "Kalisz" elseif page >= 271 and page <= 471 then return "Greater Poland" end elseif volume == "IV" then return "Kujavia, Masovia" elseif volume == "V" then if page >= 87 and page <= 193 then return "Krakow, Lublin" elseif page >= 219 and page <= 231 then return "Włocławek" elseif page >= 359 and page <= 436 then return "Przemyśl" end elseif volume == "VI" then if page >= 1 and page <= 76 then return "Krakow" elseif page >= 84 and page <= 126 then return "Płock" elseif page >= 157 and page <= 189 then return "Krakow, Płock" end elseif volume == "VIII" then if page >= 1 and page <= 290 then return "Krakow" elseif page >= 291 and page <= 377 then return "Krakow" end elseif volume == "IX" then return "Krakow" elseif volume == "XI" then if page >= 361 and page <= 391 then return "Masovia" elseif page >= 392 and page <= 465 then return "Krakow" elseif page >= 466 and page <= 526 then return "Krakow" end elseif volume == "XVI" then if page >= 365 and page <= 430 then return "Krakow" end end end if template_name == "RQ:zlw-opl:CatCodJag" then if volume == "II" then if page == 101 then return "Warta" elseif page == 153 then return "Pacanów" end elseif volume == "III" then if page == 101 then return "Warta" elseif page == 406 then return "Grabostaw" end elseif volume == "VII" then if page == 92 then return "Kobylin" elseif page == 229 then return "Słupca" end end end if template_name == "RQ:zlw-opl:GlKazB" then if volume == "I" then if page >= 1 and page <= 40 then return "Trzemeszno" elseif page >= 54 and page <= 1000 then return "Trzemeszno" end elseif volume == "II" then if page >= 5 and page <= 37 then return "Kęty" elseif page >= 39 and page <= 61 then return "Legnica" elseif page >= 78 and page <= 117 then return "Grochów, Kcynia" end elseif volume == "III" then if page >= 5 and page <= 66 then return "Dąbrówka Kujawska, Krakow" elseif page >= 75 and page <= 79 then return "Wolbórz" elseif page >= 84 and page <= 85 then return "Mysłowice, Wieliczka" elseif page == 101 and page <= 105 then return "Skalbmierz" end elseif volume == "IV" then if page >= 35 and page <= 40 then return "Koźmin Wielkopolski, Słupia" end end end if template_name == "RQ:zlw-opl:JA" then if volume == "III" then if page >= 479 and page <= 484 then return "Poznań, Kościan, Pyzdry" elseif page == 525 then return "Kościan" end elseif volume == "IV" then if page >= 87 and page <= 97 then return "Trzemeszno" end elseif volume == "X" then if page >= 376 and page <= 387 then return "Trzemeszno" elseif page == 386 then return "Błonie" elseif page == 389 then return "Krajków" end elseif volume == "XII" then if page >= 141 and page <= 145 then return "Murzynowo" elseif page >= 268 and page <= 275 then return "Poznań, Kościan, Kalisz, Sieradz, Piotrków Trybunalski, Dobryszyce" end elseif volume == "XIV" then if page >= 486 and page <= 496 then return "Miechów, Kruchowo" elseif page >= 498 and page <= 502 then return "Chruściechów, Sieciechów" elseif page >= 503 and page <= 504 then return "Iłża" elseif page == 506 then return "Sieciechów" elseif page >= 511 and page <= 512 then return "Kostrzyn" end end end if template_name == "RQ:zlw-opl:JP" then if volume == "XXXIII" then if page >= 381 and page <= 391 then return "Pyzdry" end elseif volume == "XXXVI" then if page >= 32 and page <= 35 then return "Warsaw" end elseif volume == "XXXVII" then if page >= 119 and page <= 124 then return "Poznań" elseif page >= 161 and page <= 173 then return "Poznań" end end end

if template_name == "RQ:zlw-opl:KwartHist" then if volume == "XXIV" then if page >= 528 and page <= 532 then return "Wiślica" elseif page == 533 and page <= 536 then return "Nowy Korczyn, Wiślica" end elseif volume == "XL" then if page == 193 then return "Grylewo" elseif page >= 194 and page <=195 then return "Gniezno" end elseif volume == "XLV" then return "Sieradz County" end end if template_name == "RQ:zlw-opl:MiesHer" then if volume == "II" then if page == 35 then return "Lublin" elseif page == 36 then return "Gniezno" elseif page >= 49 and page <= 51 then return "Przemyśl" elseif page >= 81 and page <= 86 then return "Chełm" end elseif volume == "VII" then if page >= 41 and page <= 51 then return "Szreńsk" elseif page >= 89 and page <= 95 then return "Szreńsk" end elseif volume == "X" then if page >= 168 and page <= 181 then return "Czersk, Masovian Voivodeship, Lublin" end elseif volume == "XI" then if page >= 1 and page <= 5 then return "Liw" elseif page >= 213 and page <= 215 then return "Krakow" end elseif volume == "XIV" then if page >= 111 and page <= 168 then return "Łęczyca Land" end end end if template_name == "RQ:zlw-opl:MPKJ" then if volume == "II" then if page >= 295 and page <= 309 then return "Radom, Sandomierz, Opoczno" elseif page >= 326 and page <= 327 then return "Brest" end end end if template_name == "RQ:zlw-opl:PamLit" then if volume == "XXVI" then if page >= 397 and page <= 398 then return "Kalisz" end end end if template_name == "RQ:zlw-opl:PF" then if volume == "I" then if page >= 207 and page <= 231 then return "Radom, Krakow" elseif page >= 467 and page <= 540 then return "Międzyrzecz, Warsaw" end elseif volume == "III" then if page >= 281 and page <= 295 then return "Wrocław" end elseif volume == "V" then if page == 13 then return "Malonowo" elseif page == 15 and page <= 16 then return "Dolsk" elseif page >= 35 then return "Kurów (Bochnia)" elseif page >= 38 and page <= 39 then return "Krakow" end elseif volume == "V" then if page >= 67 and page <= 70 then return "Giebło" elseif page == 78 then return "Gieski" elseif page == 79 then return "Pobiedziska" end elseif volume == "VIII" then if page >= 16 and page <= 20 then return "Chęciny" end end end if template_name == "RQ:zlw-opl:R" then if volume == "XIX" then if page >= 42 and page <= 43 then return "Przeworsk" elseif page >= 48 and page <= 64 then return "Nowa Słupia" end elseif volume == "XXII" then if page >= 6 and page <= 40 then return "Łęczyca" elseif page >= 41 and page <= 44 then return "Łęczyca" elseif page >= 44 and page <= 56 then return "Lublin" elseif page >= 343 and page <=347 then return "Koźmin Wielkopolski" end elseif volume == "XXIII" then if page >= 284 and page <= 290 then return "Pniewy" elseif page == 297 and page <= 298 then return "Sieradz" end elseif volume == "XXIV" then if page == 52 then return "Koźmin Wielkopolski" elseif page >= 59 and page <= 70 then return "Grochów, West Pomeranian Voivodeship, Kcynia" elseif page == 327 then return "Częstochowa" elseif page >= 349 and page <= 354 then return "Częstochowa" elseif page == 375 then return "Zakroczym" elseif page >= 349 and page <= 354 then return "Tyniec, Krakow" elseif page >= 349 and page <= 354 then return "Bodzęcin, Bodzęcin" end elseif volume == "XXV" then if page >= 124 and page <= 130 then return "Ruszcza" elseif page >= 134 and page <= 141 then return "Radom, Miłosław" elseif page >= 141 and page <= 149 then return "Zator, Lesser Poland Voivodeship" elseif page >= 197 and page <= 198 then return "Radom, Miłosław" elseif page >= 200 and page <= 201 then return "Radom, Miłosław" elseif page == 234 then return "Okurowo" elseif page == 276 then return "Mysłowice, Krakow" end elseif volume == "XLVII" then if page >= 349 and page <= 353 then return "Radom" end elseif volume == "XI" then if page >= 361 and page <= 391 then return "Masovia" elseif page >= 392 and page <= 465 then return "Krakow" elseif page >= 466 and page <= 526 then return "Krakow" end elseif volume == "XVI" then if page >= 365 and page <= 430 then return "Krakow" end elseif volume == "LIII" then if page >= 59 and page <= 138 then return "Krakow" end end end if template_name == "RQ:zlw-opl:RHist" then if volume == "XL" then if page >= 289 and page <= 411 then return "Lesser Poland" end elseif volume == "XLII" then if page >= 75 and page <= 286 then return "Lesser Poland" elseif page >= 333 and page <= 386 then return "Poznań, Kalisz" end end end if template_name == "RQ:zlw-opl:RocznHist" then if volume == "II" then if page >= 37 and page <= 91 then return "Nakło nad Notecią" elseif page >= 92 and page <= 129 then return "Poniec" end elseif volume == "IV 2" then if page >= 85 and page <= 119 then return "Borek Wielkopolski, Pleszew" elseif page >= 129 and page <= 130 then return "Poznań" end elseif volume == "VI" then if page >= 236 and page <= 238 then return "Kościan" end elseif volume == "XIV" then if page >= 319 and page <= 332 then return "Kcynia" end elseif volume == "XV" then if page >= 49 and page <= 82 then return "Pyzdry" elseif page >= 207 and page <= 249 then return "Pyzdry" end end end if template_name == "RQ:zlw-opl:RocznKrak" then if volume == "XIII" then if page >= 49 and page <= 109 then return "Krakow" elseif page >= 187 and page <= 250 then return "Nowy Sącz" end elseif volume == "XVI" then if page >= 1 and page <= 90 then return "Krakow" end end end if template_name == "RQ:zlw-opl:SKJ" then if volume == "I" then if page >= 1 and page <= 141 then return "Lviv" elseif page >= 144 and page <= 146 then return "Gniezno, Warsaw" end elseif volume == "III" then if page >= 185 and page <= 197 then return "Krakow, Czchów" elseif page >= 332 and page <= 349 then return "Krakow" elseif page >= 359 and page <= 436 then return "Przemyśl" end end end if template_name == "RQ:zlw-opl:SlOcc" then if volume == "XIII" then if page >= 129 and page <= 166 then return "Kościan, Zakroczym" end elseif volume == "XVII" then if page >= 197 and page <= 199 then return "Greater Poland" end elseif volume == "XXX" then if page >= 3 and page <= 57 then return "Poznań" end elseif volume == "XXXIV" then if page >= 159 and page <= 170 then return "Gniezno, Warsaw" end elseif volume == "LIX" then if page >= 6 and page <= 255 then return "Miłosław" end end end if template_name == "RQ:zlw-opl:SprKHS" then if volume == "IV" then if page >= 64 and page <= 79 then return "Krakow" end elseif volume == "V" then return "Krakow" elseif volume == "VIII" then return "Masovia" end end if template_name == "RQ:zlw-opl:StPPP" then if volume == "II" then if page >= 35 and page <= 958 then return "Krakow" end elseif volume == "V" then return "Poznań" elseif volume == "VII" then if page >= 275 and page <= 627 then return "Krakow" end elseif volume == "IX" then return "Krajowice" end end end return export