Hi folks,
I’ve been hosting a notebook using Javascript on my site and I’ve been using a select box to change the language using.
import {Runtime, Inspector} from “https://cdn.jsdelivr.net/npm/@observablehq/runtime@5/dist/runtime.js”;
import define from “https://api.observablehq.com/@bmdatavisualisation/apt.js?v=4”;
const notebook = new Runtime().module(define, name => {
if (name === “finalChart”) return new Inspector(document.querySelector(“#observablehq-finalChart-92d14b0e”));
});
notebook.redefine(“language”, “pt”)
It’s being hosted on another site within an iframe (I don’t have access) and I had the smart idea that if they set up a message then I could detect when the url changes so that I could dynamically change the language.
It doesn’t seem to be working - I’m guessing something to do with state/runtime/the fact that it’s hosted on another site within a iframe and might not even be possible to do but thought I’d ask…
Many thanks,
Bryony