fix(mobile): fixes on language change #14089
Open
+59
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes several problems around the flow of changing language:
[SettingsSubPage, SettingsPage, LibraryPage]
stay in the old language.context.locale
toDateFormat
, by defaultIntl
uses the system's locale. This means that even after selecting a language in the immich settings, the dates will stay in the system's language.localeProvider
that can be used inside other providers to invalidate them whenever the locale is changed. This is needed because immich has providers that cache UI elements. I added thelocaleProvider
only to the asset providers of the photos page but I am sure someone with more knowledge of the codebase can find other instances where it's needed.Before fix:
not_fixed.mp4
After fix:
As you can see when changing language both settings and photo grid get updated.
fixed.mp4