Name things, and write text in any language

This guide gives the models and groups that matter a name of their own (0.3), so that screen readers and the text view say what they are, and says which language a page's text is in and which way it runs (0.3), so that it is read in the right voice and drawn the right way round.

Give a model or a group a name

Without a name, a screen reader hears a model's id, or its file's name: "shark-1", "boulder.glb". A label names it in words:

<group id="tunnel-fish" label="Fish in the tunnel">
  <model id="shark-1" src="fish/shark.glb" label="Blacktip reef shark" position="-4 4 10" />
  <model src="fish/snapper.glb" label="Mangrove jack" position="2 3 6" />
</group>

Say which language the text is in

Write lang on the root for the whole page, and on any element whose text is in another language. The value is a language tag, as in HTML: en, ar, he, pt-BR, zh-Hant.

<holoml version="0.3" lang="en">
  <scene>
    <label position="0 2 0">Welcome</label>
    <label position="0 1.6 0" lang="fr">Bienvenue</label>
  </scene>
</holoml>

An element without lang takes it from the nearest element around it that has one, as in HTML: a group's lang reaches every label in it. A screen reader reads each text in its language's voice.

Write right-to-left text

For Arabic, Hebrew, and other scripts written from right to left, give dir="rtl" with the language:

<group lang="ar" dir="rtl">
  <label position="-2 1.6 0">أهلاً وسهلاً</label>
  <panel position="2 1.5 0" width="1.2">مرحباً بكم في المعرض. هنا تجدون التماثيل الثلاثة.</panel>
</group>
<hud corner="top-right" lang="he" dir="rtl">ברוכים הבאים</hud>

Try it

See also