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

[FEATURE] Add a language dropdown in Settings #3138

Open
3 tasks done
ILIYANGERMANOV opened this issue Apr 15, 2024 · 7 comments
Open
3 tasks done

[FEATURE] Add a language dropdown in Settings #3138

ILIYANGERMANOV opened this issue Apr 15, 2024 · 7 comments
Assignees
Labels
approved Approved by the Ivy Wallet team. Ready for dev good first issue Good for newcomers help wanted Help us! Appreciated keep Keep it from automatically getting closed by Stale P1 Important but can wait user request Feature/improvement requested by an user

Comments

@ILIYANGERMANOV
Copy link
Collaborator

Please confirm the following:

  • I've checked the current issues for duplicate issues.
  • I've requested a single (only one) feature/change in this issue. It complies with the One Request Per GitHub Issue (ORPGI) rule.
  • 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
@ILIYANGERMANOV ILIYANGERMANOV added user request Feature/improvement requested by an user good first issue Good for newcomers help wanted Help us! Appreciated approved Approved by the Ivy Wallet team. Ready for dev keep Keep it from automatically getting closed by Stale P1 Important but can wait labels Apr 15, 2024
@ivywallet
Copy link

Thank you @ILIYANGERMANOV for raising Issue #3138! 🚀
What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

@SpyrosKoutsangelis
Copy link

I'm on it

@ivywallet
Copy link

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.

@Mouzzamsddq
Copy link

Mouzzamsddq commented May 10, 2024

@SpyrosKoutsangelis If you are not working on it, Can I take this issue?

@SpyrosKoutsangelis
Copy link

@Mouzzamsddq Sorry for the delay. I believe I'm close to finishing this

@SpyrosKoutsangelis
Copy link

SpyrosKoutsangelis commented May 14, 2024

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.

companion object {
val ACTIVE_CARDS = listOf(
adjustBalanceCard(),
addPlannedPaymentCard(),
didYouKnow_pinAddTransactionWidgetCard(),
didYouKnow_expensesPieChart(),
rateUsCard(),
shareIvyWalletCard(),
joinIvyTelegramCard(),
rateUsCard_2(),
joinTelegram2(),
ivyWalletIsOpenSource(),
bugsApology(),
)

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:

  1. 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 of stringRes() as part of an object in the future, this will immediately introduce a bug.

  2. Remove stringRes() entirely
    stringRes() 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.

  3. 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)

@ILIYANGERMANOV
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved by the Ivy Wallet team. Ready for dev good first issue Good for newcomers help wanted Help us! Appreciated keep Keep it from automatically getting closed by Stale P1 Important but can wait user request Feature/improvement requested by an user
Projects
None yet
Development

No branches or pull requests

4 participants