/****************************************************************
   This file was created automatically by `KitCat V1.1'
   Do NOT edit by hand!
****************************************************************/

#ifndef LOCALE_H
#include "LOCALE.h"
#endif  /*  !LOCALE_H           */

#ifndef CLIB_LOCALE_PROTOS_H
#include <clib/locale_protos.h>
#endif  /*  !CLIB_LOCALE_PROTOS_H   */

#ifdef AZTEC_C
#ifndef __PRAGMAS_LOCALE_LIB_H
#include <pragmas/locale_lib.h>
#endif /*   !PRAGMAS_LOCALE_LIB_H   */
#endif /*   AZTEC_C                 */

static LONG MegaViewVersion = 0;
static const STRPTR MegaViewBuiltInLanguage = (STRPTR) "english";

struct KCMegaViewArrayType
{   LONG    cca_ID;
    STRPTR  cca_Str;
};

static const struct KCMegaViewArrayType KCMegaViewArray [] =
{
    {msgOK, (STRPTR)msgOK_STR},
    {msgNeedWhatIs, (STRPTR)msgNeedWhatIs_STR},
    {msgNeedIntuition, (STRPTR)msgNeedIntuition_STR},
    {msgNeedWorkbench, (STRPTR)msgNeedWorkbench_STR},
    {msgNeedIcon, (STRPTR)msgNeedIcon_STR},
    {msgNeedASL, (STRPTR)msgNeedASL_STR},
    {msgNeedActionfile, (STRPTR)msgNeedActionfile_STR},
    {msgMissingNewline, (STRPTR)msgMissingNewline_STR},
    {msgParseError, (STRPTR)msgParseError_STR},
    {msgUnknownFiletype, (STRPTR)msgUnknownFiletype_STR},
    {msgErrorReadingDir, (STRPTR)msgErrorReadingDir_STR},
    {msgErrorFileInfoBlock, (STRPTR)msgErrorFileInfoBlock_STR},
    {msgErrorCurrentDir, (STRPTR)msgErrorCurrentDir_STR},
    {msgErrorLockDirectory, (STRPTR)msgErrorLockDirectory_STR},
    {msgNoAction, (STRPTR)msgNoAction_STR},
    {msgErrorLockFile, (STRPTR)msgErrorLockFile_STR},
    {msgErrorAllocateBuffer, (STRPTR)msgErrorAllocateBuffer_STR},
    {msgReqText, (STRPTR)msgReqText_STR},
    {msgErrorAppIcon, (STRPTR)msgErrorAppIcon_STR},
    {msgErrorCreatePort, (STRPTR)msgErrorCreatePort_STR},
    {msgErrorAppMenu, (STRPTR)msgErrorAppMenu_STR},
    {msgErrorMenuIcon, (STRPTR)msgErrorMenuIcon_STR},
    {msgWorkbenchUsage, (STRPTR)msgWorkbenchUsage_STR},
    {msgErrorIcon, (STRPTR)msgErrorIcon_STR},
    {msgNoIcon, (STRPTR)msgNoIcon_STR},
    {msgErrorManDir, (STRPTR)msgErrorManDir_STR},
    {msgErrorAnchor, (STRPTR)msgErrorAnchor_STR},
    {msgNeedFilename, (STRPTR)msgNeedFilename_STR},
};

static struct Catalog *MegaViewCatalog = NULL;
void OpenMegaViewCatalog(struct Locale *loc, STRPTR language)
{ LONG tag, tagarg;
  extern struct Library *LocaleBase;

  CloseMegaViewCatalog();
  if (language == NULL)
  { tag = TAG_IGNORE;
  }
  else
  { tag = OC_Language;
    tagarg = (LONG) language;
  }
  if (LocaleBase != NULL  &&  MegaViewCatalog == NULL)
  { MegaViewCatalog = OpenCatalog(loc, (STRPTR) "MegaView.catalog",
                             OC_BuiltInLanguage, MegaViewBuiltInLanguage,
                             tag, tagarg,
                             OC_Version, MegaViewVersion,
                             TAG_DONE);
  }
}

void CloseMegaViewCatalog(void)
{ if (LocaleBase != NULL)
    CloseCatalog(MegaViewCatalog);
  MegaViewCatalog = NULL;
}

STRPTR GetString(LONG strnum)
{ STRPTR defaultstr = NULL;
  LONG i;

  for (i = 0;  i < sizeof(KCMegaViewArray)/sizeof(struct KCMegaViewArrayType);  i++)
    { if (KCMegaViewArray[i].cca_ID == strnum)
      { defaultstr = KCMegaViewArray[i].cca_Str;
        break;
      }
    }
  if (MegaViewCatalog == NULL)
  { return(defaultstr);
  }
  return(GetCatalogStr(MegaViewCatalog, strnum, defaultstr));
}
