-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supporting arabic data generation #86
Comments
@walaa-akram Yes, we definitely are. I'll note I have no expertise and just a very little knowledge of Arabic so we would need others to share their knowledge and language skills. I am willing to work with you and others to help bring in Arabic .. which as I type this I realize we may need to do this down at the Faker Python package level. [I know Arabic is one of the Right-to-Left Languages. Although as I double check myself I see others talking about nuances I was not aware of. I know one can use, what I would call "spaces" but are (?), kashidas to justify or align the letters giving almost a monospace or fixed width type font (which I find to be super cool). I was, a couple years ago, going through some video tutorials learning a very introductory level of Arabic lettering. And finally I have an interest in tooling around Robot Framework and RTL languages that although dormant at times keeps coming back. So right to left languages are an interest of mine.] |
Sorry didn't have time yesterday but went in to check just now. There are some pieces of data that the underlying Faker library already provides for Arabic. I found these
A sample usage of this within Robot Framework would be *** Settings ***
Library FakerLibrary locale=ar_AA
*** Test Cases ***
FakerLibrary Name (Person) Generation
${name}= FakerLibrary.Name
Log To Console \nname: ${name} I don't know how good the Arabic data is. For example I know some Germans note that the "Faker German Names" aren't very German. Also I see there is not a lot of Arabic data files as shown above. I suspect but have tried this myself yet that one can add their own files and data as a provider expanding upon what comes with the packaged data. |
Dear Emanlove I tried it and it works. as you said the quality of names is not the proposed one but it is ok till now. |
The addition of data is done through the underlying Faker python package. It has documentation which can be found here. In particular as I recall this addition of data is done through what they call "Providers". Its been a while since I have taken a deep look into this so I may be a bit wrong there. The Faker documentation would be a good place to start. I am coming back from the Robot Framework conference where we had conversations on what we might call FakerLibrary 2.0. So I hope to be getting a much better understanding over the next couple months. Please feel free to come back and ask more questions after you get a chance to see what there is in the faker documentation. Or if you want to discuss sooner for clarifying purposes. |
@walaa-akram I realized as I re-read your question I didn't really address what you asked. If you want to use two languages in the same script you could currently do something like *** Settings ***
Library FakerLibrary locale=ar_AA AS Arabic
Library FakerLibrary locale=fr_FR AS French
*** Test Cases ***
FakerLibrary Name (Person) Generation
${a_name}= Arabic.Name
${f_name}= French.Name
Log To Console \nArabic name: ${a_name}
Log To Console \nFrench name: ${f_name} where you import a faker library setting the locale you want and reassign the library name, using the As for a name not having any special characters for now I would assume you would need to remove them from the provider dataset. |
I take that back. As I am making some changes I see it is possible to add providers as is. Working out how to do that and will document! |
So I know this needs to be explained but I did want to share a sample here. Please try not to get frustrated if this is not clear as this is more preserving as source control and not explaining fully what I am doing yet. I created a basic provider in Python and then was able to bring it into the robot script through the providers argument on the import library. As I needed to pass the providers as a list, as currently implemented, I felt the only method for this was to import the library using the cake_provider.py
add-provider.robot *** Test Cases ***
Try Out Adding A Provider Through FakerLibrary
@{providers}= Create List cake_provider
Import Library FakerLibrary providers=${providers}
${a_cake}= FakerLibrary.Cakes
Log To Console \n${a_cake} |
Thanks for pointing this out. I created a issue [#88] to specifically look into this. |
Are you willing to support arabic generated data?
The text was updated successfully, but these errors were encountered: