ivy-wallet
ivy-wallet copied to clipboard
[FEATURE] Add a language dropdown in Settings
Please confirm the following:
- [X] I've checked the current issues for duplicate issues.
- [X] I've requested a single (only one) feature/change in this issue. It complies with the One Request Per GitHub Issue (ORPGI) rule.
- [X] My issue is well-defined and describes how it should be implemented from UI/UX perspective.
What do you want to be added or improved?
As a user I want to be able to change Ivy Wallet's language to one of the supported ones.
Why do you need it?
- Change Ivy Wallet's language without changing the language of the device.
How do you imagine it?
- An "App Language" material3 drop-down that can change the app's language to one of the supported languages that can be hard-coded as
enum
Thank you @ILIYANGERMANOV for raising Issue #3138! 🚀 What's next? Read our Contribution Guidelines 📚.
Tagging @ILIYANGERMANOV for review & approval 👀
I'm on it
Thank you for your interest @SpyrosKoutsangelis! 🎉 Issue #3138 is assigned to you. You can work on it! ✅
If you don't want to work on it now, please un-assign yourself so other contributors can take it.
Also, make sure to read our Contribution Guidelines.
@SpyrosKoutsangelis If you are not working on it, Can I take this issue?
@Mouzzamsddq Sorry for the delay. I believe I'm close to finishing this
I have been working on this and though I believe I'm close to finishing this (as per my last comment), stringRes() is giving me trouble.
Lots of strings are created and stored in memory (as parts of objects) when the app starts, so even after the language changes, those strings remain unchanged.
ie. ACTIVE_CARDS's items contain strings created in such a way. Neither ACTIVE_CARDS nor any of its items get their values changed at any time after their initialization.
https://github.com/Ivy-Apps/ivy-wallet/blob/4e25b3f4020066154dfe1a55c1ada422d1d4afdc/screen/home/src/main/java/com/ivy/home/customerjourney/CustomerJourneyCardsProvider.kt#L56-L69
The result of this is having some screens appear with parts of them in the original language and other parts in the new language.
I have three proposals to resolve this:
-
Make strings created by
stringRes()NOT be stored in memory This way,stringRes()will be called again and again, which ensures that each call will produce a result based on the current language. However, this is very error-prone. If anyone stores the result ofstringRes()as part of an object in the future, this will immediately introduce a bug. -
Remove
stringRes()entirelystringRes()already has the@Deprecated("Legacy. Will be removed.")tag anyway, and I think completely removing it is do-able. My only concern is that it will probably need A LOT of changes and I'm afraid these changes are beyond the goal of the current feature. -
Prompt the user to manually restart the app As said above, the issue is caused by Strings that are generated and stored at the app's start. But this means that when the app is restarted, those strings are re-generated, this time based on the new language. This way the functionality of changing the language while the app is still open is lost, but at least it seems like a safe solution. Of course, showing a popup/dialog with a text like "Your changes will take effect the next time you open the app" would be needed.
Any thoughts on this? @ILIYANGERMANOV (Sorry if tagging you specifically is not appropriate, I'm not sure who else might be suitable to make a decision on this)
Hey @SpyrosKoutsangelis nice work! 3. Prompt to manually restart the app is perfect. Most people will be happy if they can change the language at all
Hey @SpyrosKoutsangelis If someone are not working on it, Can I take this issue?
Hey @TanishMoral11 feel free to take it, a few months have passed. Type the magic words
I'm on it
Thank you for your interest @suyash01! 🎉 Issue #3138 is assigned to you. You can work on it! ✅
If you don't want to work on it now, please un-assign yourself so other contributors can take it.
Also, make sure to read our Contribution Guidelines.