Code optimization for setting locale.
Merge remote-tracking branch 'origin/master'