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 Request]: Add resetLocale functionality to AppLanguageLocaleHandler #5712

Open
aadityaverma2011 opened this issue Feb 22, 2025 · 1 comment · May be fixed by #5713
Open

[Feature Request]: Add resetLocale functionality to AppLanguageLocaleHandler #5712

aadityaverma2011 opened this issue Feb 22, 2025 · 1 comment · May be fixed by #5713
Assignees
Labels
enhancement End user-perceivable enhancements. Impact: Low Low perceived user impact (e.g. edge cases). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.

Comments

@aadityaverma2011
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, managing locale changes in the Oppia Android app requires reinitializing or updating the locale manually. This leads to duplicated code and potential inconsistencies when a reset of the locale to its default state is needed. For example, during testing or when reverting user changes, there's no standard mechanism to reset the locale across the app.

Additionally, there is no direct way for other classes to trigger a locale reset when needed. By adding a resetLocale() function to AppLanguageLocaleHandler, any class that requires a locale reset can utilize this function, ensuring a consistent and centralized approach to locale management.

Describe the solution you'd like

propose adding a resetLocale() function to the AppLanguageLocaleHandler class. This function would:

Check if the locale has been initialized.
If not, initialize it using the system's default app string locale context.
If it is already initialized, reconstitute and update the display locale based on the current default from the LocaleController.
This approach ensures that the app always has a reliable, single source of truth for the display locale, and it simplifies resetting the locale in both production and testing scenarios.

Describe alternatives you've considered

No response

Additional context

No response

@aadityaverma2011 aadityaverma2011 added enhancement End user-perceivable enhancements. triage needed labels Feb 22, 2025
@aadityaverma2011 aadityaverma2011 changed the title [Feature Request]: Add resetLocale() function to AppLanguageLocaleHandler [Feature Request]: Add resetLocale functionality to AppLanguageLocaleHandler Feb 22, 2025
@adhiamboperes
Copy link
Collaborator

@aadityaverma2011, what kind of user changes, per "when reverting user changes", require a locale update?

@adhiamboperes adhiamboperes added Impact: Low Low perceived user impact (e.g. edge cases). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. and removed triage needed labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement End user-perceivable enhancements. Impact: Low Low perceived user impact (e.g. edge cases). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.
Development

Successfully merging a pull request may close this issue.

3 participants