It suffices to properly choose and trickily chain hooks.
(add-hook 'text-mode-hook #'flyspell-mode)
(add-hook 'flyspell-mode-hook #'flyspell-local-vars)
(defun flyspell-local-vars ()
(add-hook 'hack-local-variables-hook #'flyspell-buffer))
text-mode-hook: executed by text major-modes hooks like those of all TeX variants, e.g. latex-mode-hook.
Since I didn't often change my ispell dictionary interactively/manually, (I love to use local variable a lot) e.g:
-*- mode: Org; ispell-local-dictionary: "id"; -*- ;; in org buffers
%%% ispell-local-dictionary: "id" ;; in tex buffers
Manuel Uberti's code didn't help me because it's not aware of internal language change caused by ispell.
So I add the ...
I have something in my configuration that may be of help. Since I write both in English and Italian, I want Flyspell to check the spelling for the current language of the buffer. So I like to see in the mode-line if Flyspell is set on the correct language, and I want to be able to change the language when I need.
This is what I have in my configuration:
There is the org-log-buffer-setup-hook hook which is run after the log buffer is created. Here's a function that jumps to the other window, collects the language and sets it in the log buffer.
(other-window 1 nil)
(setq dict ispell-local-dictionary)
I avoid installing MSYS on Windows 10 because one can download Ubuntu from the MS store and use ispell and emacs inside the Ubuntu application (sudo apt-get install ispell).
You have still access to the Windows files under the mount point /mnt/c.