-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
feat::Add multilanguage sexes (Issue #251) #312
feat::Add multilanguage sexes (Issue #251) #312
Conversation
hey @cieslarmichal, could you please review this PR and let me know if this is what expected or i need to make any sort of modifications? Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know when it will be done and ready to merge as I see it is now WIP.
hey, any updates? :) |
Hey, I've been digging through my Git history, trying to find the commit where you removed the Language enum, but I'm hitting a wall. I used git log --grep="remove Language enum" to search for it, but no luck. Any tips or tricks you can share to help me locate that commit? I'd really appreciate it! |
Ok, sorry I should have give you better instructions about that Language enum, here it is:
It was in include/faker-cxx/types/Language.h |
It would be nice to have all corresponding languages to countries we have in types/Country.h |
gotcha! i will make that change, thank you |
98cb7dd
to
ee1ce84
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
==========================================
- Coverage 98.82% 98.04% -0.79%
==========================================
Files 47 48 +1
Lines 3143 3167 +24
==========================================
- Hits 3106 3105 -1
- Misses 37 62 +25 ☔ View full report in Codecov by Sentry. |
5fbcd1d
to
cdb910d
Compare
include/faker-cxx/types/Language.h
Outdated
Estonian | ||
}; | ||
|
||
//const std::vector<Language> languages{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
cdb910d
to
9e9d902
Compare
any progress? |
Unfortunately, I've been tied up with other work, so I haven't had the chance to work on this yet. But I'm planning to get it done this weekend. I hope that's okay |
Ok sure, no problem :) |
hello, are you going to finish this PR? |
I will close the PR after 3 days from now if not updated. |
I should be able to finish it today, i just need to write some test cases for it now |
6eda269
to
71672fc
Compare
Good job! :D |
Title: Add Multilingual Support for Sex Descriptions
Key Changes:
sexTranslations
is added, which maps eachLanguage
enum to another map. This inner map pairs theSex
enum (Male, Female) with their respective translations in that language.translateSex
function is implemented to fetch these translations. It uses theLanguage
andSex
enums to return the correct localized string.Person
class'ssex()
method is updated to include an optionalLanguage
parameter, defaulting to English. This change allows users to retrieve the sex description in the desired language.Example Usage:
Person::sex(Language::Polish)
would return "Mężczyzna" for Male and "Kobieta" for Female.