/****************************************************************
   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 FAEditVersion = 0;
static const STRPTR FAEditBuiltInLanguage = (STRPTR) "english";

struct KCFAEditArrayType
{   LONG    cca_ID;
    STRPTR  cca_Str;
};

static const struct KCFAEditArrayType KCFAEditArray [] =
{
    {msgProject, (STRPTR)msgProject_STR},
    {msgAbout, (STRPTR)msgAbout_STR},
    {msgOpen, (STRPTR)msgOpen_STR},
    {msgSave, (STRPTR)msgSave_STR},
    {msgSaveAs, (STRPTR)msgSaveAs_STR},
    {msgQuit, (STRPTR)msgQuit_STR},
    {msgNoQuotes, (STRPTR)msgNoQuotes_STR},
    {msgQuotes, (STRPTR)msgQuotes_STR},
    {msgSelectFileSave, (STRPTR)msgSelectFileSave_STR},
    {msgSelectFileLoad, (STRPTR)msgSelectFileLoad_STR},
    {msgYouNeed20, (STRPTR)msgYouNeed20_STR},
    {msgYouNeedMUI, (STRPTR)msgYouNeedMUI_STR},
    {msgCantOpenWhatIs, (STRPTR)msgCantOpenWhatIs_STR},
    {msgFAEditMsg, (STRPTR)msgFAEditMsg_STR},
    {msgOK, (STRPTR)msgOK_STR},
    {msgMissingNEWLINE, (STRPTR)msgMissingNEWLINE_STR},
    {msgParseError, (STRPTR)msgParseError_STR},
    {msgUnableToWrite, (STRPTR)msgUnableToWrite_STR},
    {msgInvalidFilename, (STRPTR)msgInvalidFilename_STR},
    {msgOverwrite, (STRPTR)msgOverwrite_STR},
    {msgOkCancel, (STRPTR)msgOkCancel_STR},
    {msgUnableToOpen, (STRPTR)msgUnableToOpen_STR},
    {msgFileactionEditor, (STRPTR)msgFileactionEditor_STR},
    {msgType, (STRPTR)msgType_STR},
    {msgAction, (STRPTR)msgAction_STR},
    {msgDiskIO, (STRPTR)msgDiskIO_STR},
    {msgLoadFileactions, (STRPTR)msgLoadFileactions_STR},
    {msgSaveFileactions, (STRPTR)msgSaveFileactions_STR},
    {msgFailedToOpenMUI, (STRPTR)msgFailedToOpenMUI_STR},
    {msgAboutText, (STRPTR)msgAboutText_STR},
    {msgHotKeys, (STRPTR)msgHotKeys_STR},
};

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

  CloseFAEditCatalog();
  if (language == NULL)
  { tag = TAG_IGNORE;
  }
  else
  { tag = OC_Language;
    tagarg = (LONG) language;
  }
  if (LocaleBase != NULL  &&  FAEditCatalog == NULL)
  { FAEditCatalog = OpenCatalog(loc, (STRPTR) "FAEdit.catalog",
                             OC_BuiltInLanguage, FAEditBuiltInLanguage,
                             tag, tagarg,
                             OC_Version, FAEditVersion,
                             TAG_DONE);
  }
}

void CloseFAEditCatalog(void)
{ if (LocaleBase != NULL)
    CloseCatalog(FAEditCatalog);
  FAEditCatalog = NULL;
}

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

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