move page language determination into localisation function

to ensure no prior setup is necessary
Open URL generation: fix incorrect checks for medium
Open URL generation: use jtitle if available

(and remove it again for ZDB-JOP as their server doesn’t like it)