Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bniwredyc committed Dec 3, 2024
1 parent 1019d56 commit 02af24c
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 22 deletions.
2 changes: 1 addition & 1 deletion adguard-mail.com/eula.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
18 changes: 10 additions & 8 deletions build-resx.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
const {create} = require('xmlbuilder2');

const basePath = 'crowdin';
const outputFilename = 'docs.resx';
Expand Down Expand Up @@ -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 = '<?xml version="1.0" encoding="utf-8"?>\n<root>';
let xmlBuilder = create({version: '1.0', encoding: 'utf-8'}).ele('root');

for (const filePath of mdFiles) {
console.log(`Processing file: ${filePath}`);
Expand All @@ -44,14 +45,15 @@ for (const [sourceDir, crowdinDir] of Object.entries(mappings)) {

console.log(`Generated key: ${key}`);

resxContent += `
<data name="${key}">
<value>${content}</value>
</data>
`
xmlBuilder = xmlBuilder.ele('data').att('name', key)
.ele('value').txt(content).up()
.up()
}

resxContent += '</root>'
const resxContent = xmlBuilder.end({
prettyPrint: true,
indent: ' ',
});

const outputDir = path.join(basePath, crowdinDir);

Expand Down
12 changes: 1 addition & 11 deletions check-md-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
116 changes: 115 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 02af24c

Please sign in to comment.