Skip to content

Commit 65ac0d4

Browse files
committed
Merge branch 'release-2.0.3' into release
2 parents 4bd8857 + c539dbe commit 65ac0d4

File tree

9 files changed

+1266
-339
lines changed

9 files changed

+1266
-339
lines changed

client/components/Nav.jsx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,16 @@ class Nav extends React.PureComponent {
617617
/>
618618
</button>
619619
<ul className="nav__dropdown">
620+
<li className="nav__dropdown-item">
621+
<button
622+
onFocus={this.handleFocusForLang}
623+
onBlur={this.handleBlur}
624+
value="de"
625+
onClick={(e) => this.handleLangSelection(e)}
626+
>
627+
Deutsch
628+
</button>
629+
</li>
620630
<li className="nav__dropdown-item">
621631
<button
622632
onFocus={this.handleFocusForLang}
@@ -641,20 +651,30 @@ class Nav extends React.PureComponent {
641651
<button
642652
onFocus={this.handleFocusForLang}
643653
onBlur={this.handleBlur}
644-
value="pt-BR"
654+
value="fr-CA"
645655
onClick={(e) => this.handleLangSelection(e)}
646656
>
647-
Português
657+
Français
648658
</button>
649659
</li>
650660
<li className="nav__dropdown-item">
651661
<button
652662
onFocus={this.handleFocusForLang}
653663
onBlur={this.handleBlur}
654-
value="de"
664+
value="hi"
655665
onClick={(e) => this.handleLangSelection(e)}
656666
>
657-
Deutsch
667+
हिन्दी
668+
</button>
669+
</li>
670+
<li className="nav__dropdown-item">
671+
<button
672+
onFocus={this.handleFocusForLang}
673+
onBlur={this.handleBlur}
674+
value="zh-CN"
675+
onClick={(e) => this.handleLangSelection(e)}
676+
>
677+
简体中文
658678
</button>
659679
</li>
660680
<li className="nav__dropdown-item">
@@ -671,10 +691,10 @@ class Nav extends React.PureComponent {
671691
<button
672692
onFocus={this.handleFocusForLang}
673693
onBlur={this.handleBlur}
674-
value="hi"
694+
value="pt-BR"
675695
onClick={(e) => this.handleLangSelection(e)}
676696
>
677-
हिन्दी
697+
Português
678698
</button>
679699
</li>
680700
</ul>

client/i18n.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33
import Backend from 'i18next-http-backend';
4-
import { enUS, es, ja, hi, ptBR, de } from 'date-fns/locale';
4+
import { enUS, es, ja, hi, ptBR, de, frCA, zhCN } from 'date-fns/locale';
55

66
const fallbackLng = ['en-US'];
7-
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi', 'pt-BR', 'de'];
7+
const availableLanguages = [
8+
'de',
9+
'en-US',
10+
'es-419',
11+
'fr-CA',
12+
'hi',
13+
'ja',
14+
'pt-BR',
15+
'zh-CN'
16+
];
817

918
export function languageKeyToLabel(lang) {
1019
const languageMap = {
20+
de: 'Deutsch',
1121
'en-US': 'English',
1222
'es-419': 'Español',
13-
ja: '日本語',
23+
'fr-CA': 'Français',
1424
hi: 'हिन्दी',
25+
ja: '日本語',
1526
'pt-BR': 'Português',
16-
de: 'Deutsch'
27+
'zh-CN': '简体中文'
1728
};
1829
return languageMap[lang];
1930
}
2031

2132
export function languageKeyToDateLocale(lang) {
2233
const languageMap = {
34+
de,
2335
'en-US': enUS,
2436
'es-419': es,
25-
ja,
37+
'fr-CA': frCA,
2638
hi,
27-
de,
28-
'pt-BR': ptBR
39+
ja,
40+
'pt-BR': ptBR,
41+
'zh-CN': zhCN
2942
};
3043
return languageMap[lang];
3144
}

client/modules/IDE/components/Editor.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import cssParser from 'prettier/parser-postcss';
99
import { withTranslation } from 'react-i18next';
1010
import StackTrace from 'stacktrace-js';
1111
import 'codemirror/mode/css/css';
12+
import 'codemirror/mode/clike/clike';
1213
import 'codemirror/addon/selection/active-line';
1314
import 'codemirror/addon/lint/lint';
1415
import 'codemirror/addon/lint/javascript-lint';
@@ -38,7 +39,6 @@ import { connect } from 'react-redux';
3839
import { bindActionCreators } from 'redux';
3940
import '../../../utils/htmlmixed';
4041
import '../../../utils/p5-javascript';
41-
import '../../../utils/webGL-clike';
4242
import Timer from '../components/Timer';
4343
import EditorAccessibility from '../components/EditorAccessibility';
4444
import { metaKey } from '../../../utils/metaKey';
@@ -212,10 +212,7 @@ class Editor extends React.Component {
212212
}
213213

214214
componentDidUpdate(prevProps) {
215-
if (
216-
this.props.file.content !== prevProps.file.content &&
217-
this.props.file.content !== this._cm.getValue()
218-
) {
215+
if (this.props.file.id !== prevProps.file.id) {
219216
const oldDoc = this._cm.swapDoc(this._docs[this.props.file.id]);
220217
this._docs[prevProps.file.id] = oldDoc;
221218
this._cm.focus();
@@ -304,8 +301,10 @@ class Editor extends React.Component {
304301
mode = 'htmlmixed';
305302
} else if (fileName.match(/.+\.json$/i)) {
306303
mode = 'application/json';
307-
} else if (fileName.match(/.+\.(frag|vert)$/i)) {
308-
mode = 'clike';
304+
} else if (fileName.match(/.+\.(frag|glsl)$/i)) {
305+
mode = 'x-shader/x-fragment';
306+
} else if (fileName.match(/.+\.(vert)$/i)) {
307+
mode = 'x-shader/x-vertex';
309308
} else {
310309
mode = 'text/plain';
311310
}

client/modules/IDE/components/PreviewFrame.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ function PreviewFrame({ fullView }) {
2424
const frameUrl = previewUrl;
2525
const sandboxAttributes = `allow-forms allow-modals allow-pointer-lock allow-popups
2626
allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-downloads`;
27-
const allow =
28-
'accelerometer; autoplay; camera; encrypted-media; geolocation; gyroscope; microphone; magnetometer; midi; vr;';
27+
const allow = `accelerometer; autoplay; camera; encrypted-media; geolocation;
28+
gyroscope; microphone; magnetometer; midi; serial; vr;`;
2929
return (
3030
<Frame
3131
title="sketch preview"

0 commit comments

Comments
 (0)