mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 11:26:31 +00:00
Add "languages" property to all json files for multilingual book
This commit is contained in:
+1
-1
@@ -240,7 +240,7 @@ Output.prototype.getContext = function() {
|
||||
output: this.getSelfContext()
|
||||
},
|
||||
this.book.getContext(),
|
||||
this.book.langs.getContext(),
|
||||
(this.book.isLanguageBook()? this.book.parent: this.book).langs.getContext(),
|
||||
this.book.summary.getContext(),
|
||||
this.book.glossary.getContext(),
|
||||
this.book.config.getContext(),
|
||||
|
||||
@@ -41,8 +41,23 @@ describe('JSON Output', function() {
|
||||
output.should.have.file('fr/README.json');
|
||||
});
|
||||
|
||||
it('should correctly add languages list to all json', function() {
|
||||
var jsonFR = require(output.resolve('fr/README.json'));
|
||||
var jsonEN = require(output.resolve('en/README.json'));
|
||||
|
||||
jsonFR.should.have.property('languages')
|
||||
.with.property('list').with.lengthOf(2);
|
||||
jsonEN.should.have.property('languages')
|
||||
.with.property('list').with.lengthOf(2);
|
||||
});
|
||||
|
||||
it('should correctly generate a README.json for the whole book', function() {
|
||||
output.should.have.file('README.json');
|
||||
|
||||
var json = require(output.resolve('README.json'));
|
||||
|
||||
json.should.have.property('languages')
|
||||
.with.property('list').with.lengthOf(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user