feat: translate all pages, UI messages and docs and fix SEO redirects and indexing

This commit is contained in:
alam00000
2026-10-25 12:55:21 +05:30
parent 5e019de5ae
commit 4edb1718cc
3344 changed files with 415643 additions and 4759 deletions
+36
View File
@@ -0,0 +1,36 @@
import fs from 'fs';
import path from 'path';
import zlib from 'zlib';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const DIST_DIR = path.resolve(__dirname, '../dist');
function listHtml(dir) {
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
const full = path.join(dir, entry.name);
if (entry.isDirectory()) return listHtml(full);
return entry.name.endsWith('.html') ? [full] : [];
});
}
let refreshed = 0;
for (const file of listHtml(DIST_DIR)) {
const brotli = `${file}.br`;
const gzip = `${file}.gz`;
if (!fs.existsSync(brotli) && !fs.existsSync(gzip)) continue;
const html = fs.readFileSync(file);
if (fs.existsSync(brotli)) {
fs.writeFileSync(
brotli,
zlib.brotliCompressSync(html, {
params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 11 },
})
);
}
if (fs.existsSync(gzip)) {
fs.writeFileSync(gzip, zlib.gzipSync(html, { level: 9 }));
}
refreshed++;
}
console.log(`Recompressed ${refreshed} precompressed HTML files.`);