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.
| Option | Values | Default | What it does |
|---|---|---|---|
dimensionUnit | m, cm, in | m | The unit of wall art's width and height, the numbers you pass. |
displayUnit | cm, in | cm | The 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.