forked from fzaninotto/Faker
-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
French: added translated color for french language (#466)
- Loading branch information
1 parent
f66a262
commit 109d5bf
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Faker\Provider\fr_BE; | ||
|
||
class Color extends \Faker\Provider\fr_FR\Color | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Faker\Provider\fr_CA; | ||
|
||
class Color extends \Faker\Provider\fr_FR\Color | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Faker\Provider\fr_CH; | ||
|
||
class Color extends \Faker\Provider\fr_FR\Color | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Faker\Provider\fr_FR; | ||
|
||
class Color extends \Faker\Provider\Color | ||
{ | ||
protected static $safeColorNames = [ | ||
'noir', 'marron', 'vert', 'marine', 'olive', | ||
'violet', 'turquoise', 'citron', 'bleu', | ||
'argenté', 'gris', 'jaune', 'fuchsia', 'blanc', | ||
]; | ||
|
||
/** | ||
* @source: https://fr.wikipedia.org/wiki/Liste_de_noms_de_couleur#Liste | ||
*/ | ||
protected static $allColorNames = [ | ||
'Abricot', 'Acajou', 'Aigue-marine', 'Amande', 'Amarante', 'Ambre', 'Améthyste', 'Anthracite', 'Argent', 'Aubergine', | ||
'Aurore', 'Avocat', 'Azur', 'Basané', 'Beurre', 'Bis', 'Bisque', 'Bistre', 'Bitume', 'Blanc cassé', 'Blanc lunaire', | ||
'Blé', 'Bleu acier', 'Bleu barbeau', 'Bleu canard', 'Bleu céleste', 'Bleu charrette', 'Bleu ciel', 'Bleu de cobalt', | ||
'Bleu de Prusse', 'Bleu électrique', 'Bleu givré', 'Bleu marine', 'Bleu nuit', 'Bleu outremer', 'Bleu paon', 'Bleu persan', | ||
'Bleu pétrole', 'Bleu roi', 'Bleu turquin', "Bouton d'or", 'Brique', 'Bronze', 'Brou de noix', "Caca d'oie", 'Cacao', | ||
'Cachou', 'Cæruleum', 'Café', 'Café au lait', 'Cannelle', 'Capucine', 'Caramel', 'Carmin', 'Carotte', 'Chamois', 'Chartreuse', | ||
'Chaudron', 'Chocolat', 'Cinabre', 'Citrouille', "Coquille d'œuf", 'Corail', 'Cramoisi', 'Cuisse de nymphe', 'Cuivre', | ||
'Cyan', 'Écarlate', 'Écru', 'Émeraude', 'Fauve', 'Flave', 'Fraise', 'Fraise écrasée', 'Framboise', 'Fuchsia', 'Fumée', | ||
'Garance (pigment)', 'Glauque', 'Glycine', 'Grège', 'Grenadine', 'Grenat', 'Gris acier', 'Gris de Payne', 'Gris fer', | ||
'Gris perle', 'Gris souris', 'Groseille', 'Gueules', 'Héliotrope', 'Incarnat', 'Indigo', 'Indigo', 'Isabelle', | ||
'Jaune canari', 'Jaune citron', "Jaune d'or", 'Jaune de cobalt', 'Jaune de Mars', 'Jaune de Naples', 'Jaune impérial', | ||
'Jaune mimosa', 'Lapis-lazuli', 'Lavallière', 'Lavande', 'Lie de vin', 'Lilas', 'Lime ou vert citron', 'Lin', 'Magenta', | ||
'Maïs', 'Malachite', 'Mandarine', 'Marron', 'Mastic', 'Mauve', 'Menthe', 'Moutarde', 'Nacarat', 'Nankin', 'Noisette', | ||
'Ocre', 'Ocre rouge', 'Olive', 'Or (couleur)', 'Orange brûlé', 'Orchidée', 'Orpiment (pigment)', 'Paille', 'Parme', "Pelure d'oignon", | ||
'Pervenche', 'Pistache', 'Poil de chameau', 'Ponceau', 'Pourpre (héraldique)', 'Prasin', 'Prune', 'Puce', 'Rose Mountbatten', | ||
'Rouge anglais', 'Rouge cardinal', 'Rouge cerise', "Rouge d'Andrinople", 'Rouge de Falun', 'Rouge feu', 'Rouge indien', 'Rouge tomette', 'Rouille', | ||
'Rubis', 'Sable', 'Sable (héraldique)', 'Safre', 'Sang de bœuf', 'Sanguine', 'Saphir', 'Sarcelle', 'Saumon', 'Sépia', | ||
'Sinople', 'Smalt', 'Soufre', 'Tabac', "Terre d'ombre", 'Tomate', 'Topaze', 'Tourterelle', 'Turquoise', 'Vanille', | ||
'Vermeil', 'Vermillon', 'Vert bouteille', 'Vert céladon', "Vert d'eau", 'Vert de chrome', 'Vert-de-gris', 'Vert de Hooker', | ||
'Vert de vessie', 'Vert épinard', 'Vert impérial', 'Vert lichen', 'Vert olive', 'Vert perroquet', 'Vert poireau', | ||
'Vert pomme', 'Vert prairie', 'Vert printemps', 'Vert sapin', 'Vert sauge', 'Vert tilleul', 'Vert Véronèse', | ||
'Violet', "Violet d'évêque", 'Viride', 'Zinzolin', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Faker\Test\Provider\fr_FR; | ||
|
||
use Faker\Provider\fr_FR\Color; | ||
use Faker\Test\TestCase; | ||
|
||
/** | ||
* @group legacy | ||
*/ | ||
final class ColorTest extends TestCase | ||
{ | ||
public function testColorName() | ||
{ | ||
self::assertEquals('Mandarine', $this->faker->colorName()); | ||
self::assertEquals('Acajou', $this->faker->colorName()); | ||
} | ||
|
||
public function testSafeColorName() | ||
{ | ||
self::assertEquals('bleu', $this->faker->safeColorName()); | ||
self::assertEquals('noir', $this->faker->safeColorName()); | ||
} | ||
|
||
protected function getProviders(): iterable | ||
{ | ||
yield new Color($this->faker); | ||
} | ||
} |