LanguageSelector Widget v7 - nodeGame/nodegame GitHub Wiki
- status : complete
- version : 7.x
The language selector widget allows to select the language for a game from a list of available languages retrieved from the server.
The result of the selection are saved in node.player.lang
. The
language object contains at least the following properties:
-
name
: Name of the language in English. -
nativeName
: Native name of the language. -
shortName
: An abbreviation for the language, e.g. de, it, es, etc.
- usingButtons: if TRUE, the interface displays buttons, otherwise a drop-down selector is used. Default: TRUE.
-
setLanguage: Sets the chosen language in the widget and also
calls
node.setLanguage
, which in turn emits 'LANGUAGE_SET' if selection is valid.
in.say.LANG: updates the list of available languages.
// Creates and append a new MoneyTalks widget.
var root = document.body;
var langSelector = node.widgets.append('LanguageSelector', root);