From 9ab379cd7ede378421da769c2524000198369f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Let=C3=ADcia=20Camara?= Date: Fri, 12 Oct 2018 01:37:55 -0300 Subject: [PATCH] Change default locale to es --- src/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index c57d9c7..a9ca9c3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,8 @@ import React from "react"; import ReactDOM from "react-dom"; import { BrowserRouter } from 'react-router-dom'; -import { IntlProvider } from "react-intl"; +import { addLocaleData, IntlProvider } from "react-intl"; +import es from 'react-intl/locale-data/es'; // Main app component import App from "./components/App"; @@ -16,12 +17,14 @@ import "./index.css"; import messages_en from "./translations/en.json"; import messages_es from "./translations/es.json"; +addLocaleData([...es]); + const messages = { 'en': messages_en, 'es': messages_es }; -const language = 'en'; +const language = 'es'; // Add IntlProvider to make the internationalization functions visible in all // our components.