Name
OpenCatalog -- open a locale catalog
Synopsis
OpenCatalog(name$[, version])
Function
This function tries to open the catalog specified by name$ in the user's language. If a catalog in the user's language does not exist, this function will not fail. You have to specify alternative English strings in the GetCatalogString() function that will be used if there is no catalog in the user's language.

By default, Hollywood will search for catalogs inside a sub-directory named "Catalogs" inside the current directory. For example, if the current user's language is #LANGUAGE_GERMAN and you try to open "MyProgram.catalog" using OpenCatalog(), Hollywood will look in the following places for the catalog:

 
<current-directory>/Catalogs/deutsch/MyProgram.catalog
<current-directory>/Catalogs/german/MyProgram.catalog

If the current user's language is #LANGUAGE_FRENCH, Hollywood will look in these places for the catalog:

 
<current-directory>/Catalogs/français/MyProgram.catalog
<current-directory>/Catalogs/french/MyProgram.catalog

Note that on AmigaOS and compatibles, Hollywood will also scan Locale:Catalogs for the catalog.

Note that it is recommended to use international names for the language sub-directory, i.e. "german" instead of "deutsch" and "french" instead of "français". The native names are only supported for compatibility reasons with AmigaOS-based systems.

The catalog specified in name$ can be either in the IFF CTLG format developed by Commodore, or it can be in a platform-neutral format defined by Hollywood. It is recommended to use Hollywood's platform-neutral format because IFF CTLG doesn't support Unicode and has some other restrictions and potential compatibility issues. See Catalog format for details.

This command is also available from the preprocessor. Use @CATALOG to load catalogs from the preprocessor.

Inputs
name$
catalog to open
version
optional: version that the catalog must have at least; if omitted this function will accept any version
Example
OpenCatalog("Hollywood.catalog")

; this is our default English catalog
def$ = {}
def$[0] = "Welcome to Hollywood!"
def$[1] = "Written by Andreas Falkenhahn"
def$[2] = "What do you want to do?"

; if Hollywood.catalog is not available in the
; user's language; the English strings will be
; used
For k = 0 To 2
   c$[k] = GetCatalogString(k, def$[k])
Next

CloseCatalog()
The code above opens "Hollywood.catalog" and prints the first three entries from that catalog.

Show TOC