umpirsky / country-list

:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.
MIT License
5.16k stars 1.55k forks source link

Adding country codes as well. #18

Closed openrijal closed 8 years ago

openrijal commented 11 years ago

This is a very good resource. It can be used for Registration forms and other purposes. It would be very good, if the country calling codes could be as well added to this list.

Moreover, a string-array format for Android XML would be very good as well.

umpirsky commented 11 years ago

Hey, thanks for your feedback.

I will keep this list simple, so, no additional data except country codes and names. But we can run separate project for calling codes.

I will add string-array format for Android XML ;)

umpirsky commented 11 years ago

What is better:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="countries">
<item iso="AF">Afghanistan</item>
<item iso="AL">Albania</item>
</string-array>
</resources>

or:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="AF">Afghanistan</string>
   <string name="AL">Albania</string>
</resources>

?

Because with 2nd format, you can directly access country by iso code, right?

openrijal commented 11 years ago

I guess the first one is better to use.

GitTom commented 11 years ago

Android resource XML would be great! Not sure which of two options is better, but you have a point that the 2nd format is probably more efficient. With the first format the whole array must be loaded just to get one string.

Perhaps, for format#2, you could prefix the resource names to prevent name clash, e.g use name="cc_AF" rather than just "AF".