-
Notifications
You must be signed in to change notification settings - Fork 0
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
Change Language while on the app #267
Conversation
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.
Good job my G
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.
Hi Nehemie,
this PR is looking great, this is a very crucial functionality because else our language setting is just useless. Your code is working seamlessly which is very nice, the functionality is well adjusted. On a testing side, your code features more than 80% branch coverage, and same for line coverage. Good job !
I have a few remarks though,
- you haven't tested toLocale for french and german, two easy lines of code to get and for good testing purpose
- you under-commented your code, again if someone has to go back to it at some point or even for other people coming to look at the code, it really is important to have a minimum of comment to save a lot of time for the others
Thank you for fixing the few comments I put on your code, great code quality overall, good luck ! :)
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.
If you are able to comment a bit more this part of the code it would be great :)
fun toLocale(): String { | ||
return when (this) { | ||
ENGLISH -> "en" | ||
FRENCH -> "fr" | ||
GERMAN -> "de" |
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.
It would be nice to test for each language in case for one the toLocale would be incorrect :)
|
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.
Thanks for adding the comments and testing up to 90% of coverage, code looks great, approving now !
This allows users to change language from the preferences screen. The code is present in the main activity file as it needs to call the recreate method, which is only doable in an activity