org.kde.koala
Class KCatalogue

java.lang.Object
  extended by org.kde.koala.KCatalogue
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KCatalogue
extends java.lang.Object
implements org.kde.qt.QtSupport

This class abstracts a gettext message catalog. It will take care of opening the file and reading the catalog.

See Also:
KLocale

Constructor Summary
  KCatalogue()
           
protected KCatalogue(java.lang.Class dummy)
           
  KCatalogue(KCatalogue rhs)
          Copy constructor.
  KCatalogue(java.lang.String name)
           
  KCatalogue(java.lang.String name, java.lang.String language)
          Constructor.
 
Method Summary
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 java.lang.String language()
          Returns the language of the catalog.
 java.lang.String name()
          Returns the name of the catalog.
 int pluralType()
          Returns the plural type for the catalog.
 void setPluralType(int pluralType)
          Sets the plural type for the catalog.
 java.lang.String translate(java.lang.String msgid)
          Retrieves a translation of the specified message id.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KCatalogue

protected KCatalogue(java.lang.Class dummy)

KCatalogue

public KCatalogue(java.lang.String name,
                  java.lang.String language)
Constructor.

Parameters:
name - The name of the catalog
language - The language of this catalog

KCatalogue

public KCatalogue(java.lang.String name)

KCatalogue

public KCatalogue()

KCatalogue

public KCatalogue(KCatalogue rhs)
Copy constructor.

Method Detail

name

public java.lang.String name()
Returns the name of the catalog.

Returns:
The name of the catalog

language

public java.lang.String language()
Returns the language of the catalog.

Returns:
The language of the catalog

pluralType

public int pluralType()
Returns the plural type for the catalog. This type is based on the language of the catalog and is cached for performance.

Returns:
The plural type for the catalog

setPluralType

public void setPluralType(int pluralType)
Sets the plural type for the catalog. The caller has probably looked it up in a kdelibs.mo-catalog for the appropriate language


translate

public java.lang.String translate(java.lang.String msgid)
Retrieves a translation of the specified message id. Do not pass 0 or "" strings as message ids.

Parameters:
msgid - The message id
Returns:
The translated message, in utf8 encoding, or 0 if not found

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?