Determine page language by URL instead of categories

only posts have categories, therefore the previous method fails for other pages