Files
bentopdf/src/js/utils/simple-mode-footer.ts
T
alam00000 abf7ae8a00 feat(i18n): add static pre-rendering for multi-language support
- 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
2026-01-14 21:04:56 +05:30

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);
}
}