FakerPHP / Faker

Faker is a PHP library that generates fake data for you

Home Page:https://fakerphp.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem in Farsi/Persian Fakers

rezabagheri opened this issue · comments

The

  • paragraph
  • sentence
  • text

functions return English results when using fa_IR as locale, regardless of their providers.

use Faker\Factory;

require_once __DIR__ . '/vendor/autoload.php';

$faker = Factory::create('fa_IR');

$faker→seed(1);

var_dump([
    'paragraph' => $faker->paragraph,
    'sentence' => $faker->sentence,
    'text' => $faker->text,
]);

Expected

  • results in fa_IR

Actual

  • results in en_US

@rezabagheri

Which version of fakerphp/faker do you use?
Which values do you pass as $locale to https://github.com/FakerPHP/Faker/blob/v1.21.0/src/Faker/Factory.php#L18?

@rezabagheri

Which version of fakerphp/faker do you use? Which values do you pass as $locale to https://github.com/FakerPHP/Faker/blob/v1.21.0/src/Faker/Factory.php#L18?

I am using version 2022-07-20, v1.20.0 (From Composer)
and pass "fa_IR"
It works for the correct person and address
but return default locale for sentence, paragraph and text

UPDATE:
After update to v1.21.0, the problem still not solved

I think we have same problem in other languages
when i use

$faker = Factory::create('en_US');
echo $faker->Text();

Ouput is:

Consequuntur ea iusto est ipsam saepe qui debitis. Aliquid sit corporis rem perspiciatis quia eveniet voluptatum. Aliquam expedita non et. Soluta enim ex sunt.

non english Text!

https://en.m.wikipedia.org/wiki/Lorem_ipsum

This is related to Lorem Provider, we work with Text provider
And inside this provider there are selected sentences from the book Alice's Adventures in Wonderland

https://github.com/FakerPHP/Faker/blob/main/src/Faker/Provider/en_US/Text.php

commented

I think text points to the Lorem provider.
Try realText()

Thanks a lot!