mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-07 00:28:39 +01:00
- Add `generate-i18n-pages.mjs` script to pre-render localized HTML files at build time - Add `generate-sitemap.mjs` script to generate language-aware sitemap.xml - Create `navbar-simple.html` and `footer-simple.html` partials for simple mode - Update all 80+ tool pages with language routing support - Expand supported languages to 12: en, de, es, fr, it, pt, tr, vi, id, zh, zh-TW - Update i18n.ts with new language names and support configuration - Implement languageRouterPlugin in vite.config.ts for dev server routing - Update nginx.conf for production static file serving from language directories - Update TRANSLATION.md with new architecture documentation and language addition guide - Fix relative paths in 404.html for static deployment compatibility - Update package.json with new build scripts and dependencies - Improves SEO through static pre-rendering and proper sitemap generation
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { APP_VERSION } from '../../version.js';
|
|
import { createLanguageSwitcher } from '../i18n/language-switcher.js';
|
|
|
|
// Handle simple mode adjustments for tool pages
|
|
if (__SIMPLE_MODE__) {
|
|
const sectionsToHide = [
|
|
'How It Works',
|
|
'Related PDF Tools',
|
|
'Related Tools',
|
|
'Frequently Asked Questions',
|
|
];
|
|
|
|
document.querySelectorAll('section').forEach((section) => {
|
|
const h2 = section.querySelector('h2');
|
|
if (h2) {
|
|
const heading = h2.textContent?.trim() || '';
|
|
if (sectionsToHide.some((text) => heading.includes(text))) {
|
|
(section as HTMLElement).style.display = 'none';
|
|
}
|
|
}
|
|
});
|
|
|
|
const versionElement = document.getElementById('app-version-simple');
|
|
if (versionElement) {
|
|
versionElement.textContent = APP_VERSION;
|
|
}
|
|
|
|
const langContainer = document.getElementById('simple-mode-lang-switcher');
|
|
if (langContainer) {
|
|
const switcher = createLanguageSwitcher();
|
|
const dropdown = switcher.querySelector('div[role="menu"]');
|
|
if (dropdown) {
|
|
dropdown.classList.remove('mt-2');
|
|
dropdown.classList.add('bottom-full', 'mb-2');
|
|
}
|
|
langContainer.appendChild(switcher);
|
|
}
|
|
}
|