Set locale lazily if it isn't set when formats are used.