Drag[en]gine Script Module DragonScript
1.21
|
Immutable language pack resources. More...
Public Member Functions | |
Management | |
String | getFilename () |
Normalized filename the language pack has been loaded from. More... | |
String | getIdentifier () |
Unique identifier. More... | |
UnicodeString | getName () |
Name in native language. More... | |
UnicodeString | getDescription () |
Description in native language. More... | |
UnicodeString | translate (String name) |
Translation for entry name or missing text if absent. More... | |
UnicodeString | translate (String name, UnicodeString defaultValue) |
Translation for entry name or default value if absent. More... | |
UnicodeString | getMissingText () |
Text used for missing translations. More... | |
bool | equals (Object other) |
LanguagePack is equal to another object. More... | |
int | hashCode () |
Hash code for use as dictionary keys. More... | |
Constructors | |
LanguagePack | new (String filename) |
Load language pack from file. More... | |
static void | loadAsynchron (String filename, ResourceListener listener) |
Load language pack from file asynchronously. More... | |
Immutable language pack resources.
Language pack contain a list of entries assigning translations to names
This is a native class. It can not be subclassed.
bool Dragengine.LanguagePack.equals | ( | Object | other | ) |
LanguagePack is equal to another object.
Implements Object.equals(Object).
UnicodeString Dragengine.LanguagePack.getDescription | ( | ) |
Description in native language.
This string can be optionally shown to the user to describe the language pack in more detail, for example if the language uses some kind of dialect.
String Dragengine.LanguagePack.getFilename | ( | ) |
Normalized filename the language pack has been loaded from.
String Dragengine.LanguagePack.getIdentifier | ( | ) |
Unique identifier.
This is used to uniquely identify the language pack.
UnicodeString Dragengine.LanguagePack.getMissingText | ( | ) |
Text used for missing translations.
UnicodeString Dragengine.LanguagePack.getName | ( | ) |
Name in native language.
This string is typically shown in language settings screens to the user.
int Dragengine.LanguagePack.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
|
static |
Load language pack from file asynchronously.
Registers a request in the game engine to load an language pack. Once finished or if the file is already loaded the listener is used to deliver the loaded language pack or null if the loading failed.
LanguagePack Dragengine.LanguagePack.new | ( | String | filename | ) |
Load language pack from file.
If the language pack file has been already loaded it is assigned to this object. If the language pack is not loaded yet the engine loads the language pack. This call blocks until the language pack is fully loaded and ready to be used. For asynchronous loading use loadAsynchron(). Multiple objects can point to the same loaded language pack resource. Once no object instance uses an language pack file anymore it is released from memory.
UnicodeString Dragengine.LanguagePack.translate | ( | String | name | ) |
Translation for entry name or missing text if absent.
UnicodeString Dragengine.LanguagePack.translate | ( | String | name, |
UnicodeString | defaultValue | ||
) |
Translation for entry name or default value if absent.