Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Revert "Implement localization - closes #558"
Browse files Browse the repository at this point in the history
  • Loading branch information
reyraa authored Sep 7, 2017
1 parent 7eb4e1e commit 8ecb0b6
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 71 deletions.
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
"bitcore-mnemonic": "=1.1.1",
"copy-to-clipboard": "=3.0.6",
"flexboxgrid": "=6.3.1",
"i18next": "^9.0.0",
"i18next-localstorage-cache": "^1.1.1",
"i18next-xhr-backend": "^1.4.2",
"lisk-js": "=0.4.5",
"moment": "=2.15.1",
"postcss": "=6.0.2",
Expand All @@ -45,7 +42,6 @@
"react-circular-progressbar": "=0.1.5",
"react-css-themr": "=2.1.2",
"react-dom": "=15.6.x",
"react-i18next": "^5.2.0",
"react-redux": "=5.0.5",
"react-router": "=4.1.2",
"react-router-dom": "=4.1.2",
Expand Down
4 changes: 0 additions & 4 deletions src/components/app/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { MemoryRouter } from 'react-router';
import { Provider } from 'react-redux';
import { expect } from 'chai';
import configureStore from 'redux-mock-store';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../i18n'; // initialized i18next instance
import App from './';
import Login from '../login';
import Transactions from '../transactions';
Expand All @@ -18,9 +16,7 @@ const addRouter = Component => (props, path) =>
mount(
<Provider {...props}>
<MemoryRouter initialEntries={path}>
<I18nextProvider i18n={ i18n }>
<Component />
</I18nextProvider>
</MemoryRouter>
</Provider>,
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const Header = props => (
})}
/>
</IconMenu>
<Button className={`${styles.button} logout-button`} raised onClick={props.logOut}>{props.t('logout')}</Button>
<Button className={`${styles.button} logout-button`} raised onClick={props.logOut}>logout</Button>
<Button className={`${styles.button} send-button ${offlineStyle.disableWhenOffline}`}
raised primary
onClick={() => props.setActiveDialog({
title: props.t('send'),
title: 'Send',
childComponent: Send,
})}>{props.t('send')}</Button>
})}>Send</Button>
</PrivateWrapper>
</header>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/header/header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe('Header', () => {
const mockInputProps = {
setActiveDialog: () => { },
account: {},
t: t => t,
};
propsMock = sinon.mock(mockInputProps);
wrapper = shallow(<Header {...mockInputProps} />);
Expand Down
4 changes: 2 additions & 2 deletions src/components/header/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { dialogDisplayed } from '../../actions/dialog';
import { accountLoggedOut } from '../../actions/account';
import Header from './header';
Expand All @@ -12,7 +11,8 @@ const mapDispatchToProps = dispatch => ({
setActiveDialog: data => dispatch(dialogDisplayed(data)),
logOut: () => dispatch(accountLoggedOut()),
});

export default connect(
mapStateToProps,
mapDispatchToProps,
)(translate()(Header));
)(Header);
8 changes: 1 addition & 7 deletions src/components/header/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { expect } from 'chai';
import { mount } from 'enzyme';
import { Provider } from 'react-redux';
import sinon from 'sinon';
import { I18nextProvider } from 'react-i18next';
import i18n from '../../i18n'; // initialized i18next instance
import * as accountActions from '../../actions/account';
import * as dialogActions from '../../actions/dialog';
import Header from './header';
Expand All @@ -16,11 +14,7 @@ describe('HeaderHOC', () => {
let wrapper;

beforeEach(() => {
wrapper = mount(<Provider store={store}>
<I18nextProvider i18n={ i18n }>
<HeaderHOC />
</I18nextProvider>
</Provider>);
wrapper = mount(<Provider store={store}><HeaderHOC /></Provider>);
});

it('should render Header', () => {
Expand Down
37 changes: 0 additions & 37 deletions src/i18n.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/locales/de/common.json

This file was deleted.

4 changes: 0 additions & 4 deletions src/locales/en/common.json

This file was deleted.

6 changes: 1 addition & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router } from 'react-router-dom';
import { Provider } from 'react-redux';
import { I18nextProvider } from 'react-i18next';
import App from './components/app';
import store from './store';
import i18n from './i18n'; // initialized i18next instance

const rootElement = document.getElementById('app');

const renderWithRouter = Component =>
<Provider store={store}>
<Router>
<I18nextProvider i18n={ i18n }>
<Component />
</I18nextProvider>
<Component />
</Router>
</Provider>;

Expand Down

0 comments on commit 8ecb0b6

Please sign in to comment.