From d974be317e4d23205e9d1a9bb2d1d555a9985e91 Mon Sep 17 00:00:00 2001 From: Nusrath Khan Date: Fri, 7 Jul 2017 14:57:31 +0200 Subject: [PATCH] Added South African (SA) Locale --- Readme.md | 1 + lib/locales.js | 1 + lib/locales/en_ZA/address/city.js | 3 + lib/locales/en_ZA/address/city_prefix.js | 16 + lib/locales/en_ZA/address/default_country.js | 5 + lib/locales/en_ZA/address/index.js | 7 + lib/locales/en_ZA/address/postcode.js | 3 + lib/locales/en_ZA/address/state.js | 11 + lib/locales/en_ZA/cell_phone/formats.js | 14 + lib/locales/en_ZA/cell_phone/index.js | 3 + lib/locales/en_ZA/index.js | 8 + lib/locales/en_ZA/internet/domain_suffix.js | 6 + lib/locales/en_ZA/internet/index.js | 3 + lib/locales/en_ZA/name/first_name.js | 10 + lib/locales/en_ZA/name/index.js | 5 + lib/locales/en_ZA/name/last_name.js | 9 + lib/locales/en_ZA/name/name.js | 4 + lib/locales/en_ZA/phone_number/area_code.js | 40 +++ .../en_ZA/phone_number/exchange_code.js | 285 ++++++++++++++++++ lib/locales/en_ZA/phone_number/formats.js | 5 + lib/locales/en_ZA/phone_number/index.js | 5 + locale/en_ZA.js | 5 + 22 files changed, 449 insertions(+) create mode 100644 lib/locales/en_ZA/address/city.js create mode 100644 lib/locales/en_ZA/address/city_prefix.js create mode 100644 lib/locales/en_ZA/address/default_country.js create mode 100644 lib/locales/en_ZA/address/index.js create mode 100644 lib/locales/en_ZA/address/postcode.js create mode 100644 lib/locales/en_ZA/address/state.js create mode 100644 lib/locales/en_ZA/cell_phone/formats.js create mode 100644 lib/locales/en_ZA/cell_phone/index.js create mode 100644 lib/locales/en_ZA/index.js create mode 100644 lib/locales/en_ZA/internet/domain_suffix.js create mode 100644 lib/locales/en_ZA/internet/index.js create mode 100644 lib/locales/en_ZA/name/first_name.js create mode 100644 lib/locales/en_ZA/name/index.js create mode 100644 lib/locales/en_ZA/name/last_name.js create mode 100644 lib/locales/en_ZA/name/name.js create mode 100644 lib/locales/en_ZA/phone_number/area_code.js create mode 100644 lib/locales/en_ZA/phone_number/exchange_code.js create mode 100644 lib/locales/en_ZA/phone_number/formats.js create mode 100644 lib/locales/en_ZA/phone_number/index.js create mode 100644 locale/en_ZA.js diff --git a/Readme.md b/Readme.md index fc23abe54..ce87c0df3 100644 --- a/Readme.md +++ b/Readme.md @@ -254,6 +254,7 @@ faker.locale = "de"; * en_IE * en_IND * en_US + * en_ZA * en_au_ocker * es * es_MX diff --git a/lib/locales.js b/lib/locales.js index 8ff2d0253..dcd4a1c29 100644 --- a/lib/locales.js +++ b/lib/locales.js @@ -11,6 +11,7 @@ exports['en_GB'] = require('./locales/en_GB'); exports['en_IE'] = require('./locales/en_IE'); exports['en_IND'] = require('./locales/en_IND'); exports['en_US'] = require('./locales/en_US'); +exports['en_ZA'] = require('./locales/en_ZA'); exports['en_au_ocker'] = require('./locales/en_au_ocker'); exports['es'] = require('./locales/es'); exports['es_MX'] = require('./locales/es_MX'); diff --git a/lib/locales/en_ZA/address/city.js b/lib/locales/en_ZA/address/city.js new file mode 100644 index 000000000..f014e1565 --- /dev/null +++ b/lib/locales/en_ZA/address/city.js @@ -0,0 +1,3 @@ +module["exports"] = [ + "#{city_prefix}" +]; diff --git a/lib/locales/en_ZA/address/city_prefix.js b/lib/locales/en_ZA/address/city_prefix.js new file mode 100644 index 000000000..9b52e83dd --- /dev/null +++ b/lib/locales/en_ZA/address/city_prefix.js @@ -0,0 +1,16 @@ +module["exports"] = [ + "Polokwane", + "Johannesburg", + "Pretoria", + "Tshwane", + "Durban", + "Pietermaritzburg", + "Nelspruit", + "Cape Town", + "Stellenbosch", + "Port Elizabeth", + "East London", + "Kimberley", + "Rustenburg", + "Bloemfontein " +]; diff --git a/lib/locales/en_ZA/address/default_country.js b/lib/locales/en_ZA/address/default_country.js new file mode 100644 index 000000000..209d810d1 --- /dev/null +++ b/lib/locales/en_ZA/address/default_country.js @@ -0,0 +1,5 @@ +module["exports"] = [ + "South Africa", + "The Republic of South Africa", + "SA" +]; diff --git a/lib/locales/en_ZA/address/index.js b/lib/locales/en_ZA/address/index.js new file mode 100644 index 000000000..04d128ec5 --- /dev/null +++ b/lib/locales/en_ZA/address/index.js @@ -0,0 +1,7 @@ +var address = {}; +module['exports'] = address; +address.city = require("./city"); +address.city_prefix = require("./city_prefix"); +address.default_country = require("./default_country"); +address.postcode = require("./postcode"); +address.state = require("./state"); \ No newline at end of file diff --git a/lib/locales/en_ZA/address/postcode.js b/lib/locales/en_ZA/address/postcode.js new file mode 100644 index 000000000..5053d539e --- /dev/null +++ b/lib/locales/en_ZA/address/postcode.js @@ -0,0 +1,3 @@ +module["exports"] = [ + "####" +]; diff --git a/lib/locales/en_ZA/address/state.js b/lib/locales/en_ZA/address/state.js new file mode 100644 index 000000000..6d5bcecf8 --- /dev/null +++ b/lib/locales/en_ZA/address/state.js @@ -0,0 +1,11 @@ +module["exports"] = [ + "Limpopo", + "Gauteng", + "Free State,", + "North West", + "Northern Cape", + "Western Cape,", + "KwaZulu-Natal", + "Mpumalanga", + "Eastern Cape" +]; diff --git a/lib/locales/en_ZA/cell_phone/formats.js b/lib/locales/en_ZA/cell_phone/formats.js new file mode 100644 index 000000000..bb3eb29da --- /dev/null +++ b/lib/locales/en_ZA/cell_phone/formats.js @@ -0,0 +1,14 @@ +module["exports"] = [ + "+2760 ### ####", + "+2761 ### ####", + "+2763 ### ####", + "+2772 ### ####", + "+2773 ### ####", + "+2774 ### ####", + "+2776 ### ####", + "+2779 ### ####", + "+2781 ### ####", + "+2782 ### ####", + "+2783 ### ####", + "+2784 ### ####" +]; diff --git a/lib/locales/en_ZA/cell_phone/index.js b/lib/locales/en_ZA/cell_phone/index.js new file mode 100644 index 000000000..8de997ba3 --- /dev/null +++ b/lib/locales/en_ZA/cell_phone/index.js @@ -0,0 +1,3 @@ +var cell_phone = {}; +module['exports'] = cell_phone; +cell_phone.formats = require("./formats"); diff --git a/lib/locales/en_ZA/index.js b/lib/locales/en_ZA/index.js new file mode 100644 index 000000000..11831e52b --- /dev/null +++ b/lib/locales/en_ZA/index.js @@ -0,0 +1,8 @@ +var en_ZA = {}; +module['exports'] = en_ZA; +en_ZA.title = "South Africa (English)"; +en_ZA.address = require("./address"); +en_ZA.internet = require("./internet"); +en_ZA.name = require("./name"); +en_ZA.phone_number = require("./phone_number"); +en_ZA.cell_phone = require("./cell_phone"); diff --git a/lib/locales/en_ZA/internet/domain_suffix.js b/lib/locales/en_ZA/internet/domain_suffix.js new file mode 100644 index 000000000..4ce65d40a --- /dev/null +++ b/lib/locales/en_ZA/internet/domain_suffix.js @@ -0,0 +1,6 @@ +module["exports"] = [ + "net.za", + "org.za", + "co.za", + "com" +] \ No newline at end of file diff --git a/lib/locales/en_ZA/internet/index.js b/lib/locales/en_ZA/internet/index.js new file mode 100644 index 000000000..abfa24801 --- /dev/null +++ b/lib/locales/en_ZA/internet/index.js @@ -0,0 +1,3 @@ +var internet = {}; +module['exports'] = internet; +internet.domain_suffix = require("./domain_suffix"); diff --git a/lib/locales/en_ZA/name/first_name.js b/lib/locales/en_ZA/name/first_name.js new file mode 100644 index 000000000..595b807f8 --- /dev/null +++ b/lib/locales/en_ZA/name/first_name.js @@ -0,0 +1,10 @@ +module["exports"] = [ + "Rapulane", + "Nthabiseng", + "Kopano", + "Mpho", + "Lungelo", + "Ziyanda", + "Nqobile", + "Monde" +]; diff --git a/lib/locales/en_ZA/name/index.js b/lib/locales/en_ZA/name/index.js new file mode 100644 index 000000000..27b846ac1 --- /dev/null +++ b/lib/locales/en_ZA/name/index.js @@ -0,0 +1,5 @@ +var name = {}; +module['exports'] = name; +name.first_name = require("./first_name"); +name.last_name = require("./last_name"); +name.name = require("./name"); diff --git a/lib/locales/en_ZA/name/last_name.js b/lib/locales/en_ZA/name/last_name.js new file mode 100644 index 000000000..ee2574898 --- /dev/null +++ b/lib/locales/en_ZA/name/last_name.js @@ -0,0 +1,9 @@ +module["exports"] = [ + "Dlamini", + "Zulu", + "Mabunda", + "Makhanya", + "Khoza", + "Zuma", + "Zondi" +]; diff --git a/lib/locales/en_ZA/name/name.js b/lib/locales/en_ZA/name/name.js new file mode 100644 index 000000000..5734174b4 --- /dev/null +++ b/lib/locales/en_ZA/name/name.js @@ -0,0 +1,4 @@ +module["exports"] = [ + "#{first_name} #{last_name}", + "#{last_name} #{first_name}" +]; diff --git a/lib/locales/en_ZA/phone_number/area_code.js b/lib/locales/en_ZA/phone_number/area_code.js new file mode 100644 index 000000000..0da149d1e --- /dev/null +++ b/lib/locales/en_ZA/phone_number/area_code.js @@ -0,0 +1,40 @@ +module["exports"] = [ + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "21", + "22", + "23", + "24", + "27", + "28", + "31", + "32", + "33", + "34", + "35", + "36", + "39", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "51", + "53", + "54", + "56", + "57", + "58" +]; diff --git a/lib/locales/en_ZA/phone_number/exchange_code.js b/lib/locales/en_ZA/phone_number/exchange_code.js new file mode 100644 index 000000000..b201c79a8 --- /dev/null +++ b/lib/locales/en_ZA/phone_number/exchange_code.js @@ -0,0 +1,285 @@ +module["exports"] = [ + "201", + "202", + "203", + "205", + "206", + "207", + "208", + "209", + "210", + "212", + "213", + "214", + "215", + "216", + "217", + "218", + "219", + "224", + "225", + "227", + "228", + "229", + "231", + "234", + "239", + "240", + "248", + "251", + "252", + "253", + "254", + "256", + "260", + "262", + "267", + "269", + "270", + "276", + "281", + "283", + "301", + "302", + "303", + "304", + "305", + "307", + "308", + "309", + "310", + "312", + "313", + "314", + "315", + "316", + "317", + "318", + "319", + "320", + "321", + "323", + "330", + "331", + "334", + "336", + "337", + "339", + "347", + "351", + "352", + "360", + "361", + "386", + "401", + "402", + "404", + "405", + "406", + "407", + "408", + "409", + "410", + "412", + "413", + "414", + "415", + "417", + "419", + "423", + "424", + "425", + "434", + "435", + "440", + "443", + "445", + "464", + "469", + "470", + "475", + "478", + "479", + "480", + "484", + "501", + "502", + "503", + "504", + "505", + "507", + "508", + "509", + "510", + "512", + "513", + "515", + "516", + "517", + "518", + "520", + "530", + "540", + "541", + "551", + "557", + "559", + "561", + "562", + "563", + "564", + "567", + "570", + "571", + "573", + "574", + "580", + "585", + "586", + "601", + "602", + "603", + "605", + "606", + "607", + "608", + "609", + "610", + "612", + "614", + "615", + "616", + "617", + "618", + "619", + "620", + "623", + "626", + "630", + "631", + "636", + "641", + "646", + "650", + "651", + "660", + "661", + "662", + "667", + "678", + "682", + "701", + "702", + "703", + "704", + "706", + "707", + "708", + "712", + "713", + "714", + "715", + "716", + "717", + "718", + "719", + "720", + "724", + "727", + "731", + "732", + "734", + "737", + "740", + "754", + "757", + "760", + "763", + "765", + "770", + "772", + "773", + "774", + "775", + "781", + "785", + "786", + "801", + "802", + "803", + "804", + "805", + "806", + "808", + "810", + "812", + "813", + "814", + "815", + "816", + "817", + "818", + "828", + "830", + "831", + "832", + "835", + "843", + "845", + "847", + "848", + "850", + "856", + "857", + "858", + "859", + "860", + "862", + "863", + "864", + "865", + "870", + "872", + "878", + "901", + "903", + "904", + "906", + "907", + "908", + "909", + "910", + "912", + "913", + "914", + "915", + "916", + "917", + "918", + "919", + "920", + "925", + "928", + "931", + "936", + "937", + "940", + "941", + "947", + "949", + "952", + "954", + "956", + "959", + "970", + "971", + "972", + "973", + "975", + "978", + "979", + "980", + "984", + "985", + "989" +]; diff --git a/lib/locales/en_ZA/phone_number/formats.js b/lib/locales/en_ZA/phone_number/formats.js new file mode 100644 index 000000000..2f7120ea0 --- /dev/null +++ b/lib/locales/en_ZA/phone_number/formats.js @@ -0,0 +1,5 @@ +module["exports"] = [ + "(0##) ### ####", + "0## ### ####", + "+27 ## ### ####" +]; diff --git a/lib/locales/en_ZA/phone_number/index.js b/lib/locales/en_ZA/phone_number/index.js new file mode 100644 index 000000000..06ee1b9aa --- /dev/null +++ b/lib/locales/en_ZA/phone_number/index.js @@ -0,0 +1,5 @@ +var phone_number = {}; +module['exports'] = phone_number; +phone_number.area_code = require("./area_code"); +phone_number.exchange_code = require("./exchange_code"); +phone_number.formats = require("./formats"); diff --git a/locale/en_ZA.js b/locale/en_ZA.js new file mode 100644 index 000000000..dad4c7d12 --- /dev/null +++ b/locale/en_ZA.js @@ -0,0 +1,5 @@ +var Faker = require('../lib'); +var faker = new Faker({ locale: 'en_ZA', localeFallback: 'en' }); +faker.locales['en_ZA'] = require('../lib/locales/en_ZA'); +faker.locales['en'] = require('../lib/locales/en'); +module['exports'] = faker;