-
Notifications
You must be signed in to change notification settings - Fork 18
LanguageSelector Widget v7
- 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);
Go back to the wiki Home.
Copyright (C) 2021 Stefano Balietti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.