-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix string translation in Stats #10520
Conversation
You can test the changes on this Pull Request by downloading the APK here. |
This PR #7413 PR from Amanda might be useful for the review. I don't remember the details but I think Locale.getDefault() was causing some issues. 🤷♂ |
@malinajirka I think we have to use the |
|
||
@Singleton | ||
class ContextProvider | ||
@Inject constructor(private var context: Context) { |
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.
Like this Singleton Provider approach 👍
|
||
fun getContext(): Context { | ||
return context | ||
} |
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.
Really minor np: what about using expression body function here? Eventually keeping explicitly the return data type for readability. I'm in any case fine with as it is already (basically a matter of prefs).
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.
sounds good 👍 anything that reduces the boilerplate code is a good change :-)
Hi @planarvoid, I followed the testing steps with Android API level 21 and 28 (with and without this patch) and it worked as expected. Good job! 👍
This is also my guess also based on this comment. I'm not fully sure to get all the possible implications of the modification in I left an extremely minor np in the code comments if you want to consider but you can leave as it is if you prefer. During testing with develop branch without this patch I found an issue when selecting RTL languages (for example Hebrew). Basically the order of quick actions buttons and of the bottom nav bar items are not updated in RTL order with API > 24 unless you restart the app. Don't know if it was intentional but this PR seems to fix also that. I will open a dedicated issue to track this but wanted to mention in case you prefer to look into it in this PR explicitly, let me know 😊. |
I don't think there should be any problem with the
We use the |
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 this @planarvoid ! LGTM! 👍
Fixes #8114
This fixes the issue with dates and other strings not being translated when the user changes the language within the App settings. This uses the injected
ContextProvider
instead ofContext
. TheContextProvider
keeps a copy of the context which gets updated whenever the user selects a new language.To test:
Update release notes:
RELEASE-NOTES.txt
if necessary.