Skip to content

Conversation

@nesquikm
Copy link

Problem

On Android 13+ (API 33+), reading and setting per-app language via AppCompatDelegate doesn't properly sync with the system's per-app
language settings. This causes:

  • Language selected in-app not reflecting in Android Settings → App Languages
  • Language set via Android Settings not being read correctly by getLanguage()

Solution

Use LocaleManager API directly for Android 13+:

  • getCurrentLanguage() now reads from localeManager.applicationLocales
  • setCurrentLanguage() now writes to localeManager.applicationLocales

Falls back to existing AppCompatDelegate behavior for older Android versions (< API 33).

Changes

  • Modified LocalizationSettingsModule.kt to use system LocaleManager for API 33+
  • Added imports for LocaleManager and LocaleList
  • Maintained backward compatibility with older Android APIs

Testing

  • Tested on Android 16 device
  • Verified language changes sync bidirectionally with Android Settings
  • Confirmed backward compatibility with older APIs

- Use LocaleManager.applicationLocales for both GET and SET operations
- This ensures language changes sync properly with Android Settings
- Fixes issue where AppCompatDelegate didn't update system settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant