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

Lorem provider should not be localized #394

Merged
merged 1 commit into from
Aug 19, 2014
Merged

Conversation

fzaninotto
Copy link
Owner

No description provided.

fzaninotto added a commit that referenced this pull request Aug 19, 2014
Lorem provider should not be localized
@fzaninotto fzaninotto merged commit d46b8f5 into master Aug 19, 2014
@fzaninotto fzaninotto deleted the lorem_not_localized branch August 19, 2014 08:06
@terion-name
Copy link
Contributor

Really, why?

@fzaninotto
Copy link
Owner Author

The problem is that the documentation stipulates that word, sentence, and text formatters create fake text, in "ipsum" language. This Ipsum language is supposed to be foreign for everyone (not just you).

Then we introduced realText, which is a localized random text provider. If you want words and sentences in a certain locale, that would imply new formatters (for backwards compatibility, and for API consistency). Should they be named realWord and realSentence? I don't see why a localized fake word would be more real than the Ipsum one. After thinking a bit about it, Faker should offer the following API:

  • word: localized random word, e.g. "foot", "a", "rabbit"
  • sentence: localized random sentence, e.g. "Foot a rabbit."
  • text: localized random text, e.g. "Foot a rabbit. Heads over my tail did she know?" (currently realText)
  • ipsumWord: ipsum random word, e.g. "lorem", "ipsum", "sic" (currently word)
  • ipsumSentence: ipsum random sentence, e.g. "Lorem ipsum sic." (currently 'sentence)
  • ipsumText: ipsum random text, e.g. "Lorem ipsum sic. Dolor amet?" (currently text)

Implementing this API would break BC, and therefore I'm not in a hurry to do it, especially since the Text provider is probably the most used in Faker.

@terion-name
Copy link
Contributor

I agree that API above would be the best solution.

I don't see why a localized fake word would be more real than the Ipsum one

Because you are using latin-based language =)
Look, fake content is used to make site "live". And there are several points in using foreign texts:

  1. When you show an intermediate version to manager or client — it is perceived not correctly. Really, differences are huge.
  2. In case of arabic or hieroglyph langs the whole design will look different.

Yes, this concerns are mostly in the scope of client management, design and perception, but they matter.
Of course maybe problem is not so big as I rate it. Maybe it would be better to make a discussion with non-latin developers in first place (because for latin languages this problem almost absent) to understand needs of majority.

@fzaninotto
Copy link
Owner Author

Until we change the API in a backwards-incompatible way, there is still the option to add a realWord and realSentence formatters using the novels in the localized Text providers. I think the code to add to Faker\Provider\Text would be minimal. Would you like to give it a try?

@terion-name
Copy link
Contributor

Ok, I'll ad this formatters and make a PR on weekend

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

Successfully merging this pull request may close these issues.

2 participants