Skip to content

Commit ab44b48

Browse files
committed
Merge branch 'processing-develop' into chinese
2 parents 7f3923e + 841c77a commit ab44b48

File tree

4 files changed

+634
-17
lines changed

4 files changed

+634
-17
lines changed

client/components/Nav.jsx

Lines changed: 16 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,20 @@ 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+
हिन्दी
658668
</button>
659669
</li>
660670
<li className="nav__dropdown-item">
@@ -681,10 +691,10 @@ class Nav extends React.PureComponent {
681691
<button
682692
onFocus={this.handleFocusForLang}
683693
onBlur={this.handleBlur}
684-
value="hi"
694+
value="pt-BR"
685695
onClick={(e) => this.handleLangSelection(e)}
686696
>
687-
हिन्दी
697+
Português
688698
</button>
689699
</li>
690700
</ul>

client/i18n.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
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, zhCN } from 'date-fns/locale';
4+
import { enUS, es, ja, hi, ptBR, de, frCA, zhCN } from 'date-fns/locale';
55

66
const fallbackLng = ['en-US'];
77
const availableLanguages = [
8+
'de',
89
'en-US',
910
'es-419',
10-
'ja',
11+
'fr-CA',
1112
'hi',
13+
'ja',
1214
'pt-BR',
13-
'de',
1415
'zh-CN'
1516
];
1617

1718
export function languageKeyToLabel(lang) {
1819
const languageMap = {
20+
de: 'Deutsch',
1921
'en-US': 'English',
2022
'es-419': 'Español',
21-
ja: '日本語',
23+
'fr-CA': 'Français',
2224
hi: 'हिन्दी',
25+
ja: '日本語',
2326
'pt-BR': 'Português',
24-
de: 'Deutsch',
2527
'zh-CN': '简体中文'
2628
};
2729
return languageMap[lang];
2830
}
2931

3032
export function languageKeyToDateLocale(lang) {
3133
const languageMap = {
34+
de,
3235
'en-US': enUS,
3336
'es-419': es,
34-
ja,
37+
'fr-CA': frCA,
3538
hi,
36-
de,
39+
ja,
3740
'pt-BR': ptBR,
3841
'zh-CN': zhCN
3942
};

client/modules/IDE/components/Editor.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

0 commit comments

Comments
 (0)