We should migrate UserProfile.language to be a ForeignKey to the Language model, for consistency. This involves changing all the code that refers to UserProfile.
For efficiency, it probably makes sense to make Language.code a primary key, however, this is fiddly with migrations, as the backwards migration will be difficult to write.
I've started working on this one (in a local branch for now). Made the field migrations, but still need to port across all the code that uses the language attribute. Noting this here so that Matt doesn't start accidentally working on it.
Change all code to use Profile.language_pref. Closed by 01fee78.
Anything that used to be indexed from a language code is now indexed
from a Language.id value (sometimes written as