I think we will need a bit more. The space of Language Tags in LaTeX is
all over the place, Babel and Polyglossia alike.
Things like:
\foreignlanguage{farsi}
\begin{otherlanguage}{farsi} ...\end{otherlanguage}
\textpersian{}
\begin{persian} ... \end{persian}
will all have to be translated to the "almost" BCP-47 Language Tags used by Aspell,
which in this case is:
fa
I say "almost" because Aspell uses an underscore for dictionaries like "en_GB" instead
of the correct "en-GB", for British English.
The Polyglossia package already has this equivalence (Babel--Polyglossia--BCP-47) in
a table. We should use it. It is not easy to write it down.
Paulo Ney