Description
The "Language" setting allows users to change the app language. Currently commented out and only shows a Toast — not actually functional.
File: `app/src/main/java/com/example/ordermanagementcake/ui/settings/SettingsScreen.kt` (lines 112-114)
Expected Behavior
Users can select a language from the dialog and the app switches to that language immediately (or on restart).
Implementation
- Uncomment the `SettingsItem("Language", ...)` entry in `preferenceItems`.
- Replace the Toast in `LanguageDialog.onLanguageSelected` with actual locale switching logic.
- Persist the selected language preference using `DataStore` or `SharedPreferences`.
- On app launch, read the saved locale and apply it via `LocaleListCompat` (from AndroidX AppCompat) or custom configuration override.
- Update the apps `Context.createConfigurationContext()` or use `AppCompatDelegate.setApplicationLocales()` to apply the change.
- Consider adding a default/system option to revert to the device locale.
Additional Context
- `LanguageDialog` exists at `app/src/main/java/com/example/ordermanagementcake/ui/setting_options/LanguageDialog.kt` — review and update as needed.
- Ensure string resources exist for all supported languages (Tetum, Portuguese, English, etc.).
Description
The "Language" setting allows users to change the app language. Currently commented out and only shows a Toast — not actually functional.
File: `app/src/main/java/com/example/ordermanagementcake/ui/settings/SettingsScreen.kt` (lines 112-114)
Expected Behavior
Users can select a language from the dialog and the app switches to that language immediately (or on restart).
Implementation
Additional Context