abstract out the translation loading code for tests