diff --git a/src/components/App/__snapshots__/test.js.snap b/src/components/App/__snapshots__/test.js.snap index b00feff..cf2c86c 100644 --- a/src/components/App/__snapshots__/test.js.snap +++ b/src/components/App/__snapshots__/test.js.snap @@ -113,7 +113,7 @@ exports[`App rendering an expression 2`] = ` ] } /> - + `; @@ -248,7 +248,7 @@ exports[`App rendering with an invalid syntax 2`] = ` ] } /> - + `; diff --git a/src/components/Loader/__snapshots__/test.js.snap b/src/components/Loader/__snapshots__/test.js.snap index 0aba97d..29fa6a5 100644 --- a/src/components/Loader/__snapshots__/test.js.snap +++ b/src/components/Loader/__snapshots__/test.js.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Loader rendering 1`] = ` - +
@@ -73,7 +75,7 @@ exports[`Loader rendering 1`] = `
- Loading... + TRANSLATE(Loading...)
diff --git a/src/components/Loader/index.js b/src/components/Loader/index.js index a08241e..ce571ee 100644 --- a/src/components/Loader/index.js +++ b/src/components/Loader/index.js @@ -1,14 +1,21 @@ import React from 'react'; +import PropTypes from 'prop-types'; +import { withNamespaces } from 'react-i18next'; import LoaderIcon from 'react-feather/dist/icons/loader'; import style from './style.module.css'; -const Loader = () => ( +const Loader = ({ t }) => (
-
Loading...
+
{ t('Loading...') }
); -export default Loader; +Loader.propTypes = { + t: PropTypes.func.isRequired +}; + +export { Loader }; +export default withNamespaces()(Loader); diff --git a/src/components/Loader/test.js b/src/components/Loader/test.js index 5bddc0a..c463c51 100644 --- a/src/components/Loader/test.js +++ b/src/components/Loader/test.js @@ -1,14 +1,15 @@ import React from 'react'; import { mount } from 'enzyme'; -import Loader from 'components/Loader'; +import { mockT } from 'i18n'; +import { Loader } from 'components/Loader'; describe('Loader', () => { test('rendering', () => { // Using full rendering here since styles for this depend on the structure // of the SVG. const component = mount( - + ); expect(component).toMatchSnapshot(); }); diff --git a/src/locales/en-AC.yaml b/src/locales/en-AC.yaml index d166778..be26725 100644 --- a/src/locales/en-AC.yaml +++ b/src/locales/en-AC.yaml @@ -63,3 +63,5 @@ DOWNLOAD SVG "Download PNG": | DOWNLOAD PNG +"Loading...": | + LOADING... diff --git a/src/locales/en.yaml b/src/locales/en.yaml index 0147e53..b185462 100644 --- a/src/locales/en.yaml +++ b/src/locales/en.yaml @@ -63,3 +63,5 @@ Download SVG "Download PNG": | Download PNG +"Loading...": | + Loading...