Merge branch 'master' into next

This commit is contained in:
Kim Gardner
2018-01-09 11:52:20 -05:00
committed by GitHub
7 changed files with 194 additions and 186 deletions
@@ -1,5 +1,6 @@
import React from 'react';
import styles from './OffTopicFilter.css';
import {t} from 'plugin-api/beta/client/services';
export default class OffTopicFilter extends React.Component {
@@ -27,7 +28,7 @@ export default class OffTopicFilter extends React.Component {
checked={this.props.checked}
className={styles.input}
/>
Hide Off-Topic Comments
{t('hide_off_topic')}
</label>
);
}
@@ -1,14 +1,18 @@
{
"en": {
"off_topic": "Off Topic"
"off_topic": "Off Topic",
"hide_off_topic": "Hide Off-Topic Comments"
},
"es": {
"off_topic": "Fuera de Topico"
"off_topic": "Fuera de Tópico",
"hide_off_topic": "Hide Off-Topic Comments"
},
"zh_CN": {
"off_topic": "无关主题"
"off_topic": "无关主题",
"hide_off_topic": "隐藏与主题无关评论"
},
"zh_TW": {
"off_topic": "無關主題"
"off_topic": "無關主題",
"hide_off_topic": "隱藏與主題無關評論"
}
}
@@ -5,6 +5,7 @@ const config = {
API_KEY: process.env.TALK_PERSPECTIVE_API_KEY,
THRESHOLD: process.env.TALK_TOXICITY_THRESHOLD || 0.8,
API_TIMEOUT: ms(process.env.TALK_PERSPECTIVE_TIMEOUT || '300ms'),
DO_NOT_STORE: process.env.TALK_PERSPECTIVE_DO_NOT_STORE || true,
};
if (process.env.NODE_ENV !== 'test' && !config.API_KEY) {
@@ -1,5 +1,5 @@
const fetch = require('node-fetch');
const {API_ENDPOINT, API_KEY, THRESHOLD, API_TIMEOUT} = require('./config');
const {API_ENDPOINT, API_KEY, THRESHOLD, API_TIMEOUT, DO_NOT_STORE} = require('./config');
/**
* Get scores from the perspective api
@@ -20,6 +20,7 @@ async function getScores(text) {
// TODO: support other languages.
languages: ['en'],
doNotStore: DO_NOT_STORE,
requestedAttributes: {
TOXICITY: {},
SEVERE_TOXICITY: {},