Si simplifier (#418)
* Updating translations. * Use a number simplifier for counts. Fixes #407
This commit is contained in:
parent
4ec200ae6d
commit
a2aac813cf
10 changed files with 89 additions and 22 deletions
|
|
@ -40,6 +40,7 @@ import {
|
|||
getSortTypeFromProps,
|
||||
mdToHtml,
|
||||
notifyPost,
|
||||
numToSI,
|
||||
restoreScrollPosition,
|
||||
saveCommentRes,
|
||||
saveScrollPosition,
|
||||
|
|
@ -503,16 +504,21 @@ export class Home extends Component<any, HomeState> {
|
|||
return (
|
||||
<ul class="my-2 list-inline">
|
||||
<li className="list-inline-item badge badge-secondary">
|
||||
{i18n.t("number_online", { count: this.state.siteRes.online })}
|
||||
{i18n.t("number_online", {
|
||||
count: this.state.siteRes.online,
|
||||
formattedCount: numToSI(this.state.siteRes.online),
|
||||
})}
|
||||
</li>
|
||||
<li
|
||||
className="list-inline-item badge badge-secondary pointer"
|
||||
data-tippy-content={`${i18n.t("number_of_users", {
|
||||
count: counts.users_active_day,
|
||||
formattedCount: counts.users_active_day,
|
||||
})} ${i18n.t("active_in_the_last")} ${i18n.t("day")}`}
|
||||
>
|
||||
{i18n.t("number_of_users", {
|
||||
count: counts.users_active_day,
|
||||
formattedCount: numToSI(counts.users_active_day),
|
||||
})}{" "}
|
||||
/ {i18n.t("day")}
|
||||
</li>
|
||||
|
|
@ -520,10 +526,12 @@ export class Home extends Component<any, HomeState> {
|
|||
className="list-inline-item badge badge-secondary pointer"
|
||||
data-tippy-content={`${i18n.t("number_of_users", {
|
||||
count: counts.users_active_week,
|
||||
formattedCount: counts.users_active_week,
|
||||
})} ${i18n.t("active_in_the_last")} ${i18n.t("week")}`}
|
||||
>
|
||||
{i18n.t("number_of_users", {
|
||||
count: counts.users_active_week,
|
||||
formattedCount: numToSI(counts.users_active_week),
|
||||
})}{" "}
|
||||
/ {i18n.t("week")}
|
||||
</li>
|
||||
|
|
@ -531,10 +539,12 @@ export class Home extends Component<any, HomeState> {
|
|||
className="list-inline-item badge badge-secondary pointer"
|
||||
data-tippy-content={`${i18n.t("number_of_users", {
|
||||
count: counts.users_active_month,
|
||||
formattedCount: counts.users_active_month,
|
||||
})} ${i18n.t("active_in_the_last")} ${i18n.t("month")}`}
|
||||
>
|
||||
{i18n.t("number_of_users", {
|
||||
count: counts.users_active_month,
|
||||
formattedCount: numToSI(counts.users_active_month),
|
||||
})}{" "}
|
||||
/ {i18n.t("month")}
|
||||
</li>
|
||||
|
|
@ -542,33 +552,40 @@ export class Home extends Component<any, HomeState> {
|
|||
className="list-inline-item badge badge-secondary pointer"
|
||||
data-tippy-content={`${i18n.t("number_of_users", {
|
||||
count: counts.users_active_half_year,
|
||||
formattedCount: counts.users_active_half_year,
|
||||
})} ${i18n.t("active_in_the_last")} ${i18n.t("number_of_months", {
|
||||
count: 6,
|
||||
formattedCount: 6,
|
||||
})}`}
|
||||
>
|
||||
{i18n.t("number_of_users", {
|
||||
count: counts.users_active_half_year,
|
||||
formattedCount: numToSI(counts.users_active_half_year),
|
||||
})}{" "}
|
||||
/ {i18n.t("number_of_months", { count: 6 })}
|
||||
/ {i18n.t("number_of_months", { count: 6, formattedCount: 6 })}
|
||||
</li>
|
||||
<li className="list-inline-item badge badge-secondary">
|
||||
{i18n.t("number_of_users", {
|
||||
count: counts.users,
|
||||
formattedCount: numToSI(counts.users),
|
||||
})}
|
||||
</li>
|
||||
<li className="list-inline-item badge badge-secondary">
|
||||
{i18n.t("number_of_communities", {
|
||||
count: counts.communities,
|
||||
formattedCount: numToSI(counts.communities),
|
||||
})}
|
||||
</li>
|
||||
<li className="list-inline-item badge badge-secondary">
|
||||
{i18n.t("number_of_posts", {
|
||||
count: counts.posts,
|
||||
formattedCount: numToSI(counts.posts),
|
||||
})}
|
||||
</li>
|
||||
<li className="list-inline-item badge badge-secondary">
|
||||
{i18n.t("number_of_comments", {
|
||||
count: counts.comments,
|
||||
formattedCount: numToSI(counts.comments),
|
||||
})}
|
||||
</li>
|
||||
<li className="list-inline-item">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue