mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Pluralize logs notice message.
This commit is contained in:
parent
fd853e0776
commit
621372eb7b
2 changed files with 12 additions and 5 deletions
|
@ -15,6 +15,7 @@ const LogsNotice = Ember.Object.extend({
|
|||
|
||||
this.messageBus.subscribe("/logs_error_rate_exceeded", data => {
|
||||
const duration = data.duration;
|
||||
const rate = data.rate;
|
||||
var siteSettingLimit = 0;
|
||||
|
||||
if (duration === 'minute') {
|
||||
|
@ -23,12 +24,13 @@ const LogsNotice = Ember.Object.extend({
|
|||
siteSettingLimit = this.siteSettings.alert_admins_if_errors_per_hour;
|
||||
}
|
||||
|
||||
var translationKey = (rate === siteSettingLimit) ? 'reached' : 'exceeded';
|
||||
|
||||
this.set('text',
|
||||
I18n.t('logs_error_rate_exceeded_notice', {
|
||||
I18n.t(`logs_error_rate_notice.${translationKey}`, {
|
||||
timestamp: moment().format("YYYY-MM-DD H:mm:ss"),
|
||||
siteSettingLimit: siteSettingLimit,
|
||||
rate: data.rate,
|
||||
duration: duration,
|
||||
siteSettingRate: I18n.t('logs_error_rate_notice.rate', { count: siteSettingLimit, duration: duration }),
|
||||
rate: I18n.t('logs_error_rate_notice.rate', { count: rate, duration: duration }),
|
||||
url: Discourse.getURL('/logs')
|
||||
})
|
||||
);
|
||||
|
|
|
@ -795,7 +795,12 @@ en:
|
|||
too_few_topics_and_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>%{currentTopics} / %{requiredTopics}</strong> topics and <strong>%{currentPosts} / %{requiredPosts}</strong> posts. New visitors need some conversations to read and respond to."
|
||||
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_exceeded_notice: "%{timestamp}: Current rate of <a href='%{url}' target='_blank'>%{rate} errors/%{duration}</a> has exceeded site settings's limit of %{siteSettingLimit} errors/%{duration}."
|
||||
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}."
|
||||
rate:
|
||||
one: "1 error/%{duration}"
|
||||
other: "%{count} errors/%{duration}"
|
||||
|
||||
learn_more: "learn more..."
|
||||
|
||||
|
|
Loading…
Reference in a new issue