bchavez / Bogus

:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
Other
8.79k stars 499 forks source link

Where are the en_US phone number formats? #424

Closed jmenashe closed 2 years ago

jmenashe commented 2 years ago

Version Information

Software Version(s)
Bogus NuGet Package v34.0.2 build 1173
.NET Core? 6.0
.NET Full Framework? 4.8
Windows OS? Win10 x64
Linux OS? Ubuntu 22.04
Visual Studio? VS2022 Version 17.1.5

What locale are you using with Bogus?

en_US

What's the problem?

There are no phone number formats defined.

What possible solutions have you considered?

Searching exhaustively through GitHub for terms like "phone", "formats", "###-###-####", etc.

Do you have sample code to show what you're trying to do?

Same thing as every other country. For example, formats are defined in the en_GB.locale.json file.

bchavez commented 2 years ago

If phone_number.formats is not defined in the specific and specified locale (eg: en_US); then Bogus always falls back to the en locale using phone_number.formats as defined here:

https://github.com/bchavez/Bogus/blob/e29f0205f6af6d736570646f4b08231eda6dba19/Source/Bogus/data/en.locale.json#L7677-L7700