mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-23 00:39:47 +01:00
Merge pull request #139 from jflefebvre/master
New provider for fr_BE locale
This commit is contained in:
commit
fac6c177c8
91
src/Faker/Provider/fr_BE/Address.php
Normal file
91
src/Faker/Provider/fr_BE/Address.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_BE;
|
||||
|
||||
class Address extends \Faker\Provider\Address
|
||||
{
|
||||
protected static $postcode = array('####');
|
||||
|
||||
protected static $streetAddressFormats = array(
|
||||
'{{streetName}} {{buildingNumber}}'
|
||||
);
|
||||
|
||||
protected static $streetNameFormats = array('{{streetSuffix}} {{lastName}}');
|
||||
|
||||
protected static $cityFormats = array('{{cityName}}');
|
||||
|
||||
protected static $addressFormats = array(
|
||||
"{{streetAddress}}\n {{postcode}} {{city}}",
|
||||
);
|
||||
|
||||
protected static $streetSuffix = array(
|
||||
'rue', 'avenue', 'boulevard', 'chemin', 'chaussée'
|
||||
);
|
||||
|
||||
/**
|
||||
* Source: http://fr.wikipedia.org/wiki/Ville_de_Belgique
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $cityNames = array(
|
||||
'Aarschot','Alost (Aalst)','Andenne','Antoing','Anvers (Antwerpen)','Arlon','Ath','Audenarde (Oudenaarde)','Bastogne','Beaumont','Beauraing','Beringen','Bilzen','Binche',
|
||||
'Blankenberge','Bouillon','Braine-le-Comte','Bree','Bruges (Brugge)','Bruxelles','Charleroi','Châtelet','Chièvres','Chimay','Chiny','Ciney','Comines-Warneton','Courtrai (Kortrijk)',
|
||||
'Couvin','Damme','Deinze','Diest','Dilsen-Stokkem','Dinant','Dixmude (Diksmuide)','Durbuy','Eeklo','Enghien','Eupen','Fleurus','Florenville','Fontaine-l\'Évêque','Fosses-la-Ville',
|
||||
'Furnes (Veurne)','Gand (Gent)','Geel','Gembloux','Genappe','Genk','Gistel','Grammont (Geraardsbergen)','Hal (Halle)','Halen','Hamont-Achel','Hannut','Harelbeke','Hasselt',
|
||||
'Herck-la-Ville (Herk-de-Stad)','Herentals','Herstal','Herve','Hoogstraten','Houffalize','Huy','Izegem','Jodoigne','La Louvière','La Roche-en-Ardenne','Landen','Léau (Zoutleeuw)',
|
||||
'Le Rœulx','Lessines','Leuze-en-Hainaut','Liège','Lierre (Lier)','Limbourg','Lokeren','Lommel','Looz (Borgloon)','Lo-Reninge','Louvain (Leuven)','Maaseik','Malines (Mechelen)',
|
||||
'Malmedy','Marche-en-Famenne','Menin (Menen)','Messines (Mesen)','Mons','Montaigu-Zichem (Scherpenheuvel-Zichem)','Mortsel','Mouscron','Namur','Neufchâteau','Nieuport (Nieuwpoort)',
|
||||
'Ninove','Nivelles','Ostende (Oostende)','Ottignies-Louvain-la-Neuve','Oudenburg','Peer','Péruwelz','Philippeville','Poperinge','Renaix (Ronse)','Rochefort','Roulers (Roeselare)',
|
||||
'Saint-Ghislain','Saint-Hubert','Saint-Nicolas (Sint-Niklaas)','Saint-Trond (Sint-Truiden)','Saint-Vith (Sankt Vith)','Seraing','Soignies','Stavelot','Termonde (Dendermonde)','Thuin',
|
||||
'Tielt','Tirlemont (Tienen)','Tongres (Tongeren)','Torhout','Tournai','Turnhout','Verviers','Vilvorde (Vilvoorde)','Virton','Visé','Walcourt','Waregem','Waremme','Wavre','Wervik',
|
||||
'Ypres (Ieper)','Zottegem'
|
||||
);
|
||||
|
||||
protected static $region = array(
|
||||
'wallonne', 'flammande', 'Bruxelles-Capitale'
|
||||
);
|
||||
|
||||
protected static $province = array(
|
||||
'Anvers', 'Limbourg', 'Flandre Orientale', 'Brabant Flamand', 'Flandre Occidentale',
|
||||
'Hainaut', 'Liège', 'Luxembourg', 'Namur', 'Brabant Wallon'
|
||||
);
|
||||
|
||||
protected static $country = array(
|
||||
'Afghanistan', 'Afrique du sud', 'Albanie', 'Algérie', 'Allemagne', 'Andorre', 'Angola', 'Anguilla', 'Antarctique', 'Antigua et Barbuda', 'Antilles néerlandaises', 'Arabie saoudite', 'Argentine', 'Arménie', 'Aruba', 'Australie', 'Autriche', 'Azerbaïdjan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Belgique', 'Belize', 'Benin', 'Bermudes (Les)', 'Bhoutan', 'Biélorussie', 'Bolivie', 'Bosnie-Herzégovine', 'Botswana', 'Bouvet (Îles)', 'Brunei', 'Brésil', 'Bulgarie', 'Burkina Faso', 'Burundi', 'Cambodge', 'Cameroun', 'Canada', 'Cap Vert', 'Cayman (Îles)', 'Chili', 'Chine (Rép. pop.)', 'Christmas (Île)', 'Chypre', 'Cocos (Îles)', 'Colombie', 'Comores', 'Cook (Îles)', 'Corée du Nord', 'Corée, Sud', 'Costa Rica', 'Croatie', 'Cuba', 'Côte d\'Ivoire', 'Danemark', 'Djibouti', 'Dominique', 'Égypte', 'El Salvador', 'Émirats arabes unis', 'Équateur', 'Érythrée', 'Espagne', 'Estonie', 'États-Unis', 'Ethiopie', 'Falkland (Île)', 'Fidji (République des)', 'Finlande', 'France', 'Féroé (Îles)', 'Gabon',
|
||||
'Gambie', 'Ghana', 'Gibraltar', 'Grenade', 'Groenland', 'Grèce', 'Guadeloupe', 'Guam', 'Guatemala', 'Guinée', 'Guinée Equatoriale', 'Guinée-Bissau', 'Guyane', 'Guyane française', 'Géorgie', 'Géorgie du Sud et Sandwich du Sud (Îles)', 'Haïti', 'Heard et McDonald (Îles)', 'Honduras', 'Hong Kong', 'Hongrie', 'Îles Mineures Éloignées des États-Unis', 'Inde', 'Indonésie', 'Irak', 'Iran', 'Irlande', 'Islande', 'Israël', 'Italie', 'Jamaïque', 'Japon', 'Jordanie', 'Kazakhstan', 'Kenya', 'Kirghizistan', 'Kiribati', 'Koweit', 'La Barbad', 'Laos', 'Lesotho', 'Lettonie', 'Liban', 'Libye', 'Libéria', 'Liechtenstein', 'Lithuanie', 'Luxembourg', 'Macau', 'Macédoine', 'Madagascar', 'Malaisie', 'Malawi', 'Maldives (Îles)', 'Mali', 'Malte', 'Mariannes du Nord (Îles)', 'Maroc', 'Marshall (Îles)', 'Martinique', 'Maurice', 'Mauritanie', 'Mayotte', 'Mexique', 'Micronésie (États fédérés de)', 'Moldavie', 'Monaco', 'Mongolie', 'Montserrat', 'Mozambique', 'Myanmar', 'Namibie', 'Nauru', 'Nepal',
|
||||
'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk (Îles)', 'Norvège', 'Nouvelle Calédonie', 'Nouvelle-Zélande', 'Oman', 'Ouganda', 'Ouzbékistan', 'Pakistan', 'Palau', 'Panama', 'Papouasie-Nouvelle-Guinée', 'Paraguay', 'Pays-Bas', 'Philippines', 'Pitcairn (Îles)', 'Pologne', 'Polynésie française', 'Porto Rico', 'Portugal', 'Pérou', 'Qatar', 'Roumanie', 'Royaume-Uni', 'Russie', 'Rwanda', 'Rép. Dém. du Congo', 'République centrafricaine', 'République Dominicaine', 'République tchèque', 'Réunion (La)', 'Sahara Occidental', 'Saint Pierre et Miquelon', 'Saint Vincent et les Grenadines', 'Saint-Kitts et Nevis', 'Saint-Marin (Rép. de)', 'Sainte Hélène', 'Sainte Lucie', 'Samoa', 'Samoa', 'Seychelles', 'Sierra Leone', 'Singapour', 'Slovaquie', 'Slovénie', 'Somalie', 'Soudan', 'Sri Lanka', 'Suisse', 'Suriname', 'Suède', 'Svalbard et Jan Mayen (Îles)', 'Swaziland', 'Syrie', 'São Tomé et Príncipe (Rép.)', 'Sénégal', 'Tadjikistan', 'Taiwan', 'Tanzanie', 'Tchad',
|
||||
'Territoire britannique de l\'océan Indien', 'Territoires français du sud', 'Thailande', 'Timor', 'Togo', 'Tokelau', 'Tonga', 'Trinité et Tobago', 'Tunisie', 'Turkménistan', 'Turks et Caïques (Îles)', 'Turquie', 'Tuvalu', 'Ukraine', 'Uruguay', 'Vanuatu', 'Vatican (Etat du)', 'Venezuela', 'Vierges (Îles)', 'Vierges britanniques (Îles)', 'Vietnam', 'Wallis et Futuna (Îles)', 'Yemen', 'Yougoslavie', 'Zambie', 'Zaïre', 'Zimbabwe'
|
||||
);
|
||||
|
||||
/**
|
||||
* Randomly returns a belgian region.
|
||||
*
|
||||
* @example 'wallonne'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function region()
|
||||
{
|
||||
return static::randomElement(static::$region);
|
||||
}
|
||||
|
||||
/**
|
||||
* Randomly returns a belgian province.
|
||||
*
|
||||
* @example 'Hainaut'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function province()
|
||||
{
|
||||
return static::randomElement(static::$province);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see parent
|
||||
*/
|
||||
public function cityName()
|
||||
{
|
||||
return static::randomElement(static::$cityNames);
|
||||
}
|
||||
}
|
13
src/Faker/Provider/fr_BE/Company.php
Normal file
13
src/Faker/Provider/fr_BE/Company.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_BE;
|
||||
|
||||
class Company extends \Faker\Provider\Company
|
||||
{
|
||||
protected static $formats = array(
|
||||
'{{lastName}} {{companySuffix}}',
|
||||
'{{lastName}}',
|
||||
);
|
||||
|
||||
protected static $companySuffix = array('ASBL', 'SCS', 'SNC', 'SPRL', 'Associations', 'Entreprise individuelle', 'GEIE', 'GIE', 'SA', 'SCA', 'SCRI', 'SCRL');
|
||||
}
|
45
src/Faker/Provider/fr_BE/Internet.php
Normal file
45
src/Faker/Provider/fr_BE/Internet.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_BE;
|
||||
|
||||
class Internet extends \Faker\Provider\Internet
|
||||
{
|
||||
protected static $freeEmailDomain = array('gmail.com', 'hotmail.com', 'yahoo.com', 'advalvas.be');
|
||||
protected static $tld = array('com', 'net', 'org', 'be');
|
||||
|
||||
/**
|
||||
* Converts French characters to their ASCII representation
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function toAscii($string)
|
||||
{
|
||||
$from = array('à', 'À', 'ç', 'Ç', 'é', 'É', 'è', 'È', 'ë', 'Ë', 'ï', 'Ï', 'î', 'Î', 'ô', 'Ô', 'ù', 'Ù');
|
||||
$to = array('a', 'A', 'c', 'c', 'e', 'E', 'e', 'E', 'e', 'E', 'i', 'I', 'i', 'I', 'o', 'O', 'u', 'U');
|
||||
|
||||
return str_replace($from, $to, $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'jdoe'
|
||||
*/
|
||||
public function userName()
|
||||
{
|
||||
$format = static::randomElement(static::$userNameFormats);
|
||||
|
||||
return static::toLower(static::toAscii(static::bothify($this->generator->parse($format))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'faber'
|
||||
*/
|
||||
public function domainWord()
|
||||
{
|
||||
$company = $this->generator->format('company');
|
||||
$companyElements = explode(' ', $company);
|
||||
$company = $companyElements[0];
|
||||
$company = preg_replace('/\W/u', '', $company);
|
||||
|
||||
return static::toLower(static::toAscii($company));
|
||||
}
|
||||
}
|
51
src/Faker/Provider/fr_BE/Person.php
Normal file
51
src/Faker/Provider/fr_BE/Person.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_BE;
|
||||
|
||||
class Person extends \Faker\Provider\Person
|
||||
{
|
||||
protected static $firstName = array(
|
||||
'Aaron', 'Adam', 'Adrien', 'Alessio', 'Alexander', 'Alexandre', 'Alexia', 'Alexis', 'Alice', 'Alicia', 'Alyssa', 'Amber', 'Amélie', 'Amy', 'Anaïs', 'Anna', 'Anouk', 'Antoine',
|
||||
'Arne', 'Arthur', 'Axel', 'Axelle', 'Aya', 'Ayoub', 'Baptiste', 'Benjamin', 'Bo', 'Camille', 'Célia', 'Charlotte', 'Chiara', 'Chloé', 'Clara', 'Clémence', 'Clément', 'Daan',
|
||||
'David', 'Diego', 'Dylan', 'Elena', 'Elias', 'Eline', 'Elisa', 'Elise', 'Ella', 'Eloïse', 'Emiel', 'Emile', 'Emilie', 'Emma', 'Enzo', 'Estelle', 'Ethan', 'Eva', 'Febe', 'Femke',
|
||||
'Ferre', 'Fien', 'Finn', 'Fleur', 'Florian', 'Gabriel', 'Gilles', 'Giulia', 'Guillaume', 'Hajar', 'Hamza', 'Hanne', 'Helena', 'Hugo', 'Ilias', 'Ines', 'Inès', 'Jade', 'Jana', 'Janne',
|
||||
'Jarne', 'Jasper', 'Jeanne', 'Jelle', 'Jonas', 'Jules', 'Julia', 'Julie', 'Julien', 'Juliette', 'Kaat', 'Kato', 'Kobe', 'Lana', 'Lander', 'Lara', 'Lars', 'Laura', 'Laure', 'Léa',
|
||||
'Lena', 'Leon', 'Liam', 'Lien', 'Lilou', 'Lily', 'Lina', 'Linde', 'Lisa', 'Lise', 'Loïc', 'Lola', 'Lore', 'Lotte', 'Louis', 'Louise', 'Lowie', 'Luca', 'Lucas', 'Lucie', 'Lukas',
|
||||
'Luna', 'Maëlle', 'Malak', 'Manon', 'Margaux', 'Margot', 'Marie', 'Marion', 'Martin', 'Mathéo', 'Mathias', 'Mathis', 'Mathys', 'Mats', 'Matteo', 'Mauro', 'Maxim', 'Maxime', 'Maya',
|
||||
'Mehdi', 'Merel', 'Mila', 'Milan', 'Mohamed', 'Mohammed', 'Nathan', 'Nicolas', 'Niels', 'Nina', 'Noa', 'Noah', 'Noé', 'Noémie', 'Nolan', 'Noor', 'Nora', 'Nore', 'Océane', 'Olivia',
|
||||
'Pauline', 'Quinten', 'Rania', 'Raphaël', 'Rayan', 'Robbe', 'Robin', 'Romain', 'Romane', 'Roos', 'Ruben', 'Rune', 'Sacha', 'Salma', 'Sam', 'Samuel', 'Sander', 'Sara', 'Sarah', 'Senne',
|
||||
'Seppe', 'Siebe', 'Simon', 'Sofia', 'Stan', 'Tess', 'Théo', 'Thomas', 'Tibo', 'Tom', 'Tristan', 'Tuur', 'Vic', 'Victor', 'Victoria', 'Vince', 'Warre', 'Wout', 'Xander', 'Yana', 'Yanis',
|
||||
'Yasmine', 'Zoé', 'Zoë'
|
||||
);
|
||||
|
||||
protected static $lastName = array(
|
||||
'Adam', 'Aerts', 'Amrani', 'André', 'Antoine', 'Baert', 'Bah', 'Barry', 'Bastin', 'Bauwens', 'Benali', 'Bernard', 'Bertrand', 'Bodart', 'Bogaert', 'Bogaerts', 'Borremans', 'Bosmans',
|
||||
'Boulanger', 'Bourgeois', 'Brasseur', 'Carlier', 'Celik', 'Ceulemans', 'Charlier', 'Christiaens', 'Claes', 'Claessens', 'Claeys', 'Collard', 'Collignon', 'Collin', 'Cools', 'Coppens',
|
||||
'Cornelis', 'Cornet', 'Cuvelier', 'Daems', 'De Backer', 'De Clercq', 'De Cock', 'De Coninck', 'De Coster', 'De Greef', 'De Groote', 'De Meyer', 'De Pauw', 'De Ridder', 'De Smedt',
|
||||
'De Smet', 'De Vos', 'De Wilde', 'De Winter', 'Declercq', 'Delfosse', 'Delhaye', 'Delvaux', 'Demir', 'Denis', 'Deprez', 'Descamps', 'Desmedt', 'Desmet', 'Dethier', 'Devos', 'Diallo',
|
||||
'Dierckx', 'Dogan', 'Dubois', 'Dumont', 'Dupont', 'El Amrani', 'Etienne', 'Evrard', 'Fontaine', 'François', 'Geerts', 'Georges', 'Gérard', 'Gielen', 'Gilles', 'Gillet', 'Gilson',
|
||||
'Goethals', 'Goffin', 'Goossens', 'Grégoire', 'Guillaume', 'Hajji', 'Hardy', 'Hendrickx', 'Henry', 'Herman', 'Hermans', 'Heylen', 'Heymans', 'Hubert', 'Jacob', 'Jacobs', 'Jacques',
|
||||
'Jacquet', 'Jansen', 'Janssen', 'Janssens', 'Kaya', 'Lacroix', 'Lambert', 'Lambrechts', 'Laurent', 'Lauwers', 'Lebrun', 'Leclercq', 'Lecocq', 'Lecomte', 'Lefebvre', 'Lefèvre', 'Legrand',
|
||||
'Lejeune', 'Lemaire', 'Lemmens', 'Lenaerts', 'Léonard', 'Leroy', 'Libert', 'Lievens', 'Louis', 'Luyten', 'Maes', 'Mahieu', 'Marchal', 'Maréchal', 'Martens', 'Martin', 'Massart', 'Masson',
|
||||
'Mathieu', 'Meert', 'Mertens', 'Messaoudi', 'Meunier', 'Michaux', 'Michel', 'Michiels', 'Moens', 'Moreau', 'Nguyen', 'Nicolas', 'Nijs', 'Noël', 'Parmentier', 'Pauwels', 'Peeters', 'Petit',
|
||||
'Pierre', 'Pieters', 'Piette', 'Piron', 'Pirotte', 'Poncelet', 'Raes', 'Remy', 'Renard', 'Robert', 'Roels', 'Roland', 'Rousseau', 'Sahin', 'Saidi', 'Schmitz', 'Segers', 'Servais', 'Simon',
|
||||
'Simons', 'Smet', 'Smets', 'Somers', 'Stevens', 'Thijs', 'Thiry', 'Thomas', 'Thys', 'Timmermans', 'Toussaint', 'Tran', 'Urbain', 'Van Acker', 'Van Damme', 'Van de Velde', 'Van den Bossche',
|
||||
'Van den Broeck', 'Van Dyck', 'Van Hecke', 'Van Hoof', 'Vandamme', 'Vandenberghe', 'Verbeeck', 'Verbeke', 'Verbruggen', 'Vercammen', 'Verhaegen', 'Verhaeghe', 'Verhelst', 'Verheyen',
|
||||
'Verhoeven', 'Verlinden', 'Vermeersch', 'Vermeiren', 'Vermeulen', 'Verschueren', 'Verstraete', 'Verstraeten', 'Vervoort', 'Wauters', 'Willems', 'Wouters', 'Wuyts', 'Yildirim', 'Yilmaz'
|
||||
);
|
||||
|
||||
private static $prefix = array('M.', 'Mme', 'Mlle', 'Dr', 'Pr', 'Me', 'Mgr');
|
||||
|
||||
/**
|
||||
* Randomly returns a belgian prefix.
|
||||
*
|
||||
* @example 'Mrs.'
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function prefix()
|
||||
{
|
||||
return static::randomElement(static::$prefix);
|
||||
}
|
||||
|
||||
}
|
21
src/Faker/Provider/fr_BE/PhoneNumber.php
Normal file
21
src/Faker/Provider/fr_BE/PhoneNumber.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\fr_BE;
|
||||
|
||||
class PhoneNumber extends \Faker\Provider\PhoneNumber
|
||||
{
|
||||
protected static $formats = array(
|
||||
'+32(0)########',
|
||||
'+32(0)### ######',
|
||||
'+32(0)# #######',
|
||||
'0#########',
|
||||
'0### ######',
|
||||
'0### ### ###',
|
||||
'0### ## ## ##',
|
||||
'0## ######',
|
||||
'0## ## ## ##',
|
||||
'0# #######',
|
||||
'0# ### ## ##',
|
||||
);
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user