mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-07 08:31:01 +01:00
feat: translate all pages, UI messages and docs and fix SEO redirects and indexing
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { nav, sidebar } from '../docs/.vitepress/navigation.mjs';
|
||||
import {
|
||||
DESCRIPTION,
|
||||
FOOTER_MESSAGE,
|
||||
THEME_LABELS,
|
||||
} from '../docs/.vitepress/i18n/theme-labels.mjs';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const OUT_FILE = path.resolve(__dirname, '../docs/.vitepress/i18n/source.json');
|
||||
|
||||
const labels = new Set([DESCRIPTION, FOOTER_MESSAGE, ...THEME_LABELS]);
|
||||
|
||||
function collect(items) {
|
||||
for (const item of items) {
|
||||
if (item.text) labels.add(item.text);
|
||||
if (item.items) collect(item.items);
|
||||
}
|
||||
}
|
||||
|
||||
collect(nav);
|
||||
Object.values(sidebar).forEach(collect);
|
||||
|
||||
const sorted = [...labels].sort((a, b) => a.localeCompare(b));
|
||||
fs.writeFileSync(OUT_FILE, JSON.stringify(sorted, null, 2) + '\n');
|
||||
console.log(`Wrote ${sorted.length} docs labels to ${OUT_FILE}`);
|
||||
Reference in New Issue
Block a user