TT#127356 i18n - Key extraction command (i18n:extract) must ignore code in comments

Note: to test it you can add some JS code with translations in commented block. That translation should not apper in en.json file if you execute "yarn run i18n:extract" command
Change-Id: I79f6a8358f3a52578b58044eb02169aaccf62123
mr10.0
Sergii Leonenko 5 years ago
parent fe970116ca
commit 62fb7e9b29

@ -28,6 +28,8 @@
return _extends.apply(this, arguments);
}
const decomment = require('decomment');
function readVueFiles(src) {
if (!isValidGlob(src)) {
throw new Error(`vueFiles isn't a valid glob pattern.`);
@ -44,7 +46,7 @@
return {
fileName,
path: f,
content: fs.readFileSync(f, 'utf8')
content: decomment.text(fs.readFileSync(f, 'utf8'))
};
});
}

@ -51,6 +51,7 @@
"@quasar/quasar-app-extension-testing-unit-jest": "^1.0.1",
"babel-eslint": "^10.0.1",
"commander": "6.2.1",
"decomment": "0.9.4",
"dot-object": "2.1.4",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",

@ -210,7 +210,6 @@
"Lamp/Key": "Lamp/Key",
"Lamps/Keys": "Lamps/Keys",
"Language": "Language",
"Language ({language})": "Language ({language})",
"Language for voicemail and app server": "Language for voicemail and app server",
"Last Modify Time": "Last Modify Time",
"Leave conference": "Leave conference",
@ -365,7 +364,6 @@
"Send Fax": "Send Fax",
"Sending fax completed successfully.": "Sending fax completed successfully.",
"Serial Ringing": "Serial Ringing",
"Session language successfully changed": "Session language successfully changed",
"Set your PBX settings": "Set your PBX settings",
"Set your fax settings": "Set your fax settings",
"Set your personal alarm": "Set your personal alarm",
@ -415,7 +413,6 @@
"Type something": "Type something",
"Unassign": "Unassign",
"Unassigned": "Unassigned",
"Unassigned slot {slot}": "Unassigned slot {slot}",
"Unavailable Greeting": "Unavailable Greeting",
"Unblock Incoming": "Unblock Incoming",
"Unblock Incoming/Outgoing": "Unblock Incoming/Outgoing",
@ -436,11 +433,9 @@
"User Agent": "User Agent",
"User settings": "User settings",
"Username": "Username",
"Video Call": "Video Call",
"View All Registered Devices": "View All Registered Devices",
"View Call List": "View Call List",
"View Voicebox Messages": "View Voicebox Messages",
"Voice Call": "Voice Call",
"Voice prompts language for voicemail, conference and application server": "Voice prompts language for voicemail, conference and application server",
"Voicebox": "Voicebox",
"Voicebox Messages": "Voicebox Messages",

@ -4026,6 +4026,13 @@ decode-uri-component@^0.2.0:
resolved "https://npm-registry.sipwise.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
decomment@0.9.4:
version "0.9.4"
resolved "https://npm-registry.sipwise.com/decomment/-/decomment-0.9.4.tgz#fa40335bd90e3826d5c1984276e390525ff856d5"
integrity sha512-8eNlhyI5cSU4UbBlrtagWpR03dqXcE5IR9zpe7PnO6UzReXDskucsD8usgrzUmQ6qJ3N82aws/p/mu/jqbURWw==
dependencies:
esprima "4.0.1"
decompress-response@^3.3.0:
version "3.3.0"
resolved "https://npm-registry.sipwise.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
@ -4825,7 +4832,7 @@ espree@^6.1.2, espree@^6.2.1:
acorn-jsx "^5.2.0"
eslint-visitor-keys "^1.1.0"
esprima@^4.0.0, esprima@^4.0.1:
esprima@4.0.1, esprima@^4.0.0, esprima@^4.0.1:
version "4.0.1"
resolved "https://npm-registry.sipwise.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==

Loading…
Cancel
Save