Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.LanguagePackBuilder Class Reference

LanguagePack builder. More...

Inheritance diagram for Dragengine.Scenery.LanguagePackBuilder:

Public Member Functions

Constructors
LanguagePackBuilder new ()
 Create language pack builder. More...
 

Management

LanguagePack build (String filename)
 Build language pack using filename. More...
 
void buildLanguagePack ()
 Build language pack. More...
 
void setDescription (UnicodeString description)
 Set description in native language. More...
 
void setMissingText (UnicodeString missingText)
 Set missing translation text in native language. More...
 
void setEntryCount (int count)
 Set count of entries. More...
 
void setEntryAt (int index, String name, UnicodeString text)
 Set entry. More...
 

Detailed Description

LanguagePack builder.

Builds language pack resource without requiring a language pack resource file. The created language pack can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named language packs can not clash with filenames present in the virtual file system. For this reason use unnamed language packs if possible. Using named language packs though can be useful if you want to provide language pack resources to scripts not needing to know if the path they try to load is a build language pack instead of a resource one.

To use the language pack builder create a subclass and implement LanguagePackBuilder.buildLanguagePack() . You are only allowed to call methods from LanguagePackBuilder from inside this function call. To create the language pack call LanguagePackBuilder.build() . This will call LanguagePackBuilder.buildLanguagePack() to fill a new language pack resource with content. Once finished the build method returns the ready to use language pack resource. Otherwise an exception is thrown.

This is a native class.

Member Function Documentation

◆ build()

LanguagePack Dragengine.Scenery.LanguagePackBuilder.build ( String  filename)

Build language pack using filename.

The created language pack can either be unnamed (if filename is empty string) or named (if filename is not empty string). Named language packs can not clash with filenames present in the virtual file system. For this reason use unnamed language packs if possible. Using named language packs though can be useful if you want to provide language pack resources to scripts not needing to know if the path they try to load is a build language pack instead of a resource one.

To create the language pack call build() . This will call buildLanguagePack() to fill a new language pack resource with content. Once finished the build method returns the ready to use language pack resource. Otherwise an exception is thrown.

◆ buildLanguagePack()

void Dragengine.Scenery.LanguagePackBuilder.buildLanguagePack ( )
protected

Build language pack.

Called by build(String) to fill a new language pack resource with content. You are only allowed to call methods from LanguagePackBuilder from inside this function call.

◆ new()

LanguagePackBuilder Dragengine.Scenery.LanguagePackBuilder.new ( )

Create language pack builder.

◆ setDescription()

void Dragengine.Scenery.LanguagePackBuilder.setDescription ( UnicodeString  description)
protected

Set description in native language.

◆ setEntryAt()

void Dragengine.Scenery.LanguagePackBuilder.setEntryAt ( int  index,
String  name,
UnicodeString  text 
)
protected

Set entry.

◆ setEntryCount()

void Dragengine.Scenery.LanguagePackBuilder.setEntryCount ( int  count)
protected

Set count of entries.

◆ setMissingText()

void Dragengine.Scenery.LanguagePackBuilder.setMissingText ( UnicodeString  missingText)
protected

Set missing translation text in native language.


The documentation for this class was generated from the following file: