Add system locale detection and remove some redundant code