make locale retrieval work when locale not in default PATH