Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Incorrect locale be_BE #591

Closed
eMerzh opened this issue May 29, 2015 · 5 comments
Closed

Incorrect locale be_BE #591

eMerzh opened this issue May 29, 2015 · 5 comments

Comments

@eMerzh
Copy link

eMerzh commented May 29, 2015

correct me if i'm wrong but there is no such thing as be_BE

there is fr_BE or nl_BE (french belgian, neederlands belgian)

or be_BY (Belarusian Belarus)

@fzaninotto
Copy link
Owner

True, although @ronanguilloux's formatter is for the belgian country regardless of the language. But you're right, I belive the formatter should be included in a real locale. Ronan, any insight?

@ronanguilloux
Copy link
Contributor

Well yes @eMerzh is very right, this is not a real genuine locale: this 'be-BE' locale was introduced only to handle the implementation of a Belgian fake VAT provider here, regardless of the language. And yes, this may become embarrassing for the next Belgian-related providers implementations, so I'm very agree to wipe out this fake (!) 'be_BE' locale.

Related to the immediate VAT question that provoked the problem here, we may have a quick workaround creating a global, new VAT-specific provider, expecting a national prefix as parameter. See IsoCodes VAT. Actually, and for the sake of programmers, VAT rules are regexp-based. This may allow us to delete this be_BE folder.

=> Is that proposition OK to both of you to fix this issue?

But in a broader way it seems that Faker didn't had to seized the problem of national-related providers that are not related to a specific language in particular national contexts, so it's a bit more about lib architecture here (i.e. : avoiding duplicated code, introducing an inheritance logic between nation-related providers, etc.). I admit my workaround proposition is just putting off dealing with this question until a later date :-|

@eMerzh
Copy link
Author

eMerzh commented Jun 1, 2015

Yeah i thing the best way to address this is to manage country related problems with a country param and not a locale one ...
but your solution is ok for me :)

@fzaninotto
Copy link
Owner

I like your solution, too. As for avoiding duplication, the best is to create a calculator class (like https://github.com/fzaninotto/Faker/blob/master/src/Faker/Calculator/Luhn.php), and use it in all formatters depending on this code.

@fzaninotto
Copy link
Owner

Fixed by #896

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants