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 "[[w:Lublin|Lublin]]"
elseif page >= 119 and page <= 151 then
return "[[w:Radom|Radom]], [[w:Warsaw|Warsaw]]"
elseif page >= 153 and page <= 269 then
return "[[w:Kalisz|Kalisz]]"
elseif page >= 271 and page <= 471 then
return "[[w:Greater Poland|Greater Poland]]"
end
elseif volume == "IV" then
return "[[w:Kujavia|Kujavia]], [[w:Masovia|Masovia]]"
elseif volume == "V" then
if page >= 87 and page <= 193 then
return "[[w:Krakow|Krakow]], [[w:Lublin|Lublin]]"
elseif page >= 219 and page <= 231 then
return "[[w:Włocławek|Włocławek]]"
elseif page >= 359 and page <= 436 then
return "[[w:Przemyśl|Przemyśl]]"
end
elseif volume == "VI" then
if page >= 1 and page <= 76 then
return "[[w:Krakow|Krakow]]"
elseif page >= 84 and page <= 126 then
return "[[w:Płock|Płock]]"
elseif page >= 157 and page <= 189 then
return "[[w:Krakow|Krakow]], [[w:Płock|Płock]]"
end
elseif volume == "VIII" then
if page >= 1 and page <= 290 then
return "[[w:Krakow|Krakow]]"
elseif page >= 291 and page <= 377 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "IX" then
return "[[w:Krakow|Krakow]]"
elseif volume == "XI" then
if page >= 361 and page <= 391 then
return "[[w:Masovia|Masovia]]"
elseif page >= 392 and page <= 465 then
return "[[w:Krakow|Krakow]]"
elseif page >= 466 and page <= 526 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "XVI" then
if page >= 365 and page <= 430 then
return "[[w:Krakow|Krakow]]"
end
end
end
if template_name == "RQ:zlw-opl:CatCodJag" then
if volume == "II" then
if page == 101 then
return "[[w:Warta|Warta]]"
elseif page == 153 then
return "[[w:Pacanów|Pacanów]]"
end
elseif volume == "III" then
if page == 101 then
return "[[w:Warta|Warta]]"
elseif page == 406 then
return "[[w:pl:Grabostaw|Grabostaw]]"
end
elseif volume == "VII" then
if page == 92 then
return "[[w:Kobylin|Kobylin]]"
elseif page == 229 then
return "[[w:Słupca|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 "[[w:Trzemeszno|Trzemeszno]]"
elseif page >= 54 and page <= 1000 then
return "[[w:Trzemeszno|Trzemeszno]]"
end
elseif volume == "II" then
if page >= 5 and page <= 37 then
return "[[w:Kęty|Kęty]]"
elseif page >= 39 and page <= 61 then
return "[[w:Legnica|Legnica]]"
elseif page >= 78 and page <= 117 then
return "[[w:Grochów, West Pomeranian Voivodeship|Grochów]], [[w:Kcynia|Kcynia]]"
end
elseif volume == "III" then
if page >= 5 and page <= 66 then
return "[[w:Dąbrówka Kujawska|Dąbrówka Kujawska]], [[w:Krakow|Krakow]]"
elseif page >= 75 and page <= 79 then
return "[[w:Wolbórz|Wolbórz]]"
elseif page >= 84 and page <= 85 then
return "[[w:Mysłowice|Mysłowice]], [[w:Wieliczka|Wieliczka]]"
elseif page == 101 and page <= 105 then
return "[[w:Skalbmierz|Skalbmierz]]"
end
elseif volume == "IV" then
if page >= 35 and page <= 40 then
return "[[w:Koźmin Wielkopolski|Koźmin Wielkopolski]], [[w:Słupia, Greater Poland Voivodeship|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 "[[w:Poznań|Poznań]], [[w:Kościan|Kościan]], [[w:Pyzdry|Pyzdry]]"
elseif page == 525 then
return "[[w:Kościan|Kościan]]"
end
elseif volume == "IV" then
if page >= 87 and page <= 97 then
return "[[w:Trzemeszno|Trzemeszno]]"
end
elseif volume == "X" then
if page >= 376 and page <= 387 then
return "[[w:Trzemeszno|Trzemeszno]]"
elseif page == 386 then
return "[[w:Błonie|Błonie]]"
elseif page == 389 then
return "[[w:Krajków, Lower Silesian Voivodeship|Krajków]]"
end
elseif volume == "XII" then
if page >= 141 and page <= 145 then
return "[[w:Murzynowo, Pomeranian Voivodeship|Murzynowo]]"
elseif page >= 268 and page <= 275 then
return "[[w:Poznań|Poznań]], [[w:Kościan|Kościan]], [[w:Kalisz|Kalisz]], [[w:Sieradz|Sieradz]], [[w:Piotrków Trybunalski]], [[w:Dobryszyce|Dobryszyce]]"
end
elseif volume == "XIV" then
if page >= 486 and page <= 496 then
return "[[w:Miechów|Miechów]], [[w:Kruchowo|Kruchowo]]"
elseif page >= 498 and page <= 502 then
return "[[w:Chruściechów, Masovian Voivodeship|Chruściechów]], [[w:Sieciechów, Masovian Voivodeship|Sieciechów]]"
elseif page >= 503 and page <= 504 then
return "[[w:Iłża|Iłża]]"
elseif page == 506 then
return "[[w:Sieciechów, Masovian Voivodeship|Sieciechów]]"
elseif page >= 511 and page <= 512 then
return "[[w:Kostrzyn, Greater Poland Voivodeship|Kostrzyn]]"
end
end
end
if template_name == "RQ:zlw-opl:JP" then
if volume == "XXXIII" then
if page >= 381 and page <= 391 then
return "[[w:Pyzdry|Pyzdry]]"
end
elseif volume == "XXXVI" then
if page >= 32 and page <= 35 then
return "[[w:Warsaw|Warsaw]]"
end
elseif volume == "XXXVII" then
if page >= 119 and page <= 124 then
return "[[w:Poznań|Poznań]]"
elseif page >= 161 and page <= 173 then
return "[[w:Poznań|Poznań]]"
end
end
end
if template_name == "RQ:zlw-opl:KwartHist" then
if volume == "XXIV" then
if page >= 528 and page <= 532 then
return "[[w:Wiślica|Wiślica]]"
elseif page == 533 and page <= 536 then
return "[[w:Nowy Korczyn]], [[w:Wiślica|Wiślica]]"
end
elseif volume == "XL" then
if page == 193 then
return "[[w:Grylewo|Grylewo]]"
elseif page >= 194 and page <=195 then
return "[[w:Gniezno]]"
end
elseif volume == "XLV" then
return "[[w:Sieradz County|Sieradz County]]"
end
end
if template_name == "RQ:zlw-opl:MiesHer" then
if volume == "II" then
if page == 35 then
return "[[w:Lublin|Lublin]]"
elseif page == 36 then
return "[[w:Gniezno|Gniezno]]"
elseif page >= 49 and page <= 51 then
return "[[w:Przemyśl|Przemyśl]]"
elseif page >= 81 and page <= 86 then
return "[[w:Chełm|Chełm]]"
end
elseif volume == "VII" then
if page >= 41 and page <= 51 then
return "[[w:Szreńsk|Szreńsk]]"
elseif page >= 89 and page <= 95 then
return "[[w:Szreńsk|Szreńsk]]"
end
elseif volume == "X" then
if page >= 168 and page <= 181 then
return "[[w:Czersk, Masovian Voivodeship|Czersk, Masovian Voivodeship]], [[w:Lublin|Lublin]]"
end
elseif volume == "XI" then
if page >= 1 and page <= 5 then
return "[[w:Liw, Poland|Liw]]"
elseif page >= 213 and page <= 215 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "XIV" then
if page >= 111 and page <= 168 then
return "[[w:Łęczyca Land|Łę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 "[[w:Radom|Radom]], [[w:Sandomierz|Sandomierz]], [[w:Opoczno|Opoczno]]"
elseif page >= 326 and page <= 327 then
return "[[w:Brest, Belarus|Brest]]"
end
end
end
if template_name == "RQ:zlw-opl:PamLit" then
if volume == "XXVI" then
if page >= 397 and page <= 398 then
return "[[w:Kalisz|Kalisz]]"
end
end
end
if template_name == "RQ:zlw-opl:PF" then
if volume == "I" then
if page >= 207 and page <= 231 then
return "[[w:Radom|Radom]], [[w:Krakow|Krakow]]"
elseif page >= 467 and page <= 540 then
return "[[w:Międzyrzecz|Międzyrzecz]], [[w:Warsaw|Warsaw]]"
end
elseif volume == "III" then
if page >= 281 and page <= 295 then
return "[[w:Wrocław|Wrocław]]"
end
elseif volume == "V" then
if page == 13 then
return "[[w:Malonowo|Malonowo]]"
elseif page == 15 and page <= 16 then
return "[[w:Dolsk|Dolsk]]"
elseif page >= 35 then
return "[[w:Bochnia|Kurów (Bochnia)]]"
elseif page >= 38 and page <= 39 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "V" then
if page >= 67 and page <= 70 then
return "[[w:Giebło|Giebło]]"
elseif page == 78 then
return "[[w:Gieski|Gieski]]"
elseif page == 79 then
return "[[w:Pobiedziska|Pobiedziska]]"
end
elseif volume == "VIII" then
if page >= 16 and page <= 20 then
return "[[w:Chęciny|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 "[[w:Przeworsk|Przeworsk]]"
elseif page >= 48 and page <= 64 then
return "[[w:Nowa Słupia|Nowa Słupia]]"
end
elseif volume == "XXII" then
if page >= 6 and page <= 40 then
return "[[w:Łęczyca|Łęczyca]]"
elseif page >= 41 and page <= 44 then
return "[[w:Łęczyca|Łęczyca]]"
elseif page >= 44 and page <= 56 then
return "[[w:Lublin|Lublin]]"
elseif page >= 343 and page <=347 then
return "[[w:Koźmin Wielkopolski]]"
end
elseif volume == "XXIII" then
if page >= 284 and page <= 290 then
return "[[w:Pniewy|Pniewy]]"
elseif page == 297 and page <= 298 then
return "[[w:Sieradz|Sieradz]]"
end
elseif volume == "XXIV" then
if page == 52 then
return "[[w:Koźmin Wielkopolski|Koźmin Wielkopolski]]"
elseif page >= 59 and page <= 70 then
return "[[w:Grochów, West Pomeranian Voivodeship|Grochów, West Pomeranian Voivodeship]], [[w:Kcynia|Kcynia]]"
elseif page == 327 then
return "[[w:Częstochowa|Częstochowa]]"
elseif page >= 349 and page <= 354 then
return "[[w:Częstochowa|Częstochowa]]"
elseif page == 375 then
return "[[w:Zakroczym|Zakroczym]]"
elseif page >= 349 and page <= 354 then
return "[[w:Tyniec]], [[w:Krakow]]"
elseif page >= 349 and page <= 354 then
return "[[w:Bodzęcin]], [[w:Bodzęcin]]"
end
elseif volume == "XXV" then
if page >= 124 and page <= 130 then
return "[[w:Ruszcza|Ruszcza]]"
elseif page >= 134 and page <= 141 then
return "[[w:Radom|Radom]], [[w:Miłosław|Miłosław]]"
elseif page >= 141 and page <= 149 then
return "[[w:Zator, Lesser Poland Voivodeship|Zator, Lesser Poland Voivodeship]]"
elseif page >= 197 and page <= 198 then
return "[[w:Radom|Radom]], [[w:Miłosław|Miłosław]]"
elseif page >= 200 and page <= 201 then
return "[[w:Radom|Radom]], [[w:Miłosław|Miłosław]]"
elseif page == 234 then
return "[[w:Okurowo|Okurowo]]"
elseif page == 276 then
return "[[w:Mysłowice|Mysłowice]], [[w:Krakow|Krakow]]"
end
elseif volume == "XLVII" then
if page >= 349 and page <= 353 then
return "[[w:Radom|Radom]]"
end
elseif volume == "XI" then
if page >= 361 and page <= 391 then
return "[[w:Masovia|Masovia]]"
elseif page >= 392 and page <= 465 then
return "[[w:Krakow|Krakow]]"
elseif page >= 466 and page <= 526 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "XVI" then
if page >= 365 and page <= 430 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "LIII" then
if page >= 59 and page <= 138 then
return "[[w:Krakow|Krakow]]"
end
end
end
if template_name == "RQ:zlw-opl:RHist" then
if volume == "XL" then
if page >= 289 and page <= 411 then
return "[[w:Lesser Poland|Lesser Poland]]"
end
elseif volume == "XLII" then
if page >= 75 and page <= 286 then
return "[[w:Lesser Poland|Lesser Poland]]"
elseif page >= 333 and page <= 386 then
return "[[w:Poznań|Poznań]], [[w:Kalisz|Kalisz]]"
end
end
end
if template_name == "RQ:zlw-opl:RocznHist" then
if volume == "II" then
if page >= 37 and page <= 91 then
return "[[w:Nakło nad Notecią|Nakło nad Notecią]]"
elseif page >= 92 and page <= 129 then
return "[[w:Poniec|Poniec]]"
end
elseif volume == "IV 2" then
if page >= 85 and page <= 119 then
return "[[w:Borek Wielkopolski|Borek Wielkopolski]], [[w:Pleszew|Pleszew]]"
elseif page >= 129 and page <= 130 then
return "[[w:Poznań|Poznań]]"
end
elseif volume == "VI" then
if page >= 236 and page <= 238 then
return "[[w:Kościan]]"
end
elseif volume == "XIV" then
if page >= 319 and page <= 332 then
return "[[w:Kcynia|Kcynia]]"
end
elseif volume == "XV" then
if page >= 49 and page <= 82 then
return "[[w:Pyzdry|Pyzdry]]"
elseif page >= 207 and page <= 249 then
return "[[w:Pyzdry|Pyzdry]]"
end
end
end
if template_name == "RQ:zlw-opl:RocznKrak" then
if volume == "XIII" then
if page >= 49 and page <= 109 then
return "[[w:Krakow|Krakow]]"
elseif page >= 187 and page <= 250 then
return "[[w:Nowy Sącz|Nowy Sącz]]"
end
elseif volume == "XVI" then
if page >= 1 and page <= 90 then
return "[[w:Krakow|Krakow]]"
end
end
end
if template_name == "RQ:zlw-opl:SKJ" then
if volume == "I" then
if page >= 1 and page <= 141 then
return "[[w:Lviv|Lviv]]"
elseif page >= 144 and page <= 146 then
return "[[w:Gniezno|Gniezno]], [[w:Warsaw|Warsaw]]"
end
elseif volume == "III" then
if page >= 185 and page <= 197 then
return "[[w:Krakow|Krakow]], [[w:Czchów|Czchów]]"
elseif page >= 332 and page <= 349 then
return "[[w:Krakow|Krakow]]"
elseif page >= 359 and page <= 436 then
return "[[w:Przemyśl|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 "[[w:Kościan|Kościan]], [[w:Zakroczym|Zakroczym]]"
end
elseif volume == "XVII" then
if page >= 197 and page <= 199 then
return "[[w:Greater Poland|Greater Poland]]"
end
elseif volume == "XXX" then
if page >= 3 and page <= 57 then
return "[[w:Poznań|Poznań]]"
end
elseif volume == "XXXIV" then
if page >= 159 and page <= 170 then
return "[[w:Gniezno|Gniezno]], [[w:Warsaw|Warsaw]]"
end
elseif volume == "LIX" then
if page >= 6 and page <= 255 then
return "[[w:Miłosław|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 "[[w:Krakow|Krakow]]"
end
elseif volume == "V" then
return "[[w:Krakow|Krakow]]"
elseif volume == "VIII" then
return "[[w:Masovia|Masovia]]"
end
end
if template_name == "RQ:zlw-opl:StPPP" then
if volume == "II" then
if page >= 35 and page <= 958 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "V" then
return "[[w:Poznań|Poznań]]"
elseif volume == "VII" then
if page >= 275 and page <= 627 then
return "[[w:Krakow|Krakow]]"
end
elseif volume == "IX" then
return "[[w:Krajowice|Krajowice]]"
end
end
end
return export