GithubHelp home page GithubHelp logo

umpirsky / country-list Goto Github PK

View Code? Open in Web Editor NEW
5.1K 5.1K 1.5K 55.87 MB

:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.

License: MIT License

PHP 38.66% HTML 61.34%

country-list's Introduction

symfony upgrade fixertwig gettext extractorwisdomcentipedepermissions handlerextraloadgravatarlocurrocountry listtransliterator

Country List

List of all countries with names and ISO 3166-1 codes in all languages and all data formats.

Install

composer require umpirsky/country-list

Formats Available

  • Text
  • JSON
  • YAML
  • XML
  • HTML
  • CSV
  • SQL
    • MySQL
    • PostgreSQL
    • SQLite
  • PHP
  • XLIFF

If you intend to use the package with PHP see this.

Multilingual

All formats are also available in multiple languages, please find full language list here.

Build

Country list is available out of the box, but if you want to submit patches, add new formats, update data source or contribute in any other way, you will probably want to rebuild the list:

$ docker-compose run php /var/www/html/bin/build -v

If you need to install composer, get it from https://getcomposer.org/ installation instructions can be found here: https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx

Other Interesting Lists

country-list's People

Contributors

blankse avatar eberhm avatar hrubymar10 avatar israelortuno avatar koppi avatar n-sviridenko avatar ostrolucky avatar romedius avatar spekulatius avatar trainmaster avatar umpirsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

country-list's Issues

[Proposal] One file with each country it its own language

Fx.

If I had chosen russia, I would not be able to find my own country again.

So I would say it would be nice to have 1 file, with each country it is own language.

Fx
Germany = Deutschland
Mexico = Mexicanos
Denmark = Danmark
Russia = Российская

maybe put it in country/general/country.*

Error while building

Hi,

I get the following error while building it

 [Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException]  
  The Symfony\Component\Intl\Collator\Collator::__construct() method's argume    
  nt $locale value 'af' behavior is not implemented. Only the locale "en" is     
  supported.  Please install the "intl" extension for full localization capab    
  ilities.

No idea what it means.

composer PHP requirements fails on PHP7

In your composer file you are using ~5.4, which causes composer to fail when using PHP7. I assume there is not reason that the package should not be used on PHP7? If not I suggest to change to >=5.4

Error when running composer:

umpirsky/country-list dev-master requires php ~5.4 -> your PHP version (7.0.2) does not satisfy that requirement

Class 'Locale' not found

$ ./console build

Fatal error: Class 'Locale' not found in /home/gadelat/tmp/country-list/vendor/symfony/locale/Symfony/Component/Locale/Locale.php on line 15

PHP 7

This should work perfectly with PHP 7, but it it's composer.json says
"php": "~5.4"

What about updating this?

Watch out USSR in the list!

Union of Soviet Socialist Republics... you are kidding!

Thanks for snippet but after this (USSR) I will need to check each country if it is not a joke.

SQL Server unicode literals

SQL Server literals require an N before the unicode text.

Wrong:

INSERT INTO [country] ([id], [name]) VALUES ('AW', 'آروبا');

Correct:

INSERT INTO [country] ([id], [name]) VALUES ('AW', N'آروبا');

Add alpha-3 listing to output

In addition to the alpha-2 listing for each country it would be nice to also have the alpha-3 listing.

This would be useful for drop-down lists using something like Select2 that allows for filtering.

How do I load the json file

Hi could you please add to the readme file how we call one of the country databases please, as I have loaded it into my composer script but don't know how I fetch it

Using this package in PHP/Composer

I'm not sure how this is supposed to be used with Composer. I don't think there is a reliable way to get the location (directory) of the data.

The simplest way around this is with an auto-loaded class that can return the directory the data is located. Would you accept a PR with this addition?

Edit: See my fork.

Missing countries for French language

Hello,
there are 4 missing countries in French version

BQ => Bonaire, Saint-Eustache et Saba
CW => Curaçao
SS => Sud Soudan
SX => Sint Maarten

Thanks

update

Can this list be updated according to UN memebership?

As these are correctly recognised as a country.

Adding country codes as well.

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.

Tag a release in master branch

I have written a library that depends on country-list through composer and packagist. Now because there is no tagged release of country-list all projects that depend on my library must add "minimum-stability": "dev" to their composer.json.

Adding a tag would solve this for me. Hope it's not to much trubble...

Lost several countries for Russian language

List of countries:

<?php return array(
  'BQ' => 'Британская антарктическая территория',
  'CT' => 'Кантон и Эндербери',
  'NQ' => 'Земля Королевы Мод',
  'DD' => 'Германская Демократическая Республика',
  'FQ' => 'Французские Южные и Антарктические территории',
  'JT' => 'Джонстон',
  'FX' => 'Метрополия Франции',
  'MI' => 'Мидуэй',
  'NT' => 'Нейтральная зона (саудовско-иракская)',
  'VD' => 'Демократическая Республика Вьетнам',
  'PC' => 'Подопечная территория Тихоокеанские острова',
  'PZ' => 'Зона Панамского канала',
  'YD' => 'Народная Демократическая Республика Йемен',
  'PU' => 'Малые отдаленные острова Соединенных Штатов',
  'SU' => 'СССР',
  'WK' => 'Уэйк',
);

make it available for npm

It is a great job, you should make it available for npm, a lot of people would apreciate and use it.

"Macedonia" : no such country

zh-CN vs zh_CN?

My locale for Chinese is: zh-CN and your folder name is: zh_CN.

Any ideas on which is the best way to address this?

What I am getting is:
Unable to load the country data file "/home/vagrant/development/engine/vendor/umpirsky/country-list/country/cldr/zh-CN/country.php"

How is one supposed to use it?

How is one supposed to use it?
Do I just include php file with countries manually?
Is there any kind of public access class?

This is certainly not a correct way?:

$countriesFile = realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'umpirsky' . DIRECTORY_SEPARATOR . 'country-list' . DIRECTORY_SEPARATOR . 'country' . DIRECTORY_SEPARATOR . 'cldr' . DIRECTORY_SEPARATOR . 'en_US' . DIRECTORY_SEPARATOR . 'country.php');
$countries = include($countriesFile);

"East Germany"

Please remove "East Germany" from the list. It's not a country, it's a part of Germany.

Errors in cldr/seh and cldr/seh_MZ

Today I noticed that there are several errors in the files for the Sena language: cldr/seh and cldr/seh_MZ (the files in both folders are identical): A lot of names are associated with the wrong country codes. I went through the list and even though I don't know Sena, I was able to identify those names as obviously wrong:

    (Name in Sana)         (Name in English)
AE  Reino Unido            United Arab Emirates
GB  Uruguai                United Kingdom
TC  Tuvalu                 Turks and Caicos Islands
TG  Tokelau                Togo
TH  Togo                   Thailand
TK  Tonga                  Tokelau
TM  Ilhas Turks e Caicos   Turkmenistan
TN  Turquia                Tunisia
TO  Trinidad e Tobago      Tonga
TR  Turcomenistão          Turkey
TT  Tunísia                Trinidad and Tobago
TV  Ilhas Virgens dos EUA  Tuvalu
TZ  Tailândia              Tanzania
UA  Emirados Árabes Unidos Ukraine
UG  Ucrânia                Uganda
US  Uzbequistão            United States
UY  Estados Unidos         Uruguay
UZ  Vanuatu                Uzbekistan
VA  Venezuela              Vatican City
VE  Vietnã                 Venezuela
VI  Uganda                 U.S. Virgin Islands
VN  Wallis e Futuna        Vietnam
VU  Vaticano               Vanuatu
WF  Iêmen                  Wallis and Futuna
YE  Zâmbia                 Yemen
ZM  Zimbábue               Zambia

Name Order of the countries

Actually instead of ordering according to the abbreviation it would be better to order them according to the full name, in locals. Because when the user looks them, they look unordered.

Convert require to suggest in composer.json

I think the country-list should not have any requirements in composer.json.

If I don't want to build anything and just use a csv or yml file, I don't need zend, doctrine and symfony...

You can split the dependency between suggest and require-dev array in composer.

Add a license in README

Hi, I didn't found the the license explanation at your README file. I just found it on your composer file. Can you add your MIT license explanation on it? maybe just some enhancement to make us more clearly to understand. Thank you.

Missing `CC` country code

I was folding this repo against the Unicode CLDR data and noticed that I could not convert the CLDR file en_CC.xml to a locale name using this repository: CC is not a recognized country code.

It appears that CC is intended to be Cocos Islands.

I'm submitting this as an issue rather than a pull request because I'm not sure how to go about getting translations for "Cocos Islands" into all languages supported by this repository.

JSON is kind of useless unless it has proper key/values

With JS frameworks, and more generally REST APIs/HTTP requests, the current JSON structures are not much help, since we can't programmatically target keys.

How about this structure?

[
    { 
        id: 'AF', 
        value:'Afghanistan' 
    },
    {
        id: 'ZA', 
        value:'Afrique du Sud' 
    },
...
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.