UX: Use relative age for logs notice instead.

This commit is contained in:
Guo Xiang Tan 2016-06-09 11:26:07 +08:00
parent 214e25f1b5
commit 8f5d3a5cbd
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { on, observes } from 'ember-addons/ember-computed-decorators';
import computed from 'ember-addons/ember-computed-decorators';
import { default as computed, on, observes } from 'ember-addons/ember-computed-decorators';
import { autoUpdatingRelativeAge } from 'discourse/lib/formatter';
const LOGS_NOTICE_KEY = "logs-notice-text";
@ -28,6 +28,7 @@ const LogsNotice = Ember.Object.extend({
this.set('text',
I18n.t(`logs_error_rate_notice.${translationKey}`, {
relativeAge: autoUpdatingRelativeAge(new Date),
timestamp: moment().format("YYYY-MM-DD H:mm:ss"),
siteSettingRate: I18n.t('logs_error_rate_notice.rate', { count: siteSettingLimit, duration: duration }),
rate: I18n.t('logs_error_rate_notice.rate', { count: rate, duration: duration }),

View File

@ -842,8 +842,8 @@ en:
too_few_topics_notice: "Let's <a href='http://blog.discourse.org/2014/08/building-a-discourse-community/'>get this discussion started!</a> There are currently <strong>%{currentTopics} / %{requiredTopics}</strong> topics. New visitors need some conversations to read and respond to."
too_few_posts_notice: "Let's <a href='http://blog.discourse.org/2014/08/building-a-discourse-community/'>get this discussion started!</a> There are currently <strong>%{currentPosts} / %{requiredPosts}</strong> posts. New visitors need some conversations to read and respond to."
logs_error_rate_notice:
reached: "%{timestamp}: Current rate of <a href='%{url}' target='_blank'>%{rate}</a> has reached site settings's limit of %{siteSettingRate}."
exceeded: "%{timestamp}: Current rate of <a href='%{url}' target='_blank'>%{rate}</a> has exceeded site settings's limit of %{siteSettingRate}."
reached: "<b>[%{relativeAge}]</b> Current rate of <a href='%{url}' target='_blank'>%{rate}</a> has reached site settings's limit of %{siteSettingRate}."
exceeded: "<b>[%{relativeAge}]</b> Current rate of <a href='%{url}' target='_blank'>%{rate}</a> has exceeded site settings's limit of %{siteSettingRate}."
rate:
one: "1 error/%{duration}"
other: "%{count} errors/%{duration}"