summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-08-15 15:51:43 +0200
committerPierre Ossman <ossman@cendio.se>2019-08-15 15:58:09 +0200
commit776024a008689549b089b3578a673fce03b514fd (patch)
treec9afbcca608b65f7fd7ac7d9f0b77fab15f883ac /po
parent604edf07d23345c8adf96527995323473a3baace (diff)
downloadnovnc-776024a008689549b089b3578a673fce03b514fd.tar.gz
Fix trivial lint issues in translation tools
Indentation, missing semicolon, etc.
Diffstat (limited to 'po')
-rwxr-xr-xpo/po2js8
-rwxr-xr-xpo/xgettext-html14
2 files changed, 11 insertions, 11 deletions
diff --git a/po/po2js b/po/po2js
index 03c1490..fc6e881 100755
--- a/po/po2js
+++ b/po/po2js
@@ -22,17 +22,17 @@ const fs = require('fs');
const po2json = require("po2json");
const opt = getopt.create([
- ['h' , 'help' , 'display this help'],
+ ['h', 'help', 'display this help'],
]).bindHelp().parseSystem();
if (opt.argv.length != 2) {
- console.error("Incorrect number of arguments given");
- process.exit(1);
+ console.error("Incorrect number of arguments given");
+ process.exit(1);
}
const data = po2json.parseFileSync(opt.argv[0]);
-const bodyPart = Object.keys(data).filter((msgid) => msgid !== "").map((msgid) => {
+const bodyPart = Object.keys(data).filter(msgid => msgid !== "").map((msgid) => {
if (msgid === "") return;
const msgstr = data[msgid][1];
return " " + JSON.stringify(msgid) + ": " + JSON.stringify(msgstr);
diff --git a/po/xgettext-html b/po/xgettext-html
index 547f568..bb30d3b 100755
--- a/po/xgettext-html
+++ b/po/xgettext-html
@@ -10,8 +10,8 @@ const jsdom = require("jsdom");
const fs = require("fs");
const opt = getopt.create([
- ['o' , 'output=FILE' , 'write output to specified file'],
- ['h' , 'help' , 'display this help'],
+ ['o', 'output=FILE', 'write output to specified file'],
+ ['h', 'help', 'display this help'],
]).bindHelp().parseSystem();
const strings = {};
@@ -22,7 +22,7 @@ function addString(str, location) {
}
if (strings[str] === undefined) {
- strings[str] = {}
+ strings[str] = {};
}
strings[str][location] = null;
}
@@ -74,7 +74,7 @@ function process(elem, locator, enabled) {
}
for (let i = 0; i < elem.childNodes.length; i++) {
- node = elem.childNodes[i];
+ let node = elem.childNodes[i];
if (node.nodeType === node.ELEMENT_NODE) {
process(node, locator, enabled);
} else if (node.nodeType === node.TEXT_NODE && enabled) {
@@ -89,18 +89,18 @@ for (let i = 0; i < opt.argv.length; i++) {
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
const body = dom.window.document.body;
- function locator(elem) {
+ let locator = (elem) => {
const offset = dom.nodeLocation(elem).startOffset;
const line = file.slice(0, offset).split("\n").length;
return fn + ":" + line;
- }
+ };
process(body, locator, true);
}
let output = "";
-for (str in strings) {
+for (let str in strings) {
output += "#:";
for (location in strings[str]) {
output += " " + location;