-
Notifications
You must be signed in to change notification settings - Fork 413
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
Load language from OS #3180
Load language from OS #3180
Conversation
src/ui/redux/actions/settings.js
Outdated
fetch('https://lbry.com/i18n/get/lbry-desktop/app-strings/' + language + '.json') | ||
.then(r => r.json()) | ||
.then(j => { | ||
window.i18n_messages[language] = j; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanyesmunt is there a technique we can use to force/always trigger a complete re-render when window.i18n_messages[language]
was not already set?
The only known time we are failing to re-render is when manually refreshing in app-mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can set a value in redux here, then pass that value in as a prop to the top level <App/>
component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One import statement issue.
language
also doesn't look like a word now
@@ -3,44 +3,27 @@ | |||
import React, { useState } from 'react'; | |||
import { FormField } from 'component/common/form'; | |||
import Spinner from 'component/spinner'; | |||
import { SETTINGS } from 'lbry-redux'; | |||
import SUPPORTED_LANGUAGES from '../../constants/supported_languages'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from 'constants/supported_languages'
9081083
to
5aa09b6
Compare
This improves #3018 to allow
ui.js
to load immediately without waiting for language files to load.