Skip to content

Commit

Permalink
Add minimal list of Language names by alpha-2 code
Browse files Browse the repository at this point in the history
  • Loading branch information
dmythro committed Jul 16, 2017
1 parent 19fd01f commit 3baa63d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dist/minimal/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Countries: minimal size data
# Countries & Languages: minimal size files

This directory contains simplified data for each list,
converting `Object` with fields to `Array` with fields in predefined order to decrease the file size (and traffic).
Expand All @@ -12,7 +12,11 @@ Example: `{"UA":"Ukraine"}`
Example: `{"UA":["Ukraine","Україна","380","EU","Kyiv","UAH",["uk"]]}`
(`name`, `native`, `phone`, `continent`, `capital`, `currency`, `languages`).

## Languages ~6KB
## Language names (English) by **ISO 639-1 alpha-2** code ~2KB

Example: `{"uk":"Ukrainian"}`

## Languages ~4KB

Example: `{"uk":["Ukrainian","Українська",0]}`
(`name`, `native`, `rtl`).
1 change: 1 addition & 0 deletions dist/minimal/languages.en.min.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"af":"Afrikaans","am":"Amharic","ar":"Arabic","ay":"Aymara","az":"Azerbaijani","be":"Belarusian","bg":"Bulgarian","bi":"Bislama","bn":"Bengali","bs":"Bosnian","ca":"Catalan","ch":"Chamorro","cs":"Czech","da":"Danish","de":"German","dv":"Divehi","dz":"Dzongkha","el":"Greek","en":"English","es":"Spanish","et":"Estonian","eu":"Basque","fa":"Persian","ff":"Peul","fi":"Finnish","fj":"Fijian","fo":"Faroese","fr":"French","ga":"Irish","gl":"Galician","gn":"Guarani","gv":"Manx","he":"Hebrew","hi":"Hindi","hr":"Croatian","ht":"Haitian","hu":"Hungarian","hy":"Armenian","id":"Indonesian","is":"Icelandic","it":"Italian","ja":"Japanese","ka":"Georgian","kg":"Kongo","kk":"Kazakh","kl":"Greenlandic","km":"Cambodian","ko":"Korean","ku":"Kurdish","ky":"Kirghiz","la":"Latin","lb":"Luxembourgish","ln":"Lingala","lo":"Laotian","lt":"Lithuanian","lv":"Latvian","mg":"Malagasy","mh":"Marshallese","mi":"Maori","mk":"Macedonian","mn":"Mongolian","ms":"Malay","mt":"Maltese","my":"Burmese","na":"Nauruan","nd":"North Ndebele","ne":"Nepali","nl":"Dutch","nn":"Norwegian Nynorsk","no":"Norwegian","nr":"South Ndebele","ny":"Chichewa","oc":"Occitan","pa":"Panjabi / Punjabi","pl":"Polish","ps":"Pashto","pt":"Portuguese","qu":"Quechua","rn":"Kirundi","ro":"Romanian","ru":"Russian","rw":"Rwandi","sg":"Sango","si":"Sinhalese","sk":"Slovak","sl":"Slovenian","sm":"Samoan","sn":"Shona","so":"Somalia","sq":"Albanian","sr":"Serbian","ss":"Swati","st":"Southern Sotho","sv":"Swedish","sw":"Swahili","ta":"Tamil","tg":"Tajik","th":"Thai","ti":"Tigrinya","tk":"Turkmen","tn":"Tswana","to":"Tonga","tr":"Turkish","ts":"Tsonga","uk":"Ukrainian","ur":"Urdu","uz":"Uzbek","ve":"Venda","vi":"Vietnamese","xh":"Xhosa","zh":"Chinese","zu":"Zulu"}
7 changes: 7 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ gulp.task(DO_MINIMAL, function (callback) {
});
fs.writeFileSync(`${DIST}${DO_MINIMAL}/${COUNTRIES}.${DO_MINIMAL}.${DO_MIN}.${JSON_EXT}`, JSON.stringify(minCountries) + LF);

// Languages: each item is a String language name in English
const minLanguageNames = {};
Object.keys(languagesInUse).forEach(code => {
minLanguageNames[code] = languagesInUse[code].name;
});
fs.writeFileSync(`${DIST}${DO_MINIMAL}/${LANGUAGES}.en.${DO_MIN}.${JSON_EXT}`, JSON.stringify(minLanguageNames) + LF);

// Languages: each item is an Array of fields in order
const minLanguages = {};
Object.keys(languagesInUse).forEach(code => {
Expand Down

0 comments on commit 3baa63d

Please sign in to comment.