mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 00:52:27 +08:00
Merge branch 'master' into FE_Plugin_DOCS
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
import React, {PropTypes} from 'react';
|
||||
import styles from './CommentCount.css';
|
||||
import I18n from 'coral-framework/modules/i18n/i18n';
|
||||
import translations from 'coral-admin/src/translations.json';
|
||||
const lang = new I18n(translations);
|
||||
|
||||
const CommentCount = props => (
|
||||
<span className={styles.count}>{props.count}</span>
|
||||
);
|
||||
const CommentCount = ({count}) => {
|
||||
let number = count;
|
||||
|
||||
// shorten large counts to abbreviations
|
||||
if (number / 1e9 > 1) {
|
||||
number = `${(number / 1e9).toFixed(1)}${lang.t('modqueue.billion')}`;
|
||||
} else if (number / 1e6 > 1) {
|
||||
number = `${(number / 1e6).toFixed(1)}${lang.t('modqueue.million')}`;
|
||||
} else if (number / 1e3 > 1) {
|
||||
number = `${(number / 1e3).toFixed(1)}${lang.t('modqueue.thousand')}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<span className={styles.count}>{number}</span>
|
||||
);
|
||||
};
|
||||
|
||||
CommentCount.propTypes = {
|
||||
count: PropTypes.number.isRequired
|
||||
|
||||
@@ -63,7 +63,10 @@
|
||||
"impersonating": "Impersonating",
|
||||
"offensive": "Offensive",
|
||||
"spam/ads": "Spam/Ads",
|
||||
"other": "Other"
|
||||
"other": "Other",
|
||||
"thousand": "k",
|
||||
"million": "M",
|
||||
"billion": "B"
|
||||
},
|
||||
"comment": {
|
||||
"flagged": "flagged",
|
||||
@@ -248,7 +251,10 @@
|
||||
"impersonating": "Suplantación",
|
||||
"offensive": "Ofensivo",
|
||||
"spam/ads": "Spam/Propaganda",
|
||||
"other": "Otros"
|
||||
"other": "Otros",
|
||||
"thousand": "m",
|
||||
"million": "M",
|
||||
"billion": "B"
|
||||
},
|
||||
"comment": {
|
||||
"flagged": "marcado",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "talk",
|
||||
"version": "1.5.0",
|
||||
"version": "1.6.0",
|
||||
"description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user