refactor(views): move error translation to its own method