Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/SDK/docs_src/cancellation/     Datei vom 5.10.2026 mit Größe 0 B image not shown  

Quelle  language-switch.js   Sprache: JAVA

 

// The theme links each language-switcher entry to that language's home page.
// Point the entries at the current page on each language's site instead: every
// prose page exists at the same path on all of them. The API reference is
// English-only, so from there the entries keep pointing at the site roots.
// Instant navigation swaps the page but keeps the header, so re-run on every
// page the theme loads (`document$`) rather than once.
const base = JSON.parse(document.getElementById("__config").textContent).base;
// The site root as a directory path; `base` lacks the trailing slash on 404 pages.
const site = new URL(base.replace(/\/?$/, "/"), location).pathname;

document$.subscribe(() => {
  let page = location.pathname.slice(site.length);
  if (page.startsWith("api/")) page = "";
  for (const entry of document.querySelectorAll(".md-select__link[hreflang]")) {
    // The language root the theme rendered, relative to the page first shown.
    entry.dataset.site ??= new URL(entry.getAttribute("href"), location).pathname;
    entry.href = entry.dataset.site + page;
  }
});

Messung
CHZG
100869092

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland