Skip to content
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

add locale to word module #903

Closed
cieslarmichal opened this issue Sep 7, 2024 · 6 comments · Fixed by #932
Closed

add locale to word module #903

cieslarmichal opened this issue Sep 7, 2024 · 6 comments · Fixed by #932
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@cieslarmichal
Copy link
Owner

ref book module

@cieslarmichal cieslarmichal added the good first issue Good for newcomers label Sep 7, 2024
@gustavobastian
Copy link
Contributor

Hi @cieslarmichal, I would like to collaborate on this issue. After looking the code (the books and words modules), I noticed that right now this generate only English words . I am thinking in generate the Spanish(ARG) arrays in the word_store.h, new functions and tests. If it's ok(only for Spanish and English locations), please assign it to me.

@cieslarmichal
Copy link
Owner Author

Yeah you can do only with those two locales and it locale doesnt exist return default english

@gustavobastian
Copy link
Contributor

Hi @cieslarmichal, I've done something (added to word module es_AR)... how could I get a code review? Just generate a pull request? If everything is ok, I will continue with another languages. I am considering using std::vector instead of std::array in the structures in "word_store.h".

@cieslarmichal
Copy link
Owner Author

@gustavobastian yup just generate a PR, why would you like to change it to vector?

@gustavobastian
Copy link
Contributor

I am generating a map with the key each faker::Locale, and the value, the array. If we use const vector, instead of const array, we can let the compiler to calculate the size of each language structure. Right now, we are forced to store the same number of words for each language, and I don´t know if other languages has enough words for each kind, as the map is (key,array<string_view>xxx):

Screenshot from 2024-09-30 13-14-28

We can repeat some words in order to get the desired number... There are multiple solutions for the situation.

@cieslarmichal
Copy link
Owner Author

We can use std::span as an abstraction for array so we dont need to know its size, check person module or location or books there are some exaples of using span with an array

@cieslarmichal cieslarmichal added this to the v4.0.0 milestone Oct 1, 2024
@cieslarmichal cieslarmichal linked a pull request Oct 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants