Skip to content

drPavka/cldr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Task:

Write a command-line tool to parse CLDR [1] data and for a given language, print the languages of the world, ordered by number of speakers. For each language, trint the abbreviation of the language, the language name in English and the estimated number of speakers according to CLDR: et Estonian 1234567 fi Finnish 7654321 Hint: you only need the supplementalData.xml file [2] for the calculations. You may use a library that wraps CLDR.

#Setup:

  • Install composer
  • Run composer install --no-autoloader
  • Run ./cldr.php

#Comments: I'm using composer only for PHP version and php libraries validation. No need to use 3rd party console lib.
get_languages_from not always determine languages' names correctly. As a variant we can use DOM functions instead of SimpleXML and use DOMComment object to get language names from comments in file. But IMHO it will look ugly.

About

hometask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages