diff --git a/adguard-mail.com/eula.html.md b/adguard-mail.com/eula.html.md index ce2462b..c2c7dd5 100644 --- a/adguard-mail.com/eula.html.md +++ b/adguard-mail.com/eula.html.md @@ -70,7 +70,7 @@ AdGuard Software Limited (“Rightholder”, “we”, “us”, “our”) may ## 3. Personal data and Privacy Policy -3.1. AdGuard Mail has a strong [Privacy Policy](https://adguard-mail.com/privacy.html) that describes what data AdGuard Mail apps can collect and when. Another document — [Website & Cookies Privacy notice](https://adguard-mail.com/privacy/website.html) — explains in detail how AdGuard Software Limited handles your personal data in relation to your browsing of the Website. +3.1. AdGuard Mail has a strong [Privacy Policy](https://adguard-mail.com/privacy.html) that describes what data AdGuard Mail apps can collect and when. Another document — [Website & Cookies Privacy notice](https://adguard-mail.com/privacy/website.html) — explains in detail how AdGuard Software Limited handles your personal data in relation to your browsing of the Website. 3.2. Before using AdGuard Mail, you acknowledge that you have read and understood our Privacy Policy, which explains the types of information we collect and process, and what may happen to that information, including, without limitation, how such information is shared and used. diff --git a/build-resx.js b/build-resx.js index 111d48a..c71e160 100644 --- a/build-resx.js +++ b/build-resx.js @@ -1,5 +1,6 @@ const fs = require('fs'); const path = require('path'); +const {create} = require('xmlbuilder2'); const basePath = 'crowdin'; const outputFilename = 'docs.resx'; @@ -27,12 +28,12 @@ for (const [sourceDir, crowdinDir] of Object.entries(mappings)) { continue; } - const mdFiles = fs.readdirSync(sourceDir, { recursive: true }) + const mdFiles = fs.readdirSync(sourceDir, {recursive: true}) .filter(file => file.endsWith(filesToProcessExt)); console.log(`Found ${mdFiles.length} files to process`); - let resxContent = '\n'; + let xmlBuilder = create({version: '1.0', encoding: 'utf-8'}).ele('root'); for (const filePath of mdFiles) { console.log(`Processing file: ${filePath}`); @@ -44,14 +45,15 @@ for (const [sourceDir, crowdinDir] of Object.entries(mappings)) { console.log(`Generated key: ${key}`); - resxContent += ` - - ${content} - -` + xmlBuilder = xmlBuilder.ele('data').att('name', key) + .ele('value').txt(content).up() + .up() } - resxContent += '' + const resxContent = xmlBuilder.end({ + prettyPrint: true, + indent: ' ', + }); const outputDir = path.join(basePath, crowdinDir); diff --git a/check-md-files.js b/check-md-files.js index 8b97ed6..85e4616 100644 --- a/check-md-files.js +++ b/check-md-files.js @@ -3,18 +3,8 @@ const path = require('path'); let errorFound = false; -const prohibitedAmpRegex = /&(?!amp;|lt;|gt;|quot;|apos;)/; - function checkLine(line) { - if (line.includes('<')) { - return false; - } - - if (line.includes('>')) { - return false; - } - - return !prohibitedAmpRegex.test(line); + return !line.includes('<') && !line.includes('>'); } function checkFiles(dir) { diff --git a/package-lock.json b/package-lock.json index 9d305c4..f56ac0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "devDependencies": { "@crowdin/cli": "4.4.0", "markdownlint": "0.36.1", - "markdownlint-cli": "0.43.0" + "markdownlint-cli": "0.43.0", + "xmlbuilder2": "3.1.1" } }, "node_modules/@crowdin/cli": { @@ -49,6 +50,58 @@ "node": ">=12" } }, + "node_modules/@oozcitak/dom": { + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@oozcitak/dom/-/dom-1.15.10.tgz", + "integrity": "sha512-0JT29/LaxVgRcGKvHmSrUTEvZ8BXvZhGl2LASRUgHqDTC1M5g1pLmVv56IYNyt3bG2CUjDkc67wnyZC14pbQrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oozcitak/infra": "1.0.8", + "@oozcitak/url": "1.0.4", + "@oozcitak/util": "8.3.8" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/@oozcitak/infra": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@oozcitak/infra/-/infra-1.0.8.tgz", + "integrity": "sha512-JRAUc9VR6IGHOL7OGF+yrvs0LO8SlqGnPAMqyzOuFZPSZSXI7Xf2O9+awQPSMXgIWGtgUf/dA6Hs6X6ySEaWTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oozcitak/util": "8.3.8" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/@oozcitak/url": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@oozcitak/url/-/url-1.0.4.tgz", + "integrity": "sha512-kDcD8y+y3FCSOvnBI6HJgl00viO/nGbQoCINmQ0h98OhnGITrWR3bOGfwYCthgcrV8AnTJz8MzslTQbC3SOAmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oozcitak/infra": "1.0.8", + "@oozcitak/util": "8.3.8" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/@oozcitak/util": { + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/@oozcitak/util/-/util-8.3.8.tgz", + "integrity": "sha512-T8TbSnGsxo6TDBJx/Sgv/BlVJL3tshxZP7Aq5R1mSnM5OcHY2dQaxLMu2+E8u3gN0MLOzdjurqN4ZRVuzQycOQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0" + } + }, "node_modules/ansi-regex": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", @@ -215,6 +268,20 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/foreground-child": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", @@ -866,6 +933,13 @@ "url": "https://github.com/sponsors/cyyynthia" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -1175,6 +1249,46 @@ "dev": true, "license": "ISC" }, + "node_modules/xmlbuilder2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder2/-/xmlbuilder2-3.1.1.tgz", + "integrity": "sha512-WCSfbfZnQDdLQLiMdGUQpMxxckeQ4oZNMNhLVkcekTu7xhD4tuUDyAPoY8CwXvBYE6LwBHd6QW2WZXlOWr1vCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oozcitak/dom": "1.15.10", + "@oozcitak/infra": "1.0.8", + "@oozcitak/util": "8.3.8", + "js-yaml": "3.14.1" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/xmlbuilder2/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/xmlbuilder2/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/package.json b/package.json index 90268da..9df2d7e 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,15 @@ "main": "index.js", "scripts": { "lint": "markdownlint . && node check-md-files.js", + "build:resx": "node build-resx.js", "crowdin:upload": "crowdin upload" }, "author": "", "license": "ISC", "devDependencies": { + "@crowdin/cli": "4.4.0", "markdownlint": "0.36.1", "markdownlint-cli": "0.43.0", - "@crowdin/cli": "4.4.0" + "xmlbuilder2": "3.1.1" } }