Menu
Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.3
Developing Drivers for Data Stores Without SQL

Localizing Messages

SimbaEngine X SDK includes sample string resources for the warning and error messages that it may generate. These strings are provide in English, as well as other languages including German, French, Spanish, and Japanese. These files are intended as a starting point to aid you in the localization process. You can modify the localized strings that are provided, provide your own driver-specific messages, and add support for additional languages.

Note:

The files provided for languages other than English are not complete. Some of these strings are still in English and require further translation.

Customers can configure the locale, or language, of the messages that the driver uses. Configuration can be done driver-wide so that all connections use the same locale for their messages, or per-connection so each connection uses a different locale.

Configuring the Driver Locale

Customers can configure the locale of driver for all connections (driver-wide locale) or for individual connections. If the locale is not configured, the default locale of US English (en-US) is used for all messages.

Configuring the Driver-Wide Locale

A single locale is specified for the driver, and all connections use the same language for any messages.

To configure the driver-wide locale on Windows:

  1. In the Windows registry, navigate to the following registry key:
    • For 32-bit drivers on 32-bit machines or 64-bit drivers on 64-bit machines, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\<Company>\<DriverName>\Driver, where <Company> is your company name and <DriverName> is the name of your driver.
      For example, for the Simba Quickstart driver, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Simba\Quickstart\Driver.
    • Or, for 32-bit drivers on 64-bit machines, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\<Company>\<DriverName>\Driver, where <Company> is your company name and <DriverName> is the name of your driver.
      For example, for the Simba Quickstart driver, navigate to HKEY_LOCAL_MACHINE\SOFTWARE/Wow6432Node\Simba\Quickstart\Driver.
  2. In the <Customer>/<DriverName>/Driver section of the registry, add or modify the DriverLocale key to contain the desired locale code. For a list of locale codes, see Locale Codes.

To configure the driver-wide locale on Unix, Linux, and MacOS/X:

  1. Locate the .ini configuration file for the desired driver.
  2. Modify the DriverLocale string to contain the desired locale code. For a list of locale codes, see Locale Codes.

Configuring Per-Connection Locale

A locale is configured for each connection, so each connection can use a different language for error messages. If the locale is not configured for a connection, then the driver-wide locale is used.

To configure the connection-wide locale on Windows:

  1. In the Windows registry, navigate to the to the registry key for the DSN that is used for the connection:
    • For 32-bit drivers on 32-bit machines or 64-bit drivers on 64-bit machines, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<Company>DSII, where <Company> is your company name.
      For example, for the Simba Quickstart driver, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\QuickstartDSII.
    • Or, for 32-bit drivers on 64-bit machines, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432\ODBC\ODBC.INI\<Company>DSII, where <Company> is your company name.
      For example, for the Simba Quickstart driver, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432\ODBC\ODBC.INI\QuickstartDSII.
  2. Modify the Locale key to contain the desired locale code. For a list of locale codes, see Locale Codes.

To configure the driver-wide locale on Unix, Linux, and macOS:

  1. Locate the .ini configuration file for the desired driver.
  2. Modify the Locale string to contain the desired locale code. For a list of locale codes, see Locale Codes.

Locale Codes

Locales are specified using a two-letter language code in lower case and an optional two letter country code in upper case. If a country code is specified, it must be separated from the language code by a hyphen (-).

Examples:

  • en-US (English – United States)
  • fr-CA (French – Canada)
  • it-IT (Italian – Italy)
  • de-DE (German – Germany)
  • es-ES (Spanish – Spain (Traditional))
  • ja (Japanese)

The language code can be any language in the ISO 639-1 standard: http://www.loc.gov/standards/iso639-2/php/code_list.php. The country code can be any country in the ISO 3166-1 Alpha-2 standard: http://www.iso.org/iso/country_codes/iso-3166-1_decoding_table.htm.

Localizing Your Driver

The SimbaEngine X SDK provides English strings for the error and warning messages that its components generate. These messages are contained XML files for ODBC and in a Java Resource Bundle for JDBC. When developing your own driver, you can create additional messages in English for any errors and warnings that are specific to your driver. To provide your driver-specific messages, create driver-specific XML files or Java a Resource Bundle containing your messages in the same format as the exiting SimbaEngine X SDK message files. For information about error messages files, see Including Error Message Files.

DSIMessageSource automatically handles the loading and exposure of these messages to your driver. Your driver has to call DSIMessageSource::RegisterMessages, passing in the root name of the driver specific message file. The root name is the file name without an extension or locale code. For example, the root name for the QuickStart driver is QSMessages. A good place to call this method is in the constructor of the driver class that inherits from DSIDriver.

The driver can also implement its own message source by inheriting from DSIMessageSource and handling driver-specific messages, which may be in different format and location than those from the SimbaEngine X SDK. For example, the messages may be stored in a database. The handling of SDK messages in this case can still be delegated to DSIMessageSource. Alternatively, IMessageSource can be implemented directly, but the implementation must handle both the driver specific messages and the SimbaEngine X SDK messages. For more information on implementing error messages, see Using or Building a Message Source in Handling Errors and Exceptions.

To support a locale for which the SimbaEngine X SDK provides a translation when using the default DSIMessageSource class, translate the messages in your driver-specific message file and follow the naming convention described in the following subsections. To support a locale for which the SDK does not provide a translation, translate both the driver-specific and SimbaEngine X SDK message files.

Additional Language Support

In addition to the languages that are shipped with the SimbaEngine X SDK, translated messages strings for other languages are also available. For more information on obtaining these strings, contact Simba Technologies Inc.

 

Related Links

Localizing Messages

Posting Warning Messages

Including Error Message Files

Localizing Messages