Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render whole app on language change #7504

Merged
merged 1 commit into from
Mar 7, 2022
Merged

Render whole app on language change #7504

merged 1 commit into from
Mar 7, 2022

Conversation

infinite-persistence
Copy link
Contributor

Issues

  1. We were manually adding selectLanguage(state) as a prop to components used in Settings Page to trigger a render. Flaws:

    • Unclear that the unused prop is just to trigger a render.
    • Manually adding on a case-by-case basis will break over time (missed component).
  2. The translation file fetching is delayed (at least in Odysee) and also takes time, so the GUI will end up having mixed strings on F5, depending on when the fetch completed.

Approach

Make the app wrapper have a key that's tied to the language and translation data, so the entire app renders when language changes. Seems like a common design in most apps.

Ticket

odysee 921

## Issues
1. We were manually adding `selectLanguage(state)` as a prop to components used in Settings Page to trigger a render. Flaws:
    - Unclear that the unused prop is just to trigger a render.
    - Manually adding on a case-by-case basis will break over time (missed component).

2. The translation file fetching is delayed (at least in Odysee) and also takes time, so the GUI will end up having mixed strings on F5, depending on when the fetch completed.

## Approach
Make the app wrapper have a key that's tied to the language and translation data, so the entire app renders when language changes. Seems like a common design in most apps.

## Ticket
odysee 921
@jessopb
Copy link
Member

jessopb commented Mar 4, 2022

💯

@jessopb jessopb merged commit cef9ade into master Mar 7, 2022
@jessopb jessopb deleted the lang.update branch March 7, 2022 14:40
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.

2 participants