faker icon indicating copy to clipboard operation
faker copied to clipboard

Remove hardcoded fallback patterns from company.name

Open ST-DDT opened this issue 3 years ago • 5 comments

https://github.com/faker-js/faker/blob/e1f26a6d2c79f3d9540f1890669631aca0fe5527/src/modules/company/index.ts#L47-L54

In v8, it should only use the locale data.

ST-DDT avatar Aug 22 '22 18:08 ST-DDT

Could you assign to me?

Minozzzi avatar Aug 22 '22 19:08 Minozzzi

Could you assign to me?

Sure!

ejcheng avatar Aug 22 '22 19:08 ejcheng

Guys. Is it valid if I put the en company name_patterns locale to other locales that do not have company name_patterns locales?

Locales that do not have company.name_patterns

  • ./src/locales/af_ZA/company
  • ./src/locales/en_AU/company
  • ./src/locales/en_AU_ocker/company
  • ./src/locales/en_IND/company
  • ./src/locales/en_NG/company
  • ./src/locales/en_ZA/company
  • ./src/locales/ne/company
  • ./src/locales/nl/company
  • ./src/locales/nl_BE/company
  • ./src/locales/zu_ZA/company

Minozzzi avatar Aug 23 '22 00:08 Minozzzi

  • ./src/locales/af_ZA/company
  • ./src/locales/ne/company
  • ./src/locales/nl/company
  • ./src/locales/zu_ZA/company

At least these are the most important ons as the others could theoretically be defined with their fallbacks

But to answer your question: not directly, it would be better to directly make it right instead of just copy something over

Shinigami92 avatar Aug 23 '22 07:08 Shinigami92

Ok, I searched for af_ZA company patterns but I didn't find anything about this. How I should search?

Minozzzi avatar Aug 23 '22 12:08 Minozzzi

Hi @Minozzzi we released the final v7 and now going into development for v8 Please create a PR that removes the hard coded fallback, so that we can review and merge it

Shinigami92 avatar Oct 13 '22 16:10 Shinigami92

I don't exactly have the correct pattern for company names in these locales, would there be any correct way to search?

Minozzzi avatar Oct 13 '22 16:10 Minozzzi

You dont have to search. Just remove the hardcoded pattern. If a user needs a pattern for that locale, they will hopefully contact us with the right pattern or they will use the en locale fallback.

ST-DDT avatar Oct 13 '22 17:10 ST-DDT

I don't exactly have the correct pattern for company names in these locales, would there be any correct way to search?

Yeah, you might have misunderstood something :slightly_smiling_face: Just remove staticFormats that was marked with ToDo

https://github.com/faker-js/faker/blob/1ab33c5caf323d25bd21b3b3afaf8af3686207b4/src/modules/company/index.ts#L51-L56

Shinigami92 avatar Oct 13 '22 18:10 Shinigami92

Ohh, I really got it wrong, sorry for the long time gone by. I'll adjust it

Minozzzi avatar Oct 13 '22 20:10 Minozzzi

sorry for the long time gone by

No need to be sorry! You actually can even now start with it, as before we were on v7.

Shinigami92 avatar Oct 13 '22 20:10 Shinigami92