|
Drag[en]gine Script Module DragonScript 1.35
|
Immutable language pack resources. More...
Public Member Functions | |
Management | |
| String | getFilename () |
| Normalized filename the language pack has been loaded from. | |
| String | getIdentifier () |
| Unique identifier. | |
| UnicodeString | getName () |
| Name in native language. | |
| UnicodeString | getDescription () |
| Description in native language. | |
| UnicodeString | translate (String name) |
| Translation for entry name or missing text if absent. | |
| UnicodeString | translate (String name, UnicodeString defaultValue) |
| Translation for entry name or default value if absent. | |
| UnicodeString | getMissingText () |
| Text used for missing translations. | |
| bool | equals (Object other) |
| LanguagePack is equal to another object. | |
| int | hashCode () |
| Hash code for use as dictionary keys. | |
Constructors | |
| LanguagePack | new (String filename) |
| Load language pack from file. | |
| static void | loadAsynchron (String filename, ResourceListener listener) |
| Load language pack from file asynchronously. | |
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).
References getMissingText().
Referenced by hashCode().
| 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.
Referenced by translate().
| String Dragengine.LanguagePack.getFilename | ( | ) |
Normalized filename the language pack has been loaded from.
References getFilename().
Referenced by getFilename().
| String Dragengine.LanguagePack.getIdentifier | ( | ) |
Unique identifier.
This is used to uniquely identify the language pack.
References getIdentifier().
Referenced by getIdentifier().
| UnicodeString Dragengine.LanguagePack.getMissingText | ( | ) |
| UnicodeString Dragengine.LanguagePack.getName | ( | ) |
| int Dragengine.LanguagePack.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
References equals(), and hashCode().
Referenced by 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.
References loadAsynchron().
Referenced by loadAsynchron().
| 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.
References new().
Referenced by new().
| UnicodeString Dragengine.LanguagePack.translate | ( | String | name | ) |
Translation for entry name or missing text if absent.
Referenced by getMissingText().
| UnicodeString Dragengine.LanguagePack.translate | ( | String | name, |
| UnicodeString | defaultValue ) |
Translation for entry name or default value if absent.
References getDescription().