Skip to main content

Localization

Standard english translations are provided by default. However, you can add more languages or change the english translations for a fully localized experience.

info

This interactive example demonstrates the concept using React. If you're using a different framework, adapt the core concepts to your preferred technology.

Result
Loading...
Live Editor
function Example() {
  useLayoutEffect(() => {
    const viewer = document.querySelector("cylindo-viewer");
    viewer.locales = {
      // Concat default translations
      ...viewer.locales,
      da: {
        fullScreen: "Fuldskærm",
        exitFullScreen: "Afslut fuldskærm",
        next: "Næste",
        previous: "Forrige",
        zoomIn: "Zoom ind",
        zoomOut: "Zoom ud",
        viewInAR: "Se i AR",
        show360: "Se i 360°",
        show3D: "3D-model",
        "qr.alt": "QR kode",
        "qr.usage": "Brug din mobiltelefon til at se dette produkt i AR.",
        "qr.requirements.key": "Mindste Krav",
        "qr.requirements.value": "En mobiltelefon med kamera og gyroskop",
      },
    };
  }, []);

  return <cylindo-viewer customer-id="5025" code="SOF0716-AMICOM" lang="da" />;
}

Try changing the translations in the example, or change the lang between en and da to switch the language entirely.

Translation keys​

The following keys are available for translation:

KeyDefault value (en)Description
fullScreenFull screenFull screen button tooltip
exitFullScreenExit full screenExit full screen button tooltip
zoomInZoom inZoom in button tooltip
zoomOutZoom outZoom out button tooltip
viewInARView in ARView in AR button label
show360Show 360°Show 360° button label
show3D3D ModelShow 3D model button label
qr.altQR codeQR code image alt text
qr.usagePoint your smartphone or tablet's camera to scan the QR code and see this product in your environment.QR code usage text
qr.requirements.keyMinimum requirementsQR code scanning device requirements key
qr.requirements.valueiOS 13, iPadOS 13 or Android with AR Core 1.9 or higherQR code scanning device requirements value
caveats

It is your responsibility to ensure that the translations are correct and that they fit the space available.

The viewer and its inner elements are responsive by default, but adding extensively long labels to elements that are not designed for it may result in a bad user experience.