Localization
In order to support multiple languages, most Panorama UIs are built with references to "localization tokens" instead of literal user-facing strings. These tokens are then dynamically replaced with the correct localized string depending on the user's language selection.
In your XML localization tokens are prefixed with a '#' symbol and can be used as regular text:
<Label text="#hello_message" />
When this UI is loaded, the token will be automatically replaced with a string from the corresponding localization file:
"hello_message" "Hello, world!"
Note: Unlike most content for Panorama, the localization files live in the game/ tree instead of content.
For Dota addons, localization files live here:
game/dota_addons/ADDON_NAME/panorama/localization/addon_LANGUAGE_NAME.txt
Dynamic data
In many cases you may have dynamic data that you need to inject into a localization string. This is achieved using "dialog variables" set on the panel that can be referenced by the localization file:
XML:
<Label id="msg" text="#MessageText" />
Javascript:
$("#msg").SetDialogVariable( "adjective", "favorite" );
$("#msg").SetDialogVariableInt( "number", 2 );
Localization file:
"MessageText" "My {s:adjective} number is {d:number}."
$( "#PanelID" ).text = $.Localize( "#LocalizationToken" );