@database Localer.guide

@$VER: Localer V1.10 - Original by Fabio Rotondo

This guide file has been created using AutoGuide V1.05 - By Fabio Rotondo (fsoft@intercom.it).

@node main "Amiga Foundation Classes Modules: Localer/Main"


                     ** Localer - Original By Fabio Rotondo **

                         Part of Amiga Foundation Classes

    @{"  Introduction  " LINK localer_intro}  @{" Author(s) Info " LINK author}  @{" Amiga Foundation Classes " LINK "afc.guide/main"}  @{" History " LINK "Localer_History"}

    Requires: NOTHING

    Base: $0000D000

    COMMANDS                          BRIEF DESCRIPTION
    -----------------------------------------------------------------------
    @{" localer()                   " LINK Localer_localer} Class constructor
    @{" clear()                     " LINK Localer_clear} Clears all resources
    @{" get(num, default=NIL)       " LINK Localer_get} Gets a message string
    @{" language()                  " LINK Localer_language} Returns the current language
    @{" load(cat, v=0, built=NIL)   " LINK Localer_load} Loads a catalog file
@endnode

@node localer_intro "Amiga Foundation Classes Modules: Localer/ Intro"

  INTRO

  Localer is a very simple class, which works as an interface between locale.library
  and the program you are writing.
  Using this class, you can easily add localization properties to your program
  without worrying about the AmigaOS your program will roun on.
  Infact, if the AmigaOS isn't able to handle locale.library, Localer will simply
  return default strings as program strings.

@endnode

@node author "Author's Info"


    Original By:    Fabio Rotondo

    E Version By:   Fabio Rotondo   (fsoft@intercom.it)

    C++ Version By: Inyaki Galdeano (i.amanita.s@mx3.redestb.es)

@endnode

@node Localer_History "Amiga Foundation Classes: Localer / History"

  HISTORY

  V1.00 - Initial release

  V1.10 - Added language() method

@endnode

@node localer_localer "Localer / Localer()"

          NAME: localer()

      SYNOPSIS: localer()

   DESCRIPTION: This is the class constructor.

        INPUTS: NONE

       RESULTS: NONE

         NOTES: This method will _never_ fail. It has been created to handle
                correctly all OSes, starting from AmigaOS V1.2+, so, if it isn't
                able to open locale.library, it simply ignores it.

      SEE ALSO:

@endnode

@node localer_load "Localer / Load()"

          NAME: load(catalogname, version=0, builtin=NIL)

      SYNOPSIS: struct Catalog * load(STRPTR catalogname, long version = 0, STRPTR builtin = NULL)

   DESCRIPTION: This method loads a locale's catalog.

        INPUTS: catalogname     - The name of the catalog file to load.
                                  Usually, it is the program name with the
                                  suffix ".catalog"

                version         - Catalog version. Default is 0, which means
                                  "any catalog you'll find..."

                builtin         - Built in language. (Eg. "english")

       RESULTS: The method returs a pointer to a valid catalog handle or NIL.

      SEE ALSO: @{" get()   " LINK localer_get}
                @{" clear() " LINK localer_clear}

@endnode

@node Localer_get "Localer / get() "

          NAME: get(message_number, defstring=NIL)

      SYNOPSIS: STRPTR get(int message_number, STRPTR defstr = NULL)

   DESCRIPTION: This method gets a message string from an opened catalog and
                returns it.

        INPUTS: message_number    - Number of the message string in the catalog.

                defstring         - Message string to return if any error occurs.
                                    (Default is NIL)

       RESULTS: a message string or NIL.

      SEE ALSO: @{" load() " LINK Localer_load}

@endnode

@node localer_clear "Localer / clear() "

          NAME: clear()

      SYNOPSIS: void clear()

   DESCRIPTION: This method clears a catalog file from the memory.
                After this method is invoked, you'll never be able to
                access messages strings contained inside your catalog,
                unless you open it again.

        INPUTS: NONE

       RESULTS: NONE

      SEE ALSO: @{" load() " LINK Localer_load}

@endnode

@node localer_language "Localer / language() "

          NAME: language()

      SYNOPSIS: STRPTR language()

   DESCRIPTION: This method returns the name of the current language used by the
                user.

        INPUTS: NONE

       RESULTS: a PTR TO CHAR (STRPTR) containing the name of the current language.

          NOTE: The name of the language is always ended with ".language" extension.
                So, for ex., "italiano" is "italiano.language"

      SEE ALSO:

@endnode

@node localer_version "Localer / version() "

          NAME: version()

      SYNOPSIS: long version(rev=FALSE)

   DESCRIPTION: This method returns class version and revision.

        INPUTS: NONE

       RESULTS: Class version and revision.

          NOTE: This method returns TWO values.

                The C++ method has been translated in this way:
                invoking version() without any parameter, will return
                the class VERSION; calling it with TRUE as parameter
                will return class REVISION.

      SEE ALSO:

@endnode

