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

Load language from OS #3180

Merged
merged 9 commits into from
Nov 13, 2019
Merged

Load language from OS #3180

merged 9 commits into from
Nov 13, 2019

Conversation

kauffj
Copy link
Member

@kauffj kauffj commented Nov 5, 2019

This improves #3018 to allow ui.js to load immediately without waiting for language files to load.

@kauffj kauffj requested a review from neb-b November 5, 2019 18:57
@lbry-bot lbry-bot assigned neb-b and unassigned kauffj Nov 5, 2019
fetch('https://lbry.com/i18n/get/lbry-desktop/app-strings/' + language + '.json')
.then(r => r.json())
.then(j => {
window.i18n_messages[language] = j;
Copy link
Member Author

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.

Copy link

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

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Nov 5, 2019
Copy link

@neb-b neb-b left a 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';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from 'constants/supported_languages'

@lbry-bot lbry-bot assigned kauffj and unassigned neb-b Nov 5, 2019
@kauffj kauffj changed the title Load OS from user settings Load language from OS Nov 6, 2019
@kauffj kauffj requested a review from neb-b November 12, 2019 22:26
@lbry-bot lbry-bot assigned neb-b and unassigned kauffj Nov 12, 2019
@kauffj kauffj mentioned this pull request Nov 13, 2019
9 tasks
@neb-b neb-b merged commit 5da78c9 into master Nov 13, 2019
@lyoshenka lyoshenka deleted the peterjgrainger-master branch June 15, 2020 19:13
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.

None yet

3 participants