mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-01 07:45:36 -05:00
Merge pull request #2213 from chrisgarrity/issue/2172-integrate-intl
Integrate www-gui localization
This commit is contained in:
commit
fdeab4de05
1 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,7 @@ const render = require('../../lib/render.jsx');
|
||||||
const storage = require('../../lib/storage.js').default;
|
const storage = require('../../lib/storage.js').default;
|
||||||
const log = require('../../lib/log');
|
const log = require('../../lib/log');
|
||||||
const EXTENSION_INFO = require('../../lib/extensions.js').default;
|
const EXTENSION_INFO = require('../../lib/extensions.js').default;
|
||||||
|
const jar = require('../../lib/jar.js');
|
||||||
|
|
||||||
const PreviewPresentation = require('./presentation.jsx');
|
const PreviewPresentation = require('./presentation.jsx');
|
||||||
const projectShape = require('./projectshape.jsx').projectShape;
|
const projectShape = require('./projectshape.jsx').projectShape;
|
||||||
|
@ -332,6 +333,9 @@ class Preview extends React.Component {
|
||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
handleSetLanguage (locale) {
|
||||||
|
jar.set('scratchlanguage', locale);
|
||||||
|
}
|
||||||
handleUpdateProjectId (projectId, callback) {
|
handleUpdateProjectId (projectId, callback) {
|
||||||
this.setState({projectId: projectId}, () => {
|
this.setState({projectId: projectId}, () => {
|
||||||
const parts = window.location.pathname.toLowerCase()
|
const parts = window.location.pathname.toLowerCase()
|
||||||
|
@ -444,6 +448,7 @@ class Preview extends React.Component {
|
||||||
renderLogin={this.renderLogin}
|
renderLogin={this.renderLogin}
|
||||||
onLogOut={this.props.handleLogOut}
|
onLogOut={this.props.handleLogOut}
|
||||||
onOpenRegistration={this.props.handleOpenRegistration}
|
onOpenRegistration={this.props.handleOpenRegistration}
|
||||||
|
onSetLanguage={this.handleSetLanguage}
|
||||||
onShare={this.handleShare}
|
onShare={this.handleShare}
|
||||||
onToggleLoginOpen={this.props.handleToggleLoginOpen}
|
onToggleLoginOpen={this.props.handleToggleLoginOpen}
|
||||||
onUpdateProjectId={this.handleUpdateProjectId}
|
onUpdateProjectId={this.handleUpdateProjectId}
|
||||||
|
@ -707,6 +712,9 @@ render(
|
||||||
preview: previewActions.previewReducer,
|
preview: previewActions.previewReducer,
|
||||||
...GUI.guiReducers
|
...GUI.guiReducers
|
||||||
},
|
},
|
||||||
{scratchGui: initGuiState(GUI.guiInitialState)},
|
{
|
||||||
|
locales: GUI.initLocale(GUI.localesInitialState, window._locale),
|
||||||
|
scratchGui: initGuiState(GUI.guiInitialState)
|
||||||
|
},
|
||||||
GUI.guiMiddleware
|
GUI.guiMiddleware
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue