Switching language via system language chooser results in incorrect metadata
- F-Droid version: 0.104
- F-Droid privileged extension version: N/A
What works as expected
- System language set to en-US, F-Droid language set to System Default
- Open F-Droid and disable/re-enable F-Droid repository
- View Nextcloud (dev) app (which has both en-US and de-DE translations)
- See descriptions in English
- With the above settings:
- Change F-Droid language to de-DE
- F-Droid will force a repo update
- During this repo update it will purge the metadata and rebuild it with the correct locale.
- View Nextcloud (dev)
- See descriptions in de-DE
- Repeat, but changing F_Droid language back to en-US (or System Default)
- Should force repo update and switch to English.
What doesn't work
All of the above, but when changing the system language instead of the F-Droid language.
Proposed solution
When doing a repo update, store a shared preference (or in the database next to lastUpdateTime
) the locale which F-Droid was using when it pulled the metadata down last time. In FDroidApp#onResume()
or something similar, check the locale of F-Droid and match it up to the locale of the last repo updates. If different, force an update using the same mechanism that the preferences do when changing the language within F-Droid. This might become a little trickier in >= 7.1 with language preferences, rather than a single language preference.
This is not a particularly high priority, because people would change system languages only infrequently, but I suspect the point of a language chooser in F-Droid is for them to investigate and see if they can get a good translation in their local language.