Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE906CB55 for ; Wed, 12 Nov 2014 20:40:26 +0000 (UTC) Received: (qmail 82718 invoked by uid 500); 12 Nov 2014 20:40:26 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 82686 invoked by uid 500); 12 Nov 2014 20:40:26 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 82677 invoked by uid 99); 12 Nov 2014 20:40:26 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 20:40:26 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2A04CA1164A; Wed, 12 Nov 2014 20:40:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaoki@apache.org To: commits@ambari.apache.org Message-Id: <7a04ba2e19ce4947be0367fdaf760596@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-7924 Background operation notification plurality should match number of operations (apenniston via jaoki) Date: Wed, 12 Nov 2014 20:40:26 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 2f639afe7 -> a77f8bd1d AMBARI-7924 Background operation notification plurality should match number of operations (apenniston via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a77f8bd1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a77f8bd1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a77f8bd1 Branch: refs/heads/trunk Commit: a77f8bd1dc3588d9342dc6aabcf5b16dd2e9a01c Parents: 2f639af Author: Jun Aoki Authored: Wed Nov 12 12:40:07 2014 -0800 Committer: Jun Aoki Committed: Wed Nov 12 12:40:07 2014 -0800 ---------------------------------------------------------------------- ambari-web/app/messages.js | 1 + ambari-web/app/templates/application.hbs | 6 ++++-- ambari-web/app/utils/helper.js | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index c57a854..f795909 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -60,6 +60,7 @@ Em.I18n.translations = { 'yes':'Yes', 'no':'No', 'add': 'Add', + 'op': 'op', 'ops': 'ops', http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/templates/application.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/application.hbs b/ambari-web/app/templates/application.hbs index 1796a27..4034b03 100644 --- a/ambari-web/app/templates/application.hbs +++ b/ambari-web/app/templates/application.hbs @@ -28,9 +28,11 @@ {{clusterDisplayName}} {{#with App.router.backgroundOperationsController}} {{#if allOperationsCount}} - {{allOperationsCount}} {{t ops}} + + {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}} {{else}} - {{allOperationsCount}} {{t ops}} + + {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}} {{/if}} {{/with}} http://git-wip-us.apache.org/repos/asf/ambari/blob/a77f8bd1/ambari-web/app/utils/helper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js index 5a25b8f..27efd87 100644 --- a/ambari-web/app/utils/helper.js +++ b/ambari-web/app/utils/helper.js @@ -596,10 +596,10 @@ App.registerBoundHelper('pluralize', Em.View.extend({ if (!plural) plural = singular + 's'; else plural = this.parseValue(plural); if (singular && plural) { - if (count > 1) { - return plural; - } else { + if (count == 1) { return singular; + } else { + return plural; } } return '';