Skip to Content

Language and units

Set the widget's language and the units it reads and shows.

Language

Without the language option, Room Viewer follows the shopper's browser language and falls back to English for a language it does not support. When your page has its own language switcher, set language to one of the values in the options reference, so the widget matches the page rather than the browser:

<button type="button" data-vizbl-room-viewer-dialog data-vizbl-room-viewer-language="en" ...>
  View in your room
</button>

In an attribute, a value the widget does not support is ignored, as if the option were not set.

In React, changing the prop while the viewer is open switches its language in place; the rooms reload with names in the new language.

Units

Room Viewer has two unit options. They are independent.

OptionValuesDefaultWhat it does
dimensionUnitm, cm, inmThe unit of wall art's width and height, the numbers you pass.
displayUnitcm, incmThe display unit: the unit the shopper reads, in rug sizes and the wall art matting.

So a store that keeps artwork sizes in inches and sells to the US passes dimensionUnit: 'in' and displayUnit: 'in'; a store with sizes in centimetres that shows inches passes dimensionUnit: 'cm' and displayUnit: 'in'.

Rug sizes in inches are rounded to whole numbers. In attributes, write numbers with a dot: data-vizbl-room-viewer-width="0.6", not 0,6.

On this page