Skip to content

Commit 7525a78

Browse files
committed
Merge branch 'release-1.4.0' into release
2 parents 8a9e036 + 787bd66 commit 7525a78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3804
-668
lines changed

.env.example

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ EXAMPLE_USER_PASSWORD=hellop5js
1010
GG_EXAMPLES_USERNAME=generativedesign
1111
GG_EXAMPLES_EMAIL=[email protected]
1212
GG_EXAMPLES_PASS=generativedesign
13-
ML5_LIBRARY_USERNAME=ml5
14-
ML5_LIBRARY_EMAIL=[email protected]
15-
ML5_LIBRARY_PASS=helloml5
1613
GITHUB_ID=<your-github-client-id>
1714
GITHUB_SECRET=<your-github-client-secret>
1815
GOOGLE_ID=<your-google-client-id> (use google+ api)
1916
GOOGLE_SECRET=<your-google-client-secret> (use google+ api)
2017
MAILGUN_DOMAIN=<your-mailgun-domain>
2118
MAILGUN_KEY=<your-mailgun-api-key>
19+
ML5_LIBRARY_USERNAME=ml5
20+
ML5_LIBRARY_EMAIL=[email protected]
21+
ML5_LIBRARY_PASS=helloml5
22+
MOBILE_ENABLED=true
2223
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
2324
PORT=8000
2425
S3_BUCKET=<your-s3-bucket>
2526
S3_BUCKET_URL_BASE=<alt-for-s3-url>
2627
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
28+
TRANSLATIONS_ENABLED=true
2729
UI_ACCESS_TOKEN_ENABLED=false
2830
UPLOAD_LIMIT=250000000
29-
MOBILE_ENABLED=true
File renamed without changes.

client/__mocks__/i18n.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { enUS, es, ja, hi } from 'date-fns/locale';
2+
import i18n from '../i18n-test';
3+
4+
export function languageKeyToLabel(lang) {
5+
const languageMap = {
6+
'en-US': 'English',
7+
'es-419': 'Español',
8+
ja: '日本語',
9+
hi: 'हिन्दी'
10+
};
11+
return languageMap[lang];
12+
}
13+
14+
export function languageKeyToDateLocale(lang) {
15+
const languageMap = {
16+
'en-US': enUS,
17+
'es-419': es,
18+
ja,
19+
hi
20+
};
21+
return languageMap[lang];
22+
}
23+
24+
export function currentDateLocale() {
25+
return languageKeyToDateLocale(i18n.language);
26+
}
27+
28+
export default i18n;

client/__mocks__/styleMock.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {};

client/components/Nav.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,16 @@ class Nav extends React.PureComponent {
637637
Español
638638
</button>
639639
</li>
640+
<li className="nav__dropdown-item">
641+
<button
642+
onFocus={this.handleFocusForLang}
643+
onBlur={this.handleBlur}
644+
value="pt-BR"
645+
onClick={(e) => this.handleLangSelection(e)}
646+
>
647+
Português
648+
</button>
649+
</li>
640650
<li className="nav__dropdown-item">
641651
<button
642652
onFocus={this.handleFocusForLang}
@@ -867,8 +877,6 @@ Nav.propTypes = {
867877
cmController: PropTypes.shape({
868878
tidyCode: PropTypes.func,
869879
showFind: PropTypes.func,
870-
findNext: PropTypes.func,
871-
findPrev: PropTypes.func,
872880
showReplace: PropTypes.func,
873881
getContent: PropTypes.func
874882
}),

client/components/__test__/Nav.test.jsx client/components/Nav.unit.test.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
33

4-
import { NavComponent } from '../Nav';
4+
import { NavComponent } from './Nav';
5+
6+
jest.mock('../i18n');
57

68
describe('Nav', () => {
79
const props = {

client/components/useAsModal.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import styled from 'styled-components';
3-
import { useModalBehavior } from '../utils/custom-hooks';
3+
import { useModalBehavior } from '../modules/IDE/hooks/custom-hooks';
44

55
const BackgroundOverlay = styled.div`
66
position: fixed;

client/i18n.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import i18n from 'i18next';
22
import { initReactI18next } from 'react-i18next';
33
import Backend from 'i18next-http-backend';
4-
import { enUS, es, ja, hi } from 'date-fns/locale';
4+
import { enUS, es, ja, hi, ptBR } from 'date-fns/locale';
55

66
const fallbackLng = ['en-US'];
7-
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi'];
7+
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi', 'pt-BR'];
88

99
export function languageKeyToLabel(lang) {
1010
const languageMap = {
1111
'en-US': 'English',
1212
'es-419': 'Español',
1313
ja: '日本語',
14-
hi: 'हिन्दी'
14+
hi: 'हिन्दी',
15+
'pt-BR': 'Português'
1516
};
1617
return languageMap[lang];
1718
}
@@ -21,7 +22,8 @@ export function languageKeyToDateLocale(lang) {
2122
'en-US': enUS,
2223
'es-419': es,
2324
ja,
24-
hi
25+
hi,
26+
'pt-BR': ptBR
2527
};
2628
return languageMap[lang];
2729
}
+13
Loading
+13
Loading
+13
Loading
+22
Loading

client/images/console-result-dark.svg

+22
Loading
+22
Loading

0 commit comments

Comments
 (0)