forked from Uniswap/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update i18n; kinda fix tests; remove stale dependencies (Uniswap#266)
- Loading branch information
1 parent
f8b8cd0
commit f855706
Showing
17 changed files
with
2,800 additions
and
1,939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ install: yarn | |
script: | ||
- yarn check:all | ||
- yarn build | ||
- yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
import i18n from 'i18next' | ||
import Backend from 'i18next-xhr-backend' | ||
import i18next from 'i18next' | ||
import XHR from 'i18next-xhr-backend' | ||
import LanguageDetector from 'i18next-browser-languagedetector' | ||
import { reactI18nextModule } from 'react-i18next' | ||
import { initReactI18next } from 'react-i18next' | ||
|
||
const resources = { | ||
loadPath: `./locales/{{lng}}.json` | ||
} | ||
|
||
i18n | ||
i18next | ||
// load translation using xhr -> see /public/locales | ||
// learn more: https://github.com/i18next/i18next-xhr-backend | ||
.use(Backend) | ||
// https://github.com/i18next/i18next-xhr-backend | ||
.use(XHR) | ||
// detect user language | ||
// learn more: https://github.com/i18next/i18next-browser-languageDetector | ||
// https://github.com/i18next/i18next-browser-languageDetector | ||
.use(LanguageDetector) | ||
// pass the i18n instance to react-i18next. | ||
.use(reactI18nextModule) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.use(initReactI18next) | ||
// https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
backend: resources, | ||
backend: { | ||
loadPath: './locales/{{lng}}.json' | ||
}, | ||
fallbackLng: 'en', | ||
|
||
keySeparator: false, | ||
|
||
interpolation: { | ||
escapeValue: false | ||
escapeValue: false // not needed for react as it escapes by default | ||
} | ||
}) | ||
|
||
export default i18n | ||
export default i18next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import React from 'react' | ||
import React, { Suspense } from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { Provider } from 'react-redux' | ||
import ReactGA from 'react-ga' | ||
|
||
import './i18n' | ||
import App from './pages/App' | ||
import store from './store' | ||
|
||
import './index.scss' | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
ReactGA.initialize('test', { testMode: true }) | ||
} else { | ||
if (process.env.NODE_ENV === 'production') { | ||
ReactGA.initialize('UA-128182339-1') | ||
} else { | ||
ReactGA.initialize('test', { testMode: true }) | ||
} | ||
|
||
ReactGA.pageview(window.location.pathname + window.location.search) | ||
|
||
window.addEventListener('load', function() { | ||
ReactDOM.render( | ||
ReactDOM.render( | ||
// catch the suspense in case translations are not yet loaded | ||
<Suspense fallback={null}> | ||
<Provider store={store}> | ||
<App /> | ||
</Provider>, | ||
document.getElementById('root') | ||
) | ||
}) | ||
</Provider> | ||
</Suspense>, | ||
document.getElementById('root') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.