@@ -17,6 +18,4 @@ ModerationLink.propTypes = {
isAdmin: PropTypes.bool.isRequired
};
-const lang = new I18n(translations);
-
export default ModerationLink;
diff --git a/client/coral-plugin-permalinks/PermalinkButton.js b/client/coral-plugin-permalinks/PermalinkButton.js
index 9474d1b32..1567df465 100644
--- a/client/coral-plugin-permalinks/PermalinkButton.js
+++ b/client/coral-plugin-permalinks/PermalinkButton.js
@@ -1,12 +1,11 @@
import React, {PropTypes} from 'react';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from './translations';
import onClickOutside from 'react-onclickoutside';
const name = 'coral-plugin-permalinks';
import {Button} from 'coral-ui';
import styles from './styles.css';
-const lang = new I18n(translations);
+const lang = new I18n();
class PermalinkButton extends React.Component {
diff --git a/client/coral-plugin-replies/ReplyButton.js b/client/coral-plugin-replies/ReplyButton.js
index eb2d3fe9f..a0e3d7c41 100644
--- a/client/coral-plugin-replies/ReplyButton.js
+++ b/client/coral-plugin-replies/ReplyButton.js
@@ -1,6 +1,6 @@
import React, {PropTypes} from 'react';
import {I18n} from '../coral-framework';
-import translations from './translations.json';
+
import classnames from 'classnames';
const name = 'coral-plugin-replies';
@@ -24,4 +24,4 @@ ReplyButton.propTypes = {
export default ReplyButton;
-const lang = new I18n(translations);
+const lang = new I18n();
diff --git a/client/coral-sign-in/components/CreateUsernameDialog.js b/client/coral-sign-in/components/CreateUsernameDialog.js
index 045462413..ed9a30af9 100644
--- a/client/coral-sign-in/components/CreateUsernameDialog.js
+++ b/client/coral-sign-in/components/CreateUsernameDialog.js
@@ -7,8 +7,8 @@ import FakeComment from './FakeComment';
import styles from './styles.css';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
const CreateUsernameDialog = ({open, handleClose, formData, handleSubmitUsername, handleChange, ...props}) => {
return (
diff --git a/client/coral-sign-in/components/FakeComment.js b/client/coral-sign-in/components/FakeComment.js
index ba413b755..5fabc6904 100644
--- a/client/coral-sign-in/components/FakeComment.js
+++ b/client/coral-sign-in/components/FakeComment.js
@@ -7,9 +7,8 @@ import PubDate from 'coral-plugin-pubdate/PubDate';
import {ReplyButton} from 'coral-plugin-replies';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+const lang = new I18n();
class FakeComment extends React.Component {
constructor (props) {
diff --git a/client/coral-sign-in/components/ForgotContent.js b/client/coral-sign-in/components/ForgotContent.js
index e2eb29d51..578a5b1db 100644
--- a/client/coral-sign-in/components/ForgotContent.js
+++ b/client/coral-sign-in/components/ForgotContent.js
@@ -2,8 +2,8 @@ import React from 'react';
import styles from './styles.css';
import Button from 'coral-ui/components/Button';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
class ForgotContent extends React.Component {
constructor (props) {
diff --git a/client/coral-sign-in/components/SignInContent.js b/client/coral-sign-in/components/SignInContent.js
index 2f4ed6c7e..e536a1828 100644
--- a/client/coral-sign-in/components/SignInContent.js
+++ b/client/coral-sign-in/components/SignInContent.js
@@ -2,8 +2,8 @@ import React, {PropTypes} from 'react';
import {Button, TextField, Spinner, Success, Alert} from 'coral-ui';
import styles from './styles.css';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
const SignInContent = ({
handleChange,
diff --git a/client/coral-sign-in/components/SignUpContent.js b/client/coral-sign-in/components/SignUpContent.js
index aac8d4937..e5a4cfb69 100644
--- a/client/coral-sign-in/components/SignUpContent.js
+++ b/client/coral-sign-in/components/SignUpContent.js
@@ -2,8 +2,8 @@ import React, {PropTypes} from 'react';
import {Button, TextField, Spinner, Success, Alert} from 'coral-ui';
import styles from './styles.css';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
class SignUpContent extends React.Component {
diff --git a/client/coral-sign-in/components/UserBox.js b/client/coral-sign-in/components/UserBox.js
index 59c14fa1e..88bd41dab 100644
--- a/client/coral-sign-in/components/UserBox.js
+++ b/client/coral-sign-in/components/UserBox.js
@@ -1,8 +1,8 @@
import React from 'react';
import styles from './styles.css';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
const UserBox = ({className, user, onLogout, onShowProfile}) => (
diff --git a/client/coral-sign-in/containers/ChangeUsernameContainer.js b/client/coral-sign-in/containers/ChangeUsernameContainer.js
index e94c956b8..c3b8e4406 100644
--- a/client/coral-sign-in/containers/ChangeUsernameContainer.js
+++ b/client/coral-sign-in/containers/ChangeUsernameContainer.js
@@ -7,8 +7,8 @@ import errorMsj from 'coral-framework/helpers/error';
import CreateUsernameDialog from '../components/CreateUsernameDialog';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
-const lang = new I18n(translations);
+
+const lang = new I18n();
import {
showCreateUsernameDialog,
diff --git a/client/coral-sign-in/containers/SignInContainer.js b/client/coral-sign-in/containers/SignInContainer.js
index e027acb31..4912193c8 100644
--- a/client/coral-sign-in/containers/SignInContainer.js
+++ b/client/coral-sign-in/containers/SignInContainer.js
@@ -4,9 +4,9 @@ import SignDialog from '../components/SignDialog';
import validate from 'coral-framework/helpers/validate';
import errorMsj from 'coral-framework/helpers/error';
import I18n from 'coral-i18n/modules/i18n/i18n';
-import translations from '../translations';
+
import {pym} from 'coral-framework';
-const lang = new I18n(translations);
+const lang = new I18n();
import {
changeView,
diff --git a/package.json b/package.json
index 193f30c72..1ebd5f058 100644
--- a/package.json
+++ b/package.json
@@ -98,13 +98,12 @@
"react-recaptcha": "^2.2.6",
"recompose": "^0.23.1",
"redis": "^2.7.1",
- "uuid": "^3.0.1",
- "simplemde": "^1.11.2",
- "subscriptions-transport-ws": "^0.5.5-alpha.0",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"simplemde": "^1.11.2",
+ "subscriptions-transport-ws": "^0.5.5-alpha.0",
"uuid": "^3.0.1",
+ "yaml-loader": "^0.4.0",
"yamljs": "^0.2.10"
},
"devDependencies": {
diff --git a/plugins/coral-plugin-respect/client/components/RespectButton.js b/plugins/coral-plugin-respect/client/components/RespectButton.js
index faeda1991..29ce0e8c7 100644
--- a/plugins/coral-plugin-respect/client/components/RespectButton.js
+++ b/plugins/coral-plugin-respect/client/components/RespectButton.js
@@ -2,7 +2,8 @@ import React, {Component} from 'react';
import styles from './style.css';
import Icon from './Icon';
-import {I18n} from 'coral-framework';
+import I18n from 'coral-i18n/modules/i18n/i18n';
+
import cn from 'classnames';
import translations from '../translations.json';
import {getMyActionSummary, getTotalActionCount} from 'coral-framework/utils';
diff --git a/webpack.config.js b/webpack.config.js
index 3a54e85c0..d4171bbb0 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -115,6 +115,11 @@ module.exports = {
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader'
+ },
+ {
+ test: /\.yaml$/,
+ include: path.resolve('locales'),
+ loader: 'yaml'
}
]
},
diff --git a/yarn.lock b/yarn.lock
index 20eca8209..01e7f9de0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4431,7 +4431,7 @@ js-tokens@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7"
-js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0:
+js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.5.2, js-yaml@^3.7.0:
version "3.8.3"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766"
dependencies:
@@ -8423,6 +8423,12 @@ yallist@^2.0.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
+yaml-loader@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/yaml-loader/-/yaml-loader-0.4.0.tgz#4aae447d13c1aa73a989d8a2a5309b0b1a3ca353"
+ dependencies:
+ js-yaml "^3.5.2"
+
yamljs@^0.2.10:
version "0.2.10"
resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.2.10.tgz#481cc7c25ca73af59f591f0c96e3ce56c757a40f"