2021-04-07 17:46:07 +00:00
|
|
|
import React, { Suspense } from "react";
|
2021-03-28 21:20:05 +00:00
|
|
|
import ReactDOM from "react-dom";
|
|
|
|
import reportWebVitals from "./reportWebVitals";
|
2021-03-28 23:02:05 +00:00
|
|
|
import "bootstrap/dist/css/bootstrap.min.css";
|
2021-04-07 17:46:07 +00:00
|
|
|
import "flag-icon-css/css/flag-icon.min.css";
|
|
|
|
import i18n from "i18next";
|
|
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
|
|
|
import HttpApi from "i18next-http-backend";
|
|
|
|
|
|
|
|
import "./index.css";
|
|
|
|
import App from "./App";
|
|
|
|
|
|
|
|
i18n
|
|
|
|
.use(initReactI18next) // passes i18n down to react-i18next
|
|
|
|
.use(LanguageDetector)
|
|
|
|
.use(HttpApi)
|
|
|
|
.init({
|
|
|
|
// lng: "en",
|
|
|
|
supportedLngs: ["en", "fr"],
|
|
|
|
fallbackLng: "en",
|
|
|
|
detection: {
|
|
|
|
// "querystring",
|
|
|
|
order: ["cookie", "htmlTag", "localStorage", "path", "subdomain"],
|
|
|
|
caches: ["cookie"],
|
|
|
|
},
|
|
|
|
backend: {
|
|
|
|
loadPath: "/assets/locales/{{lng}}/translations.json",
|
|
|
|
},
|
2021-03-28 15:39:48 +00:00
|
|
|
|
2021-04-07 17:46:07 +00:00
|
|
|
react: {
|
|
|
|
useSuspense: false,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const loadingMsg = (
|
|
|
|
<div className="py-4 text-center">
|
|
|
|
<h2>Loading......</h2>
|
|
|
|
</div>
|
|
|
|
);
|
2021-03-28 15:39:48 +00:00
|
|
|
ReactDOM.render(
|
2021-04-07 17:46:07 +00:00
|
|
|
<Suspense fallback={loadingMsg}>
|
|
|
|
<React.StrictMode>
|
|
|
|
<App />
|
|
|
|
</React.StrictMode>
|
|
|
|
</Suspense>,
|
2021-03-28 21:20:05 +00:00
|
|
|
document.getElementById("root")
|
2021-03-28 15:39:48 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// If you want to start measuring performance in your app, pass a function
|
|
|
|
// to log results (for example: reportWebVitals(console.log))
|
|
|
|
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
|
|
reportWebVitals();
|