imtoori/CountryCodePicker

Country name wrong

ShalikaAshan01 opened this issue · 8 comments

śrī laṃkāva(LK, +94) is the wrong spelling. It should be changed to Sri Lanka.

Basically, the country names should be shown in the currently selected locale, not the native locale of the country (which is ambiguous anyway, when thinking of say Switzerland.

libPhonenumber might be the way to go for that if it gives. you enough info:

Code from stack overflow, not flutter:

Set<String> set = PhoneNumberUtil.getInstance().getSupportedRegions();

String[] arr = set.toArray(new String[set.size()]);

for (int i = 0; i < arr.size(); i++) {
    Locale locale = new Locale("en", arr[i]);
    Log.d(TAG, "lib country:" + arr[i] + "  "+ locale.getDisplayCountry());
}

See https://javadoc.io/doc/com.googlecode.libphonenumber/libphonenumber/8.8.11/index.html which is the one library to use when it comes to phone numbers on the internet. There are flutter bindings for it.

Hey, I just updated the library using a localizations delegate
Check out the example :)

Anyway at the moment I added only English, Italian and France
But I'll add some other it when I have some time for this mechanic process of copy-pasting

Thank you:)

I just want the country names to show in English only but it is showing in different-2 languages for the countries. Can you please tell me, how can I do that? Even if the device locale is en, then also it is showing languages as per the country languages which I don't want. Please help;

@mayankbhaisora did you follow this part of the readme?

Which part?