I'm not going to pretend this is a beautiful script, but it's good enough for basic validation of language files.