mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-24 17:56:27 +00:00
feat(alternatives): add Teleparty & Screen Sharing comparison pages with i18n
- Add article-style comparison pages for Teleparty and Screen Sharing - Replace comparison tables with honest prose sections - Add 15-language hreflang alternates and sitemap entries - Add English locale fallback for untranslated languages - Replace placeholder Draft copy with real English and German text - Remove old Draft locale keys from all 13 non-EN/DE locales - Rebuild outputs with zero TODO/Draft/noindex issues
This commit is contained in:
@@ -488,6 +488,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
homeLinks.forEach(link => {
|
||||
link.href = (activeLang === 'en') ? './' : `${activeLang}/`;
|
||||
});
|
||||
|
||||
const altLinks = document.querySelectorAll('a[href*="alternatives"]');
|
||||
altLinks.forEach(link => {
|
||||
const attr = link.getAttribute('href');
|
||||
if (attr === 'alternatives' || attr === 'alternatives/teleparty' || attr.endsWith('/alternatives')) {
|
||||
link.href = (activeLang === 'en') ? 'alternatives' : `${activeLang}/alternatives`;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -529,6 +537,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const pathSegments = path.split('/');
|
||||
const isAlternative = pathSegments.includes('alternatives');
|
||||
if (isAlternative) {
|
||||
let target;
|
||||
const firstSeg = pathSegments[1];
|
||||
const isLangSubdir = ['de', 'fr', 'es', 'it', 'nl', 'pl', 'pt', 'pt-BR', 'tr', 'ru', 'ja', 'ko', 'zh', 'uk'].includes(firstSeg);
|
||||
|
||||
if (newLang === 'en') {
|
||||
if (isLangSubdir) {
|
||||
pathSegments.splice(1, 1);
|
||||
}
|
||||
} else {
|
||||
if (isLangSubdir) {
|
||||
pathSegments[1] = newLang;
|
||||
} else {
|
||||
pathSegments.splice(1, 0, newLang);
|
||||
}
|
||||
}
|
||||
target = pathSegments.join('/');
|
||||
window.location.href = target + window.location.hash;
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if we are on a static landing page versus a dynamic utility page
|
||||
const isIndex = !path.includes('join');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user