LoadMessageCatalog
Previous Topic  Next Topic 

::InstallAPI::LoadMessageCatalog


Load a message catalog file into the current installer.  This will overwrite text that is already stored in a message catalog or create new message catalogs for languages that do not already exist.  Loading messages for a language that does not exist will not add the language to the installer.  Use the AddLanguage API for that.



Supported Platforms

All



Returns

A list of language codes used.



Options


-data <data string>

This data will be parsed just like the contents of a message catalog.  This option can be used to load messages that are read from some other location instead of loading from a file.


-dir <directory>

This option specifies a directory to be searched for *.msg files.  Each file in the directory must be named after its language code, and each file will be loaded based on the language code and contents of the file.  Loading a message catalog for a language that does not exist will not result in an error, but the language will not be added to the running installer.  Use the AddLanguage API for that.


-encoding <encoding>

This option specifies the encoding to use when reading a message catalog from a file or from data.


-file <filename>

The name of a message catalog file to load.  If the name of the file is <code>.msg where <code> is a valid language code in the current installer, the message catalog will be loaded into that language.  If the file does not match a language in the installer, you must specify the -language option to tell InstallJammer which language to add the messages to.


-language <language or language code>

The language to load the message catalog into.  If this option is specified, it will override any other option that InstallJammer might use to determine the language from the file name.


-object <object ID or alias>

This option specifies the ID or alias of a file object contained within the installer that should be loaded as a message catalog.  This allows you to package message catalogs into your installer along with the rest of your files and then load them as-needed at runtime.  If the name of the file does not match a language in the installer, you must specify the -language option to tell InstallJammer which language to add the messages to.



Example


The following example loads a message catalog packaged within the installer with an alias of Messages File and adds the messages to the English language.


::InstallAPI::AddLanguage -language English -object "Messages File"


The following example loads any *.msg file from a directory called msgs located in the same directory as the installer.  These files would most likely be included with a release on CD.  Notice the -subst 1 option that tells the API to substitute the options passed for virtual text.


::InstallAPI::AddLanguage -subst 1 -dir <%InstallSource%>/msgs


The following example loads a single file located in the directory with the installer into the Spanish language.


::InstallAPI::AddLanguage -subst 1 -file <%InstallSource%>/es.msg