Pluggable translation hook. The host application assigns translate to its own localization lookup; the library itself stays dependency-free and falls back to the supplied default string. Call refresh() after a locale switch to re-render live widgets.

Static variables

@:value(null)staticonChanged:() ‑> Void = null

Fired by refresh(); UIRoot assigns this to re-render every widget.

@:value(null)statictranslate:(key:String, fallback:String) ‑> String = null

(key, fallback) -> localized. null = identity (fallback returned).

Static methods

staticrefresh():Void

Notifies live widgets that the locale changed (re-renders every UIComponent).

staticinlinet(key:String, fallback:String):String

Resolves a localized string through the host's translate hook.

Parameters:

key

the translation key

fallback

returned verbatim when no hook is assigned (also the source string)

Returns:

the localized text