...
 
Commits (2)
......@@ -228,9 +228,10 @@ define([
'aria-valuemax': 100,
'style': 'width: 0;'
}).append(
$('<span>', {'class': 'text-nowrap'}).text('0 of ' + this.packsUpdateDetails.toHandle + ' language packs updated')
$('<span>', {'class': 'text-nowrap'}).text('0 of ' + this.packsUpdateDetails.toHandle + ' language ' +
this.pluralize(this.packsUpdateDetails.toHandle) + ' updated')
)
));
));
$contentContainer.empty();
isos.forEach(function(iso) {
......@@ -278,6 +279,13 @@ define([
});
},
pluralize: function(count, word, suffix, additionalCount) {
word = word || 'pack';
suffix = suffix || 's';
additionalCount = additionalCount || 0;
return count !== 1 && additionalCount !== 1 ? word + suffix : word;
},
packUpdateDone: function(updateIsoTimes, isos) {
var self = this;
var modalContent = this.currentModal.find(this.selectorModalBody);
......@@ -287,9 +295,9 @@ define([
var message = InfoBox.render(
Severity.ok,
'Language packs updated',
this.packsUpdateDetails.new + ' new language packs downloaded, ' +
this.packsUpdateDetails.updated + ' language packs updated, ' +
this.packsUpdateDetails.failed + ' language packs not available'
this.packsUpdateDetails.new + ' new language ' + this.pluralize(this.packsUpdateDetails.new) + ' downloaded, ' +
this.packsUpdateDetails.updated + ' language ' + this.pluralize(this.packsUpdateDetails.updated) + ' updated, ' +
this.packsUpdateDetails.failed + ' language ' + this.pluralize(this.packsUpdateDetails.failed) + ' not available'
);
this.addNotification(message);
if (updateIsoTimes === true) {
......@@ -327,7 +335,8 @@ define([
.css('width', percent + '%')
.attr('aria-valuenow', percent)
.find('span')
.text(this.packsUpdateDetails.handled + ' of ' + this.packsUpdateDetails.toHandle + ' language packs updated');
.text(this.packsUpdateDetails.handled + ' of ' + this.packsUpdateDetails.toHandle + ' language ' +
this.pluralize(this.packsUpdateDetails.handled, 'pack', 's', this.packsUpdateDetails.toHandle) + ' updated');
}
},
......
......@@ -9,8 +9,9 @@ seo_sitemap {
removeDefaultJS = 1
removeDefaultCss = 1
removePageCss = 1
additionalHeaders.10 {
header = Content-Type:application/xml;charset=utf-8
additionalHeaders {
10.header = Content-Type:application/xml;charset=utf-8
20.header = X-Robots-Tag:noindex
}
}
......
......@@ -67,6 +67,10 @@ class XmlSitemapIndexTest extends AbstractTestCase
$this->assertEquals(200, $response->getStatusCode());
$this->assertArrayHasKey('Content-Length', $response->getHeaders());
$this->assertGreaterThan(0, $response->getHeader('Content-Length')[0]);
$this->assertArrayHasKey('Content-Type', $response->getHeaders());
$this->assertEquals('application/xml;charset=utf-8', $response->getHeader('Content-Type')[0]);
$this->assertArrayHasKey('X-Robots-Tag', $response->getHeaders());
$this->assertEquals('noindex', $response->getHeader('X-Robots-Tag')[0]);
$this->assertRegExp('/<loc>http:\/\/localhost\/\?sitemap=pages&amp;type=1533906435&amp;cHash=[^<]+<\/loc>/', (string)$response->getBody());
}
}
......@@ -81,7 +81,10 @@ class XmlSitemapPagesTest extends AbstractTestCase
$this->assertEquals(200, $this->response->getStatusCode());
$this->assertArrayHasKey('Content-Length', $this->response->getHeaders());
$this->assertGreaterThan(0, $this->response->getHeader('Content-Length')[0]);
$this->assertArrayHasKey('Content-Type', $this->response->getHeaders());
$this->assertEquals('application/xml;charset=utf-8', $this->response->getHeader('Content-Type')[0]);
$this->assertArrayHasKey('X-Robots-Tag', $this->response->getHeaders());
$this->assertEquals('noindex', $this->response->getHeader('X-Robots-Tag')[0]);
$this->assertRegExp($urlPattern, (string)$this->response->getBody());
}
......
......@@ -79,6 +79,10 @@ class XmlSitemapRecordsTest extends AbstractTestCase
$this->assertEquals(200, $response->getStatusCode());
$this->assertArrayHasKey('Content-Length', $response->getHeaders());
$this->assertEquals('application/xml;charset=utf-8', $response->getHeader('Content-Type')[0]);
$this->assertArrayHasKey('X-Robots-Tag', $response->getHeaders());
$this->assertEquals('noindex', $response->getHeader('X-Robots-Tag')[0]);
$this->assertArrayHasKey('Content-Length', $response->getHeaders());
$stream = $response->getBody();
$stream->rewind();
$content = $stream->getContents();
......