Overview | Package | Class | Tree | Deprecated | Index | Help

3.00.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## interbase.interclient
Class Resources

    java.lang.Object
      |
      +--java.util.ResourceBundle
            |
            +--java.util.ListResourceBundle
                  |
                  +--interbase.interclient.Resources

public class Resources
extends ListResourceBundle

Default resource bundle for InterClient error messages and hardwired text within the driver.

This is the default (English) resource bundle. You can provide your own locale-specific bundle with an ISO language suffix appended to the class name for your language. Additional or replacement locale-specific resource bundles must reside in the `interbase.interclient` package.

The driver locates the appropriate resource bundle for your locale by using

     java.util.ResourceBundle.getBundle("interbase.interclient.Resources");

Using the ClassLoader, this call in turn looks for the appropriate bundle as a .class file in the following order based on your locale:

1. Resources_language_country_variant
2. Resources_language_country
3. Resources_language
4. Resources (this is the default bundle shipped with InterClient)

Instructions for customizing resources for your locale:
Follow these instructions only if a resource bundle for your locale is not already included in the InterClient distribution. You may also request the java source file for this Resources class by mailing interclient@borland.com. Having the Resources.java source file will save you from having to call `getContents()` as described below.

1. Get the contents from this Resources class by calling `getContents()`. Set aside for translation; write the contents, including keys and text, to a file or printer for translation.
2. Create a Resources_*.java class for your locale with translated text. Be sure the class is public, extends `java.util.ListResourceBundle` and and is in the package `interbase.interclient`. For example:

        // A French language resource bundle for InterClient.
        package interbase.interclient;

        public class Resources_fr extends java.util.ListResourceBundle
        {
          // Contains the translated text for each resource key from default Resources contents.
          static private final Object[][] contents =
          {
            {"1", "Mot de passe incorrect"}, // The password is incorrect
            {"2", "Saisie du mot de passe"}, // Enter your password
            ...
            {"98", "Quitter"} // Exit
          }

          public Object[][] getContents()
          {
            return contents;
          }
        }

3. Use `jar xvf interclient.jar` to extract the InterClient class files, and include your new `Resources_fr.class` in the `interbase/interclient` directory. Use `jar cvf0 interclient.jar interbase borland` to archive all the files back into a new `interclient.jar` file. Class directories `interbase/interclient`, `interbase/interclient/utils`, `borland/jdbc`, and `com/inprise/jdbc` should all be archived by this command.

   Alternatively, modify the separate resource archive interclient-res.jar, and include both `interclient-core.jar`, `interclient-res.jar`, and optionally `interclient-utils.jar` in your classpath. For more information on jar, refer to the documentation for your Java Development Kit.

A good article on using resources for localization may be found at http://developer.java.sun.com/developer/technicalArticles/ResourceBundles.html

Note for bundle designers: All resource strings are processed by `java.text.MessageFormat.format(String, Object[])`, so all occurrences of the {, } and ' characters in resource strings must be delimited with quotes as '{', or '}' for the { and } characters, and '' for the ' character. For details see the Sun javadocs for class `java.text.MessageFormat`.

Since:
  Extension, since InterClient 1.50
See Also:
  `Locale`, `ResourceBundle`

Fields inherited from class java.util.ResourceBundle
`parent`

Constructor Summary
`Resources()`

Method Summary
`Object[][]` | `getContents()` Extracts an array of key, resource pairs for this bundle.

Methods inherited from class java.util.ListResourceBundle
`getKeys, handleGetObject`

Methods inherited from class java.util.ResourceBundle
`getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Resources

    public Resources()

Method Detail

### getContents

    public Object[][] getContents()

  Extracts an array of key, resource pairs for this bundle.
  Overrides:
    `getContents` in class `ListResourceBundle`
  Since:
    Extension, since InterClient 1.50

Overview | Package | Class | Tree | Deprecated | Index | Help

3.00.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Send comments or suggestions to interclient@borland.com