Contextual variables give a theme access to text values and image paths computed by Recalbox. They are written ${variable.name}.
These variables only exist for themes designed for Recalbox 10 or above.
They resolve inside the text="" and path="" attributes of "extra" objects — that is, the images, texts and videos you add to a view yourself. They do not drive the elements managed internally by the interface.
<view name="system">
<text name="systemName" extra="true" text="${system}" pos="0.5 0.15" origin="0.5 0.5" />
<image name="nextLogo" extra="true" path="${system.logo+1}" pos="0.8 0.5" size="0.15 0" />
</view>
| Category | Scope | Page |
|---|---|---|
| Global variables | Do not change during a session: version, language, hardware, resolution | ${root}, ${settings.language}, ${hardware.board}… |
| System variables | The currently displayed system, real or virtual | ${system}, ${system.logo}, ${system.manufacturer}… |
| Game and system variables | The selected game and its real system | ${game.name}, ${game.developer}, ${game.media.imagepath}… |
The difference between ${system.*} and ${game.system.*} matters: on a virtual system such as favourites, ${system} is "Favorites" while ${game.system} is the real system of the selected game, for instance "Super Nintendo Entertainment System".
Any property can be declined per language, per full locale or per region, by adding a suffix to the property name. Recalbox keeps the first match found in the file.
fr matches fr_FR, fr_BE, fr_CA…):<text name="text" extra="true" text="Text in English" text.fr="Texte en français" />
<text name="text" extra="true" text="Text for English language" text.fr_FR="Text for France" text.fr_BE="Text for Belgium" />
EU, JP or US, always uppercase), as chosen in MAIN MENU > USER INTERFACE SETTINGS > THEME > REGION:<text name="text" extra="true" text="Text in English" text.JP="日本語のテキスト" />
The lookup stops at the first match, so the order in which you write the variants changes the result.
title="Washington" title.fr="Paris" title.de_CH="Bern" title.de="Berlin"
de_CH gets "Bern": it is the first variant matching their language or locale.de_DE gets "Berlin".fr_FR, fr_CA or fr_BE get "Paris".title.de="Berlin" title.de_CH="Bern" title.fr="Paris" title="Washington"
Nothing changes, except for de_CH users who now get "Berlin", because title.de matches before title.de_CH is examined.
Language codes are 2 characters (ISO 639-1 list), country codes too (ISO 3166-2 list).