Skip to content

Commit a7a03b9

Browse files
authored
Merge branch 'develop' into Ukrainian-Translation
2 parents 202a9dc + 718ea1e commit a7a03b9

File tree

5 files changed

+641
-6
lines changed

5 files changed

+641
-6
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"tabWidth": 2,
1515
"trailingComma": "none",
1616
"useTabs": false,
17-
"quoteProps": "as-needed"
17+
"quoteProps": "as-needed",
18+
"endOfLine":"auto"
1819
}

client/components/Nav.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,16 @@ class Nav extends React.PureComponent {
647647
Português
648648
</button>
649649
</li>
650+
<li className="nav__dropdown-item">
651+
<button
652+
onFocus={this.handleFocusForLang}
653+
onBlur={this.handleBlur}
654+
value="de"
655+
onClick={(e) => this.handleLangSelection(e)}
656+
>
657+
Deutsch
658+
</button>
659+
</li>
650660
<li className="nav__dropdown-item">
651661
<button
652662
onFocus={this.handleFocusForLang}

client/i18n.js

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

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

99
export function languageKeyToLabel(lang) {
1010
const languageMap = {
@@ -13,6 +13,7 @@ export function languageKeyToLabel(lang) {
1313
ja: '日本語',
1414
hi: 'हिन्दी',
1515
'pt-BR': 'Português',
16+
de: 'Deutsch',
1617
'uk-UA': 'Українська'
1718
};
1819
return languageMap[lang];
@@ -23,7 +24,8 @@ export function languageKeyToDateLocale(lang) {
2324
'en-US': enUS,
2425
'es-419': es,
2526
ja,
26-
hi,
27+
hi,
28+
de,
2729
'pt-BR': ptBR,
2830
'uk-UA': uk
2931
};

client/modules/User/pages/DashboardView.jsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import AssetList from '../../IDE/components/AssetList';
1111
import AssetSize from '../../IDE/components/AssetSize';
1212
import CollectionList from '../../IDE/components/CollectionList';
1313
import SketchList from '../../IDE/components/SketchList';
14+
import * as ProjectActions from '../../IDE/actions/project';
1415
import {
1516
CollectionSearchbar,
1617
SketchSearchbar
@@ -29,6 +30,7 @@ class DashboardView extends React.Component {
2930
constructor(props) {
3031
super(props);
3132
this.closeAccountPage = this.closeAccountPage.bind(this);
33+
this.createNewSketch = this.createNewSketch.bind(this);
3234
this.gotoHomePage = this.gotoHomePage.bind(this);
3335
this.toggleCollectionCreate = this.toggleCollectionCreate.bind(this);
3436
this.state = {
@@ -44,6 +46,10 @@ class DashboardView extends React.Component {
4446
browserHistory.push(this.props.previousPath);
4547
}
4648

49+
createNewSketch() {
50+
this.props.newProject();
51+
}
52+
4753
gotoHomePage() {
4854
browserHistory.push('/');
4955
}
@@ -98,7 +104,9 @@ class DashboardView extends React.Component {
98104
return (
99105
<React.Fragment>
100106
{this.isOwner() && (
101-
<Button to="/">{t('DashboardView.NewSketch')}</Button>
107+
<Button onClick={this.createNewSketch}>
108+
{t('DashboardView.NewSketch')}
109+
</Button>
102110
)}
103111
<SketchSearchbar />
104112
</React.Fragment>
@@ -170,7 +178,12 @@ function mapStateToProps(state) {
170178
};
171179
}
172180

181+
const mapDispatchToProps = {
182+
...ProjectActions
183+
};
184+
173185
DashboardView.propTypes = {
186+
newProject: PropTypes.func.isRequired,
174187
location: PropTypes.shape({
175188
pathname: PropTypes.string.isRequired
176189
}).isRequired,
@@ -185,4 +198,6 @@ DashboardView.propTypes = {
185198
t: PropTypes.func.isRequired
186199
};
187200

188-
export default withTranslation()(connect(mapStateToProps)(DashboardView));
201+
export default withTranslation()(
202+
connect(mapStateToProps, mapDispatchToProps)(DashboardView)
203+
);

0 commit comments

Comments
 (0)