[Feature Request]: Add resetLocale functionality to AppLanguageLocaleHandler #5712
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.
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
The text was updated successfully, but these errors were encountered: