3

I'm new at using jFairy. I tried to produce 100 English words through the following code:

for(int i=0; i<100; i++)
{          

   System.out.println(Fairy.create(Locale.ENGLISH).text().word());
   System.out.println("-----------------------");

}

and the outputs were like this( all of them were LATIN words):

vitae massa at
-----------------------
dolor lorem sed
-----------------------
posuere praesent at
-----------------------
nec metus dolor
-----------------------
aliquet purus magna
-----------------------

How do I get English words here instead of Latins?

Pshemo
  • 122,468
  • 25
  • 185
  • 269
Rassell
  • 31
  • 2

3 Answers3

3

I have added the feature. Please check release-0.3.1 out.

Use text(), word(), sentence() and paragraph() methods for getting localised text and loremIpsum(), latinWord() and latinSentence() methods for getting Latin text.

While updating the version, please also note that the groupId has changed from org.jfairy to io.codearte.jfairy.

Marcin Zajączkowski
  • 4,036
  • 1
  • 32
  • 41
OlgaMaciaszek
  • 3,662
  • 1
  • 28
  • 32
2

What if you use this?

 System.out.println(Fairy.create(Locale.forLanguageTag("en")).text().word());
DJ Burb
  • 2,346
  • 2
  • 29
  • 38
  • 1
    Still getting these: magna ultricies elit elit dapibus pharetra rhoncus est est............ Thanks for the try man :) – Rassell Nov 27 '14 at 07:37
1

This is already implemented in version 0.3.1 - see OlgaMaciaszek's response

Actually jFairy text generator has only ability to generate random Lorem ipsum text.

Replacing meaningful content that could be distracting with placeholder text may allow viewers to focus on graphic aspects such as font, typography, and page layout. It also reduces the need for the designer to come up with meaningful text, as they can instead use hastily generated lorem ipsum text.

But you are right, we should add support for localized content in text generator.

Community
  • 1
  • 1
MariuszS
  • 30,646
  • 12
  • 114
  • 155