This file contains hidden or 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
import i18n from 'i18next'; | |
import Backend from 'i18next-xhr-backend'; | |
import LanguageDetector from 'i18next-browser-languagedetector'; | |
import { initReactI18next } from 'react-i18next'; | |
i18n | |
.use(Backend) | |
.use(LanguageDetector) | |
.use(initReactI18next) | |
.init({ |
This file contains hidden or 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
import { FormControl, MenuItem, Select } from '@material-ui/core'; | |
import React, { useState } from 'react'; | |
import { useTranslation } from 'react-i18next'; | |
import { useHistory } from 'react-router-dom'; | |
const Language = () => { | |
const history = useHistory(); | |
const { i18n } = useTranslation(); | |
const [dropdownLang, setDropdownLang] = useState(i18n.language || 'en'); |
This file contains hidden or 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
import React from 'react'; | |
import { useTranslation } from 'react-i18next'; | |
const Flag = () => { | |
const { i18n } = useTranslation(); | |
const flagSvg = require(`./${i18n.language}.svg`); | |
return <img style={{ maxWidth: '50%' }} src={flagSvg} alt="flag" />; | |
}; |
This file contains hidden or 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
import React from 'react'; | |
import { useTranslation } from 'react-i18next'; | |
const Intro = () => { | |
const { t } = useTranslation(); | |
return <h1>{t('intro-title')}</h1>; | |
}; | |
export default Intro; |
This file contains hidden or 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
import React, { Suspense } from 'react'; | |
import Intro from './components/Intro/Intro'; | |
import Flag from './components/Flag/Flag'; | |
import Language from './components/Language/Language'; | |
import './App.css'; | |
const App = () => { | |
return ( | |
<Suspense fallback={<p>Loading Translations ...</p>}> | |
<div className="App"> |
This file contains hidden or 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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import { BrowserRouter, Route } from 'react-router-dom'; | |
import * as serviceWorker from './serviceWorker'; | |
import './i18n'; |
This file contains hidden or 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
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |