- DNS Queries
- |
@@ -23,8 +24,8 @@ const Counters = props => ( |
- Blocked by Filters
- |
@@ -34,8 +35,8 @@ const Counters = props => ( |
- Blocked malware/phishing
- |
@@ -45,8 +46,8 @@ const Counters = props => ( |
- Blocked adult websites
- |
@@ -56,8 +57,8 @@ const Counters = props => ( |
- Enforced safe search
- |
@@ -67,8 +68,8 @@ const Counters = props => ( |
- Average processing time
- |
@@ -89,6 +90,7 @@ Counters.propTypes = {
replacedSafesearch: PropTypes.number.isRequired,
avgProcessingTime: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired,
+ t: PropTypes.func,
};
-export default Counters;
+export default withNamespaces()(Counters);
diff --git a/client/src/components/Dashboard/QueriedDomains.js b/client/src/components/Dashboard/QueriedDomains.js
index 045ceb6c..fd30f0eb 100644
--- a/client/src/components/Dashboard/QueriedDomains.js
+++ b/client/src/components/Dashboard/QueriedDomains.js
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import ReactTable from 'react-table';
import PropTypes from 'prop-types';
import map from 'lodash/map';
+import { withNamespaces, Trans } from 'react-i18next';
import Card from '../ui/Card';
import Cell from '../ui/Cell';
@@ -38,7 +39,7 @@ class QueriedDomains extends Component {
);
},
}, {
- Header: 'Requests count',
+ Header:
- DNS Queries
+
@@ -48,7 +49,7 @@ class Statistics extends Component {
{getPercent(dnsQueries, blockedFiltering)}
@@ -66,7 +67,7 @@ class Statistics extends Component {
{getPercent(dnsQueries, replacedSafebrowsing)}
- Blocked malware/phishing
+
@@ -84,7 +85,7 @@ class Statistics extends Component {
{getPercent(dnsQueries, replacedParental)}
- Blocked adult websites
+
diff --git a/client/src/components/Dashboard/index.js b/client/src/components/Dashboard/index.js
index bf49b2a4..c8d43a2a 100644
--- a/client/src/components/Dashboard/index.js
+++ b/client/src/components/Dashboard/index.js
@@ -1,6 +1,7 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import 'whatwg-fetch';
+import { Trans, withNamespaces } from 'react-i18next';
import Statistics from './Statistics';
import Counters from './Counters';
@@ -30,25 +31,25 @@ class Dashboard extends Component {
return (
);
}
render() {
- const { dashboard } = this.props;
+ const { dashboard, t } = this.props;
const dashboardProcessing =
dashboard.processing ||
dashboard.processingStats ||
dashboard.processingStatsHistory ||
dashboard.processingTopStats;
- const refreshFullButton = ;
+ const refreshFullButton = ;
const refreshButton =
diff --git a/client/src/i18n.js b/client/src/i18n.js
new file mode 100644
index 00000000..cf5bfb71
--- /dev/null
+++ b/client/src/i18n.js
@@ -0,0 +1,25 @@
+
+import i18n from 'i18next';
+import { reactI18nextModule } from 'react-i18next';
+import langDetect from 'i18next-browser-languagedetector';
+import viResource from './__locales/vi';
+
+i18n
+ .use(langDetect)
+ .use(reactI18nextModule) // passes i18n down to react-i18next
+ .init({
+ resources: {
+ vi: viResource,
+ },
+ fallbackLng: 'en',
+ keySeparator: false, // we use content as keys
+ interpolation: {
+ escapeValue: false, // not needed for react!!
+ formatSeparator: ',',
+ },
+ react: {
+ wait: true,
+ },
+ });
+
+export default i18n;
diff --git a/client/src/index.js b/client/src/index.js
index 16465633..1e95a210 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -5,6 +5,7 @@ import './components/App/index.css';
import App from './containers/App';
import configureStore from './configureStore';
import reducers from './reducers';
+import './i18n';
const store = configureStore(reducers, {}); // set initial state
ReactDOM.render(
|