I can't test this, as I don't have multiple dictionaries on hand. But it should get you started if it doesn't work completely (to be added to your .emacs):
;; replace the language names and dictionary paths below to suit your setup:
'(("danish" . "path-to-my-danish-dictionary")
("english" . "path-to-my-english-dictionary"))
"An alist of dictionaries to pick from")
(defun polyglossia-check ()
"If polyglossia is loaded, sets the dictionary to the value in my-dicts
corresponding to the value of setdefaultlanguage or setmainlanguage."
(= (shell-command (concat "grep polyglossia " default-directory
(let ((lang (buffer-substring (point) (mark))))
(setq ispell-local-dictionary (cdr (assoc lang my-dicts)))))))
(add-hook 'TeX-auto-cleanup-hook 'polyglossia-check)
The hook will run the whenever your document is parsed. I'm not sure how often this happens. If it doesn't seem to work, try calling
M-x polyglossia-check explicitly.