s/language/lang/; factor out lang_pair splitting and joining into separate functions