Fixed locale detection. Used Babel standartized tools