When entering a phone number under Security, the country dropdown is in English. Expected: serve a translated list of countries.
Screenshot: the locale is set to FR and the rest of the interface is in French, but the country dropdown appears in English.
Still happening, testing with a locale set to Spanish:
Tested and confirmed using the following steps to reproduce:
Result: the list of countries is not translated
Seen at https://wordpress.com/me/account using Safari 9.1.1 on Mac OS X 10.11.5
Seen at https://wordpress.com/me/security/two-step using Safari 9.1.1 on Mac OS X 10.11.5
Seen at https://wordpress.com/me/account using Safari 9.1.1 on Mac OS X 10.11.5
Tried to give this one a go today but I've hit a wall.
For what I can see the getSmsSupportedCountries
functions in undocumented.js is the one responsible of fetching the list of countries, I though that including the locale in the request would return the translated country list but it looks like it doesn't:
this._sendRequestWithLocale( {
path: '/meta/sms-country-codes/',
method: 'get'
}, fn );
Makes a request to:
https://public-api.wordpress.com/rest/v1.1/meta/sms-country-codes/?http_envelope=1&locale=es
But it still returns the countries in english, does the api endpoint need a fix as well?
I was also curious to know why in '/me/account', countries are correctly localized.
I found that in this case the list is read from the configuration, source.
Another difference is that the api response includes countries which are not listed into the configuration.
If you'll inspect what happens behind the scenes via Network tab (Dev Tools), you will see that the list of countries is being fetched from the server:
Image Link: https://cloudup.com/c1Ap4JuN67U
I was able to recreate the bug as indicated above. I changed the interface language to French, Italian, Dutch, and Turkish. The result remained the same for each language with the country codes displaying only in English. In reviewing undocumented.js
, the function Undocumented.prototype.getSmsSupportedCountries
appears to be working properly. Perhaps the API endpoint could be updated to include other languages?
The patch for this is ready for review D10455-code.
With deployment of D10455-code, I'm now seeing the localized list from my end:
I'm closing this. If anything is still broken, please let me know.
Thanks, James! This was a longstanding issue.
Most helpful comment
With deployment of D10455-code, I'm now seeing the localized list from my end:

I'm closing this. If anything is still broken, please let me know.