To detect a user's language by country, you can use the PolyLang extension, Polylang – Country Detection. Even if your website has 2 different locales with the same language, the extension will set the correct dialect automatically from your browser settings.