Repository: ambari Updated Branches: refs/heads/trunk c5495dd87 -> edbd1f7d4
AMBARI-7638 Correct evident spelling and grammatical errors in global strings (nandat via jaoki) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/edbd1f7d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/edbd1f7d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/edbd1f7d Branch: refs/heads/trunk Commit: edbd1f7d4eb3509ceb29d54b40445a8bcaf8f1c3 Parents: c5495dd Author: Jun Aoki <ja...@apache.org> Authored: Thu Oct 9 13:39:22 2014 -0700 Committer: Jun Aoki <ja...@apache.org> Committed: Thu Oct 9 13:39:22 2014 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers/main/host/details.js | 2 +- .../app/controllers/wizard/step0_controller.js | 2 +- ambari-web/app/messages.js | 16 ++++++------ ambari-web/app/utils/host_progress_popup.js | 2 +- .../test/utils/host_progress_popup_test.js | 27 ++++++++++++++++++++ 5 files changed, 38 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/edbd1f7d/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 35a38ea..75a555b 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -944,7 +944,7 @@ App.MainHostDetailsController = Em.Controller.extend({ return App.ModalPopup.show({ header: Em.I18n.t('common.warning'), message: function () { - return Em.I18n.t('hostPopup.reccomendation.beforeDecommission').format(App.format.components["HBASE_REGIONSERVER"]); + return Em.I18n.t('hostPopup.recommendation.beforeDecommission').format(App.format.components["HBASE_REGIONSERVER"]); }.property(), bodyClass: Ember.View.extend({ template: Em.Handlebars.compile('<div class="alert alert-warning">{{message}}</div>') http://git-wip-us.apache.org/repos/asf/ambari/blob/edbd1f7d/ambari-web/app/controllers/wizard/step0_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step0_controller.js b/ambari-web/app/controllers/wizard/step0_controller.js index dd7935d..1cff37d 100644 --- a/ambari-web/app/controllers/wizard/step0_controller.js +++ b/ambari-web/app/controllers/wizard/step0_controller.js @@ -38,7 +38,7 @@ App.WizardStep0Controller = Em.Controller.extend({ this.set('clusterNameError', Em.I18n.t('installer.step0.clusterName.error.required')); return true; } else if (/\s/.test(clusterName)) { - this.set('clusterNameError', Em.I18n.t('installer.step0.clusterName.error.whitespaces')); + this.set('clusterNameError', Em.I18n.t('installer.step0.clusterName.error.whitespace')); return true; } else if (/[^\w\s]/gi.test(clusterName)) { this.set('clusterNameError', Em.I18n.t('installer.step0.clusterName.error.specialChar')); http://git-wip-us.apache.org/repos/asf/ambari/blob/edbd1f7d/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 95b5d8c..4008fbc 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -257,7 +257,7 @@ Em.I18n.translations = { 'hostPopup.status.category.success':'Success ({0})', 'hostPopup.status.category.aborted':'Aborted ({0})', 'hostPopup.status.category.timedout':'Timedout ({0})', - 'hostPopup.header.postFix':' Background Operations Running', + 'hostPopup.header.postFix':' Background Operation{0} Running', 'hostPopup.serviceInfo.showMore':'Show more...', 'hostPopup.bgop.abortRequest.title': 'Abort operation', 'hostPopup.bgop.abortRequest.confirmation.body': 'Are you sure you want to abort \'{0}\' operation?', @@ -268,7 +268,7 @@ Em.I18n.translations = { 'hostPopup.bgop.sourceRequestSchedule.aborted': 'Future operations of this batch request have been aborted', 'hostPopup.bgop.abort.rollingRestart': 'Abort Rolling Restart', 'hostPopup.warning.alertsTimeOut': 'Maintenance Mode has been turned {0}. It may take a few minutes for the alerts to be {1}.', - 'hostPopup.reccomendation.beforeDecommission': '{0} Maintenance Mode is pre required for decommissioning.', + 'hostPopup.recommendation.beforeDecommission': '{0} Maintenance Mode is pre required for decommissioning.', 'question.sure':'Are you sure?', @@ -300,8 +300,8 @@ Em.I18n.translations = { 'graphs.timeRange.year': 'Last 1 year', 'users.userName.validationFail': 'Only lowercase letters and numbers are recommended; must start with a letter', - 'host.spacesValidation': 'Can\'t contain whitespaces', - 'host.trimspacesValidation': 'Can\'t contain leading or trailing whitespaces', + 'host.spacesValidation': 'Cannot contain whitespace', + 'host.trimspacesValidation': 'Cannot contain leading or trailing whitespace', 'services.hdfs.rebalance.title' : 'HDFS Rebalance', 'services.nagios.description':'Nagios Monitoring and Alerting system', @@ -375,12 +375,12 @@ Em.I18n.translations = { 'installer.step0.header':'Get Started', 'installer.step0.body.header':'Get Started', - 'installer.step0.body':'This wizard will walk you through the cluster installation process. Let\'s start by naming your new cluster.', + 'installer.step0.body':'This wizard will walk you through the cluster installation process. First, start by naming your new cluster.', 'installer.step0.clusterName':'Name your cluster', 'installer.step0.clusterName.tooltip.title':'Cluster Name', 'installer.step0.clusterName.tooltip.content':'Enter a unique cluster name.', 'installer.step0.clusterName.error.required':'Cluster Name is required', - 'installer.step0.clusterName.error.whitespaces':'Cluster Name cannot contain white spaces', + 'installer.step0.clusterName.error.whitespace':'Cluster Name cannot contain whitespace', 'installer.step0.clusterName.error.specialChar':'Cluster Name cannot contain special characters', 'installer.step1.header':'Select Stack', @@ -499,7 +499,7 @@ Em.I18n.translations = { 'installer.step3.hostWarningsPopup.jdk.message':'The following registered hosts have issues related to JDK', 'installer.step3.hostWarningsPopup.repositories':'Repository Issues', 'installer.step3.hostWarningsPopup.repositories.name':'Repository for OS not available', - 'installer.step3.hostWarningsPopup.repositories.context':'Host ({0}) is {1} OS type, but the repositories chosen in "Select Stack" step was {2}. Selected repositories dont support such host OS type.', + 'installer.step3.hostWarningsPopup.repositories.context':'Host ({0}) is {1} OS type, but the repositories chosen in "Select Stack" step was {2}. Selected repositories do not support this host OS type.', 'installer.step3.hostWarningsPopup.repositories.message': 'The following registered hosts have different Operating System types from the available Repositories chosen in "Select Stack" step. You can go back to "Select Stack" step to select another OS repository <b>or</b> remove the host.', 'installer.step3.hostWarningsPopup.disk':'Disk Issues', 'installer.step3.hostWarningsPopup.disk.name':'Not enough disk space ', @@ -1104,7 +1104,7 @@ Em.I18n.translations = { 'admin.security.applying.config.body':'You cannot quit wizard while configurations are being applied', 'admin.security.status.error' : 'Error in retrieving cluster security status from Ambari server', 'admin.users.ldapAuthUsed':'LDAP Authentication is being used to authenticate users', - 'admin.users.delete.yourself.message':'You can\'t delete yourself', + 'admin.users.delete.yourself.message':'You cannot delete yourself', 'admin.users.delete.yourself.header':'Deleting warning', 'admin.users.delete.header':'Delete {0}', http://git-wip-us.apache.org/repos/asf/ambari/blob/edbd1f7d/ambari-web/app/utils/host_progress_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/host_progress_popup.js b/ambari-web/app/utils/host_progress_popup.js index 1e2c675..b9e7b6a 100644 --- a/ambari-web/app/utils/host_progress_popup.js +++ b/ambari-web/app/utils/host_progress_popup.js @@ -322,7 +322,7 @@ App.HostPopup = Em.Object.create({ setBackgroundOperationHeader: function (isServiceListHidden) { if (this.get('isBackgroundOperations') && !isServiceListHidden) { var numRunning = App.router.get('backgroundOperationsController.allOperationsCount'); - this.set("popupHeaderName", numRunning + Em.I18n.t('hostPopup.header.postFix')); + this.set("popupHeaderName", numRunning + Em.I18n.t('hostPopup.header.postFix').format(numRunning == 1 ? "" : "s")); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/edbd1f7d/ambari-web/test/utils/host_progress_popup_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/host_progress_popup_test.js b/ambari-web/test/utils/host_progress_popup_test.js index 3a8a1c1..5a7ab02 100644 --- a/ambari-web/test/utils/host_progress_popup_test.js +++ b/ambari-web/test/utils/host_progress_popup_test.js @@ -449,4 +449,31 @@ describe('App.HostPopup', function () { }); }); + describe('#setBackgroundOperationHeader', function(){ + beforeEach(function (){ + sinon.stub(App.HostPopup, "get").returns(true); + sinon.spy(App.HostPopup, "set"); + }); + + afterEach(function (){ + App.HostPopup.get.restore(); + App.HostPopup.set.restore(); + App.router.get.restore(); + }); + + it("should display '2 Background Operations Running' when there are 2 background operations running", function(){ + sinon.stub(App.router, "get").returns(2); + App.HostPopup.setBackgroundOperationHeader(false); + + expect(App.HostPopup.set.calledWith("popupHeaderName", "2 Background Operations Running")).to.be.true; + }); + + it("should display '1 Background Operation Running' when there is 1 background operation running", function(){ + sinon.stub(App.router, "get").returns(1); + App.HostPopup.setBackgroundOperationHeader(false); + + expect(App.HostPopup.set.calledWith("popupHeaderName", "1 Background Operation Running")).to.be.true; + }); + }); + });