Browse Source

AMBARI-3918 Restart message title in popup from the links use only plural form. (ababiichuk)

aBabiichuk 11 years ago
parent
commit
c0f0abd68b

+ 4 - 2
ambari-web/app/controllers/main/service/info/configs.js

@@ -1791,8 +1791,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     for(var hostName in this.get('content.restartRequiredHostsAndComponents')) {
       hosts.push(hostName);
     }
+    var hostsText = hosts.length == 1 ? Em.I18n.t('common.host') : Em.I18n.t('common.hosts');
     hosts = hosts.join(', ');
-    this.showItemsShouldBeRestarted(hosts, Em.I18n.t('service.service.config.restartService.hostsShouldBeRestarted'));
+    this.showItemsShouldBeRestarted(hosts, Em.I18n.t('service.service.config.restartService.shouldBeRestarted').format(hostsText));
   },
   showComponentsShouldBeRestarted: function() {
     var rhc = this.get('content.restartRequiredHostsAndComponents');
@@ -1813,8 +1814,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       var componentDisplayName = (componentsObject[obj] > 1) ? obj + 's' : obj;
       componentsList.push(componentsObject[obj] + ' ' + componentDisplayName);
     }
+    var componentsText = componentsList.length == 1 ? Em.I18n.t('common.component') : Em.I18n.t('common.components');
     hostsComponets = componentsList.join(', ');
-    this.showItemsShouldBeRestarted(hostsComponets, Em.I18n.t('service.service.config.restartService.componentsShouldBeRestarted'));
+    this.showItemsShouldBeRestarted(hostsComponets, Em.I18n.t('service.service.config.restartService.shouldBeRestarted').format(componentsText));
   },
 
   showItemsShouldBeRestarted: function(content, header) {

+ 1 - 2
ambari-web/app/messages.js

@@ -1103,8 +1103,7 @@ Em.I18n.translations = {
   'services.service.config.restartService.TooltipMessage':'<b>Restart Service</b><br>Stale configuration used by {0} components on {1} hosts:{2}',
   'services.service.config.restartService.needToRestart':'<strong>Restart Required.</strong> ',
   'services.service.config.restartService.needToRestartEnd':'should be restarted',
-  'service.service.config.restartService.hostsShouldBeRestarted':'Hosts Requiring Restart',
-  'service.service.config.restartService.componentsShouldBeRestarted':'Components Requiring Restart',
+  'service.service.config.restartService.shouldBeRestarted':'{0} Requiring Restart',
   'services.service.config.saved.message':'Service configuration changes saved successfully.',
   'services.service.config.msgServiceStop':'Could not save configuration changes.  Please stop the service first. You will be able to save configuration changes after all of its components are stopped.',
   'services.service.config.msgHDFSMapRServiceStop':'Could not save configuration changes.  Please stop both HDFS and MapReduce first.  You will be able to save configuration changes after all HDFS and MapReduce components are stopped.',

+ 1 - 1
ambari-web/app/templates/main/service/menu_item.hbs

@@ -24,5 +24,5 @@
       {{view.alertsCount}}
     </span>
   {{/if}}
-  <i rel="tooltip" {{bindAttr class=":icon-refresh :restart-required-service view.content.isRestartRequired::hide" data-original-title="view.restartRequiredMessage"}}"></i>
+  <i rel="tooltip" {{bindAttr class=":icon-refresh :restart-required-service view.content.isRestartRequired::hide" data-original-title="view.restartRequiredMessage"}}></i>
 </a>