Skip to content

Commit

Permalink
Revert incorrect modification to en.json generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Jul 28, 2021
1 parent 337676a commit d9dc1f1
Show file tree
Hide file tree
Showing 3 changed files with 7,043 additions and 2,712 deletions.
8 changes: 3 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ module.exports = function(grunt) {
const done = this.async();
const languages = pkg.languages;
const promises = [];
const {assert} = require('chai');
// const {assert} = require('chai');

try {
for (const language of languages) {
Expand All @@ -468,9 +468,7 @@ module.exports = function(grunt) {

const files = await glob(`./src/data/localization/${language}/*.ftl`);
for (const file of files) {
if (
file !== `./src/data/localization/${language}/root.ftl`
) {
if (file !== `./src/data/localization/${language}/root.ftl`) {
const key = path.basename(file, '.ftl');
const fileData = await fs.readFile(file, {encoding: 'utf8'});
const jsonData = fluentConverter.ftlToObj(fileData);
Expand All @@ -485,7 +483,7 @@ module.exports = function(grunt) {
console.log('SEP');
console.log(newData[key][entry]);
console.log('END');
assert.deepEqual(inner, newData[key][entry]);
// assert.deepEqual(inner, newData[key][entry]);
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions getenJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function buildClassObj(p5Class) {
}

if (p5Class.return) {
classObj['returns'] = buildReturnObj(p5Class.return);
classObj['returns'] = buildReturnObj(p5Class.return).trim();
}

if (p5Class.params) {
Expand All @@ -77,7 +77,7 @@ function buildItemObj(p5Item) {
itemObj['description'] = getParagraphs(p5Item.description);
}
if (p5Item.return) {
itemObj['returns'] = buildReturnObj(p5Item.return);
itemObj['returns'] = buildReturnObj(p5Item.return).trim();
}

if (p5Item.itemtype === 'method') {
Expand All @@ -88,7 +88,7 @@ function buildItemObj(p5Item) {
itemObj = getOverloads(p5Item, itemObj);
}
}
return itemObj.description;
return itemObj;
}

function buildReturnObj(returns) {
Expand Down
Loading

0 comments on commit d9dc1f1

Please sign in to comment.