Locales detection doesn't work properly in some cases
Description
Matching on country name sometimes returns empty data. Switching to country code seems like a better solution. Also we need to cover for the case if nothing is found so that it doesn't stuck at detection.