I was using a similar function in past. Unfortunately, I don't have access to the code right now, so I can't post it. It is definitely handy to have an utility functions that tells you what languages are available, since the translations of U++ usually don't cover all the texts in ones app and vice versa.
I vote for inclusion of something like that, it would make my life easier too