home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lora299s.zip / LANGUAGE.CPP < prev    next >
Text File  |  1998-05-12  |  28KB  |  640 lines

  1.  
  2. // LoraBBS Version 2.99 Free Edition
  3. // Copyright (C) 1987-98 Marco Maccaferri
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #include "_ldefs.h"
  20. #include "lora_api.h"
  21.  
  22. typedef struct {
  23.    USHORT Id;
  24.    PSZ    Text;
  25. } KEYWORDS;
  26.  
  27. static KEYWORDS Keywords[] = {
  28.    { LNG_LANGUAGE_NAME, "LanguageName" },
  29.    { LNG_MENUNAME, "MenuName" },
  30.    { LNG_TEXTFILES, "TextFiles" },
  31.    { LNG_MENUPATH, "MenuPath" },
  32.    { LNG_YES, "Yes" },
  33.    { LNG_NO, "No" },
  34.    { LNG_NONE, "None" },
  35.    { LNG_MALE, "Male" },
  36.    { LNG_FEMALE, "Female" },
  37.    { LNG_YESKEY, "YesKey" },
  38.    { LNG_NOKEY, "NoKey" },
  39.    { LNG_HELPKEY, "HelpKey" },
  40.    { LNG_MALEKEY, "MaleKey" },
  41.    { LNG_FEMALEKEY, "FemaleKey" },
  42.    { LNG_JANUARY, "January" },
  43.    { LNG_FEBRUARY, "February" },
  44.    { LNG_MARCH, "March" },
  45.    { LNG_APRIL, "April" },
  46.    { LNG_MAY, "May" },
  47.    { LNG_JUNI, "Juni" },
  48.    { LNG_JULY, "July" },
  49.    { LNG_AUGUST, "August" },
  50.    { LNG_SEPTEMBER, "September" },
  51.    { LNG_OCTOBER, "October" },
  52.    { LNG_NOVEMBER, "November" },
  53.    { LNG_DECEMBER, "December" },
  54.    { LNG_MOREQUESTION, "MoreQuestion" },
  55.    { LNG_DELETEMOREQUESTION, "DeleteMoreQuestion" },
  56.    { LNG_NONSTOP, "NonStop" },
  57.    { LNG_QUIT, "Quit" },
  58.    { LNG_CONTINUE, "Continue" },
  59.    { LNG_PRESSENTER, "PressEnter" },
  60.    { LNG_DEFYESNO, "DefYesNo" },
  61.    { LNG_YESDEFNO, "YesDefNo" },
  62.    { LNG_DEFYESNOHELP, "DefYesNoHelp" },
  63.    { LNG_YESDEFNOHELP, "YesDefNoHelp" },
  64.    { LNG_ENTERNAME, "EnterName" },
  65.    { LNG_NAMENOTFOUND, "NameNotFound" },
  66.    { LNG_CONTINUEASNEW, "ContinueAsNew" },
  67.    { LNG_READERFROM, "ReaderFrom" },
  68.    { LNG_READERTO, "ReaderTo" },
  69.    { LNG_READERSUBJECT, "ReaderSubject" },
  70.    { LNG_READERFILE, "ReaderFile" },
  71.    { LNG_MESSAGETEXT, "MessageText" },
  72.    { LNG_MESSAGEQUOTE, "MessageQuote" },
  73.    { LNG_MESSAGEKLUDGE, "MessageKludge" },
  74.    { LNG_MESSAGEORIGIN, "MessageOrigin" },
  75.    { LNG_MESSAGEDATE, "MessageDate" },
  76.    { LNG_MESSAGEISREPLY, "MessageIsReply" },
  77.    { LNG_MESSAGESEEALSO, "MessageSeeAlso" },
  78.    { LNG_MESSAGEISBOTH, "MessageIsBoth" },
  79.    { LNG_MESSAGEHDR, "MessageHdr" },
  80.    { LNG_MESSAGENUMBER, "MessageNumber" },
  81.    { LNG_MESSAGENUMBER1, "MessageNumber1" },
  82.    { LNG_MESSAGENUMBER2, "MessageNumber2" },
  83.    { LNG_MESSAGENUMBER3, "MessageNumber3" },
  84.    { LNG_MESSAGEFLAGS, "MessageFlags" },
  85.    { LNG_MESSAGEFROM, "MessageFrom" },
  86.    { LNG_MESSAGETO, "MessageTo" },
  87.    { LNG_MESSAGESUBJECT, "MessageSubject" },
  88.    { LNG_MESSAGEFILE, "MessageFile" },
  89.    { LNG_ASKANSI, "AskAnsi" },
  90.    { LNG_ASKAVATAR, "AskAvatar" },
  91.    { LNG_ASKCOLOR, "AskColor" },
  92.    { LNG_ASKFULLSCREEN, "AskFullScreen" },
  93.    { LNG_ASKALIAS, "AskAlias" },
  94.    { LNG_ASKHOTKEY, "AskHotkey" },
  95.    { LNG_ASKIBMCHARS, "AskIBMChars" },
  96.    { LNG_ASKLINES, "AskLines" },
  97.    { LNG_ASKPAUSE, "AskPause" },
  98.    { LNG_ASKSCREENCLEAR, "AskScreenClear" },
  99.    { LNG_ASKBIRTHDATE, "AskBirthDate" },
  100.    { LNG_ASKMAILCHECK, "AskMailCheck" },
  101.    { LNG_ASKFILECHECK, "AskFileCheck" },
  102.    { LNG_DISCONNECT, "Disconnect" },
  103.    { LNG_CURRENTPASSWORD, "CurrentPassword" },
  104.    { LNG_WHYPASSWORD, "WhyPassword" },
  105.    { LNG_INVALIDPASSWORD, "InvalidPassword" },
  106.    { LNG_WRONGPASSWORD, "WrongPassword" },
  107.    { LNG_MESSAGEAREAREQUEST, "MessageAreaRequest" },
  108.    { LNG_MESSAGEAREAHEADER, "MessageAreaHeader" },
  109.    { LNG_MESSAGEAREACURSOR, "MessageAreaCursor" },
  110.    { LNG_MESSAGEAREAKEY, "MessageAreaKey" },
  111.    { LNG_MESSAGEAREASEPARATOR, "MessageAreaSeparator" },
  112.    { LNG_MESSAGEAREADESCRIPTION1, "MessageAreaDescription1" },
  113.    { LNG_MESSAGEAREADESCRIPTION2, "MessageAreaDescription2" },
  114.    { LNG_MESSAGEAREALIST, "MessageAreaList" },
  115.    { LNG_FILEPROTOCOLLIST, "FileProtocolList" },
  116.    { LNG_FILETAGGEDWARNING, "FileTaggedWarning" },
  117.    { LNG_FILENOBYTESWARNING, "FileBytesWarning" },
  118.    { LNG_FILENOTIMEWARNING, "FileNoTimeWarning" },
  119.    { LNG_FILEBEGINDOWNLOAD, "FileBeginDownload" },
  120.    { LNG_FILEBEGINDOWNLOAD2, "FileBeginDownload2" },
  121.    { LNG_FILETAGGEDHEADER, "FileTaggedHeader" },
  122.    { LNG_FILETAGGEDLIST, "FileTaggedList" },
  123.    { LNG_FILETAGGEDTOTAL, "FileTaggedTotal" },
  124.    { LNG_FILEDOWNLOADERROR, "FileDownloadError" },
  125.    { LNG_FILEDOWNLOADCOMPLETE, "FileDownloadComplete" },
  126.    { LNG_FILEBUILDLIST, "FileBuildList" },
  127.    { LNG_FILENOTAGGED, "FileNoTagged" },
  128.    { LNG_FILETAGLISTED, "FileTagListed" },
  129.    { LNG_FILELISTTAGCONFIRM, "FileListTagConfirm" },
  130.    { LNG_FILELISTNOTFOUND, "FileListNotFound" },
  131.    { LNG_FILELISTHEADER, "FileListHeader" },
  132.    { LNG_FILELISTSEPARATOR, "FileListSeparator" },
  133.    { LNG_FILELISTDESCRIPTION1, "FileListDescription1" },
  134.    { LNG_FILELISTDESCRIPTION2, "FileListDescription2" },
  135.    { LNG_FILELISTTAGGED, "FileListTagged" },
  136.    { LNG_FILELISTNORMAL, "FileListNormal" },
  137.    { LNG_FILELISTMOREQUESTION, "FileListMoreQuestion" },
  138.    { LNG_FILELISTDELETEMOREQUESTION, "FileListDeleteMoreQuestion" },
  139.    { LNG_FILELISTTAGKEY, "FileListTagKey" },
  140.    { LNG_FILELISTNOFILESFOUND, "FileListNoFilesFound" },
  141.    { LNG_FILELISTCOMMENT, "FileListComment" },
  142.    { LNG_FILEAREAREQUEST, "FileAreaRequest" },
  143.    { LNG_FILEAREAHEADER, "FileAreaHeader" },
  144.    { LNG_FILEAREASEPARATOR, "FileAreaSeparator" },
  145.    { LNG_FILEAREADESCRIPTION1, "FileAreaDescription1" },
  146.    { LNG_FILEAREADESCRIPTION2, "FileAreaDescription2" },
  147.    { LNG_FILEAREACURSOR, "FileAreaCursor" },
  148.    { LNG_FILEAREAKEY, "FileAreaKey" },
  149.    { LNG_FILEAREALIST, "FileAreaList" },
  150.    { LNG_FILEAREANOTAVAILABLE, "FileAreaNotAvailable" },
  151.    { LNG_FILENAMETODELETE, "FileNameToDelete" },
  152.    { LNG_FILEDELETED, "FileDeleted" },
  153.    { LNG_FILETODETAG, "FileToDetag" },
  154.    { LNG_FILEDETAGGED, "FileDetagged" },
  155.    { LNG_FILETAGEMPTY, "FileTagEmpty" },
  156.    { LNG_FILETOTAG, "FileToTag" },
  157.    { LNG_FILETAGCONFIRM, "FileTagConfirm" },
  158.    { LNG_FILENOTFOUND, "FileNotFound" },
  159.    { LNG_REENTERPASSWORD, "ReenterPassword" },
  160.    { LNG_ONLINETITLE, "OnlineTitle" },
  161.    { LNG_ONLINEHEADER, "OnlineHeader" },
  162.    { LNG_ONLINEENTRY, "OnlineEntry" },
  163.  
  164.  
  165.    { LNG_ASKADDRESS, "AskAddress" },
  166.    { LNG_ASKCITY, "AskCity" },
  167.    { LNG_ASKCOMPANYNAME, "AskCompanyName" },
  168.    { LNG_ASKDAYPHONE, "AskDayPhone" },
  169.    { LNG_ASKPASSWORD, "AskPassword" },
  170.    { LNG_ASKSEX, "AskSex" },
  171.    { LNG_ENTERNAMEORNEW, "EnterNameOrNew" },
  172.    { LNG_ENTERPASSWORD, "EnterPassword" },
  173.    { LNG_HAVETAGGED, "HaveTagged" },
  174.    { LNG_YOUSURE, "YouSure" },
  175.    { LNG_USERFROMCITY, "UserFromCity" },
  176.    { LNG_MENUERROR, "MenuError" },
  177.    { LNG_MSGFLAG_RCV, "MessageFlagRcv" },
  178.    { LNG_MSGFLAG_SNT, "MessageFlagSnt" },
  179.    { LNG_MSGFLAG_PVT, "MessageFlagPvt" },
  180.    { LNG_MSGFLAG_CRA, "MessageFlagCra" },
  181.    { LNG_MSGFLAG_KS, "MessageFlagKS" },
  182.    { LNG_MSGFLAG_LOC, "MessageFlagLoc" },
  183.    { LNG_MSGFLAG_HLD, "MessageFlagHld" },
  184.    { LNG_MSGFLAG_ATT, "MessageFlagAtt" },
  185.    { LNG_MSGFLAG_FRQ, "MessageFlagFrq" },
  186.    { LNG_MSGFLAG_TRS, "MessageFlagTrs" },
  187.    { LNG_ENDOFMESSAGES, "EndOfMessages" },
  188.    { LNG_READMENU, "ReadMenu" },
  189.    { LNG_ENDREADMENU, "EndReadMenu" },
  190.    { LNG_NEXTMESSAGE, "NextMessage" },
  191.    { LNG_EXITREADMESSAGE, "ExitReadMessage" },
  192.    { LNG_REREADMESSAGE, "RereadMessage" },
  193.    { LNG_PREVIOUSMESSAGE, "PreviousMessage" },
  194.    { LNG_REPLYMESSAGE, "ReplyMessage" },
  195.    { LNG_EMAILREPLYMESSAGE, "EMailReplyMessage" },
  196.    { LNG_CONFERENCENOTAVAILABLE, "ConferenceNotAvailable" },
  197.    { LNG_STARTWITHMESSAGE, "StartWithMessage" },
  198.    { LNG_NEWMESSAGES, "NewMessages" },
  199.    { LNG_FORUMNAME, "ForumName" },
  200.    { LNG_FORUMOPERATOR, "ForumOperator" },
  201.    { LNG_FORUMTOPIC, "ForumTopic" },
  202.    { LNG_FILENOTFOUNDINAREA, "FileNotFoundInArea" },
  203.    { LNG_FILEDESCRIPTION, "FileDescription" },
  204.    { LNG_FILEDOWNLOADNAME, "FileDownloadName" },
  205.    { LNG_DOWNLOADFILENAME, "DownloadFileName" },
  206.    { LNG_NOFILEHERE, "NoFileHere" },
  207.    { LNG_DISPLAYWHICHFILE, "DisplayWhichFile" },
  208.    { 0, NULL }
  209. };
  210.  
  211. TLanguage::TLanguage (void)
  212. {
  213.    Default ();
  214. }
  215.  
  216. TLanguage::~TLanguage (void)
  217. {
  218.    if (TextMemory != NULL)
  219.       free (TextMemory);
  220. }
  221.  
  222. USHORT TLanguage::CheckKeyword (PSZ pszKey)
  223. {
  224.    USHORT RetVal = 0, i = 0;
  225.  
  226.    while (Keywords[i].Text != NULL && RetVal == 0) {
  227.       if (!stricmp (Keywords[i].Text, pszKey))
  228.          RetVal = Keywords[i].Id;
  229.       i++;
  230.    }
  231.  
  232.    return (RetVal);
  233. }
  234.  
  235. PSZ TLanguage::CopyString (USHORT Key, PSZ Arg, PSZ Text)
  236. {
  237.    USHORT DoCopy = FALSE;
  238.    UCHAR c, c1;
  239.  
  240.    switch (Key) {
  241.       case LNG_LANGUAGE_NAME:
  242.          strcpy (Comment, Arg);
  243.          break;
  244.       case LNG_MENUPATH:
  245.          strcpy (MenuPath, Arg);
  246.          break;
  247.       case LNG_MENUNAME:
  248.          strcpy (MenuName, Arg);
  249.          break;
  250.       case LNG_TEXTFILES:
  251.          strcpy (TextFiles, Arg);
  252.          break;
  253.       case LNG_YESKEY:
  254.          Yes = *Arg;
  255.          break;
  256.       case LNG_NOKEY:
  257.          No = *Arg;
  258.          break;
  259.       case LNG_HELPKEY:
  260.          Help = *Arg;
  261.          break;
  262.       case LNG_MALEKEY:
  263.          Male = *Arg;
  264.          break;
  265.       case LNG_FEMALEKEY:
  266.          Female = *Arg;
  267.          break;
  268.       case LNG_JANUARY:
  269.       case LNG_FEBRUARY:
  270.       case LNG_MARCH:
  271.       case LNG_APRIL:
  272.       case LNG_MAY:
  273.       case LNG_JUNI:
  274.       case LNG_JULY:
  275.       case LNG_AUGUST:
  276.       case LNG_SEPTEMBER:
  277.       case LNG_OCTOBER:
  278.       case LNG_NOVEMBER:
  279.       case LNG_DECEMBER:
  280.          Months[Key - LNG_JANUARY] = Text;
  281.          DoCopy = TRUE;
  282.          break;
  283.       default:
  284.          Pointer[Key] = Text;
  285.          DoCopy = TRUE;
  286.          break;
  287.    }
  288.  
  289.    if (DoCopy == TRUE) {
  290.       while (*Arg != '\0') {
  291.          if (*Arg == '\\' && *(Arg + 1) == 'x') {
  292.             Arg += 2;
  293.             if (*Arg != '\0' && *(Arg + 1) != '\0') {
  294.                if ((c = (UCHAR)(toupper (*Arg) - '0')) > 9)
  295.                   c -= 7;
  296.                c <<= 4;
  297.                if ((c1 = (UCHAR)(toupper (*(Arg + 1)) - '0')) > 9)
  298.                   c1 -= 7;
  299.                c |= c1;
  300.                *Text++ = (CHAR)c;
  301.                Arg += 2;
  302.             }
  303.           }
  304.          else if (*Arg == '\\') {
  305.             Arg++;
  306.             if (*Arg == 'a')
  307.                *Text++ = '\a';
  308.             else if (*Arg == 'n')
  309.                *Text++ = '\n';
  310.             else if (*Arg == 'r')
  311.                *Text++ = '\r';
  312.             else if (*Arg == 't')
  313.                *Text++ = '\t';
  314.             else if (isdigit (*Arg)) {
  315.                if (*(Arg + 1) != '\0' && *(Arg + 2) != '\0') {
  316.                   c = (UCHAR)((*Arg - '0') * 64);
  317.                   c += (UCHAR)((*(Arg + 1) - '0') * 8);
  318.                   c += (UCHAR)(*(Arg + 2) - '0');
  319.                   *Text++ = (CHAR)c;
  320.                   Arg += 2;
  321.                }
  322.             }
  323.             Arg++;
  324.          }
  325.          else
  326.             *Text++ = *Arg++;
  327.       }
  328.       *Text++ = *Arg++;
  329.    }
  330.  
  331.    return (Text);
  332. }
  333.  
  334. VOID TLanguage::Default (VOID)
  335. {
  336.    TextMemory = NULL;
  337.  
  338.    strcpy (File, "default.lng");
  339.    strcpy (Comment, "Default");
  340.    TextFiles[0] = MenuName[0] = '\0';
  341.    MenuPath[0] = '\0';
  342.  
  343.    Pointer[LNG_YES] = "YES";
  344.    Pointer[LNG_NO] = "NO ";
  345.    Pointer[LNG_NONE] = "None";
  346.  
  347.    Yes = 'Y';
  348.    No = 'N';
  349.    Help = '?';
  350.    Male = 'M';
  351.    Female = 'F';
  352.  
  353.    Months[0] = "January";
  354.    Months[1] = "February";
  355.    Months[2] = "March";
  356.    Months[3] = "April";
  357.    Months[4] = "May";
  358.    Months[5] = "Juni";
  359.    Months[6] = "July";
  360.    Months[7] = "August";
  361.    Months[8] = "September";
  362.    Months[9] = "October";
  363.    Months[10] = "November";
  364.    Months[11] = "December";
  365.  
  366.    Pointer[LNG_MOREQUESTION] = "\026\001\017More [Y,n,=]? \026\001\007";
  367.    Pointer[LNG_DELETEMOREQUESTION] = "\r                \r";
  368.    Pointer[LNG_NONSTOP] = "=";
  369.    Pointer[LNG_QUIT] = "N";
  370.    Pointer[LNG_CONTINUE] = "Y";
  371.  
  372.    Pointer[LNG_PRESSENTER] = "\026\001\017Press [Enter] to continue: ";
  373.  
  374.    Pointer[LNG_DEFYESNO] = " [Y,n]? \x16\x01\x1E";
  375.    Pointer[LNG_YESDEFNO] = " [y,N]? \x16\x01\x1E";
  376.    Pointer[LNG_DEFYESNOHELP] = " [Y,n,?=help]? \x16\x01\x1E";
  377.    Pointer[LNG_YESDEFNOHELP] = " [y,N,?=help]? \x16\x01\x1E";
  378.  
  379. #if !defined(__BORLANDC__)
  380.    // Login
  381.    Pointer[LNG_ENTERNAME] = "\n\026\001\012Please enter your full name: \026\001\x1E";
  382.    Pointer[LNG_USERFROMCITY] = "\n\x16\x01\x0E%s from %s";
  383.    Pointer[LNG_ENTERPASSWORD] = "\n\026\001\012Password: \026\001\x1E";
  384.    Pointer[LNG_INVALIDPASSWORD] = "\n\026\001\014Invalid name or password!\a\n";
  385.    Pointer[LNG_NAMENOTFOUND] = "\n\026\001\017Your name was not found in the system user file.\n\n\026\001\016Name entered: %s\n";
  386.    Pointer[LNG_CONTINUEASNEW] = "\n\026\001\017Do you want to continue as a new user";
  387.    Pointer[LNG_ASKCITY] = "\n\026\001\012Please enter your location: \026\001\x1E";
  388.    Pointer[LNG_ASKDAYPHONE] = "\n\026\001\012Write your home/voice number: \026\001\x1E";
  389.    Pointer[LNG_ASKPASSWORD] = "\n\x16\x01\012Select your password to use [minimum 4 chars]: \026\001\x1E";
  390.    Pointer[LNG_REENTERPASSWORD] = "\026\001\012Reenter your password for verify: \026\001\x1E";
  391.    Pointer[LNG_PASSWORDNOMATCH] = "\026\001\015\nPasswords do not match. Try again.\n\006\007";
  392.    Pointer[LNG_ASKANSI] = "\n\026\001\017Would you like ANSI graphics";
  393.    Pointer[LNG_ASKAVATAR] = "\n\026\001\017Would you like AVATAR graphics";
  394.    Pointer[LNG_ASKCOLOR] = "\n\026\001\012Do you want color codes to be sent";
  395.    Pointer[LNG_ASKFULLSCREEN] = "\n\026\001\012Do you want to use the full-screen enhancements";
  396.    Pointer[LNG_ASKALIAS] = "\n\026\001\012Choose your alias to use: \026\001\x1E";
  397.    Pointer[LNG_ASKHOTKEY] = "\n\026\001\013Would you like to use hotkeys";
  398.    Pointer[LNG_ASKIBMCHARS] = "\n\026\001\017Use IBM-PC characters";
  399.    Pointer[LNG_ASKLINES] = "\n\026\001\016How many lines does your display have (10-66, 24 recommended)? \026\001\x1E";
  400.    Pointer[LNG_ASKPAUSE] = "\n\026\001\016Do you want to pause after each screen page";
  401.    Pointer[LNG_ASKSCREENCLEAR] = "\n\026\001\015Do you want screen clearing codes to be sent";
  402.    Pointer[LNG_ASKBIRTHDATE] = "\n\026\001\014Write your date of birth (mm-dd-yyyy): \026\001\x1E";
  403.    Pointer[LNG_ASKMAILCHECK] = "\n\026\001\013Would you like to check for mail at every logon";
  404.    Pointer[LNG_ASKFILECHECK] = "\n\026\001\016Would you like to check for new files at every logon";
  405.  
  406.    // Logout
  407.    Pointer[LNG_DISCONNECT] = "\n\026\001\017Disconnect";
  408.  
  409.    // Message areas
  410.    Pointer[LNG_MESSAGEAREAREQUEST] = "\n\026\001\017Message area [Area, \"[\"=Prior, \"]\"=Next, \"?\"=List]: \026\001\x1E";
  411.    Pointer[LNG_MESSAGEAREAHEADER] = "\n\026\001\017Area             Msgs   Description\n\031─\017  \031─\005  \031─\067\n";
  412.    Pointer[LNG_MESSAGEAREASEPARATOR] = "\026\001\017\031─\017  \031─\005  \031─\067\n";
  413.    Pointer[LNG_MESSAGEAREADESCRIPTION1] = "\026\001\016Use your arrow keys or CTRL-X / CTRL-E to hilight an area, RETURN selects it.\n";
  414.    Pointer[LNG_MESSAGEAREADESCRIPTION2] = "\026\001\016Hit CTRL-V for next page, CTRL-Y for previous page, or X to exit.";
  415.    Pointer[LNG_MESSAGEAREACURSOR] = "\x16\x01\x70%-15.15s\x16\x01\x07";
  416.    Pointer[LNG_MESSAGEAREAKEY] = "\026\001\015%-15.15s\x16\x01\x07";
  417.    Pointer[LNG_MESSAGEAREALIST] = "\026\001\015%-15.15s  \026\001\002%5ld  \026\001\003%.55s\n";
  418.  
  419.    // Message reader
  420.    Pointer[LNG_READERFROM] = "\026\001\003From:    \026\001\016%-36.36s \026\001\017%-.33s\n";
  421.    Pointer[LNG_READERTO] = "\026\001\003To:      \026\001\016%-36.36s \026\001\012Msg #%lu, %-.23s\n";
  422.    Pointer[LNG_READERFILE] = "\026\001\003File(s): \026\001\016%-.70s\n";
  423.    Pointer[LNG_READERSUBJECT] = "\026\001\003Subject: \026\001\016%-.70s\n\n";
  424.    Pointer[LNG_MESSAGEDATE] = "%D %C %Z %H:%M";
  425.    Pointer[LNG_MESSAGEISREPLY] = "\n\026\001\017*** This is a reply to #%lu.\n";
  426.    Pointer[LNG_MESSAGESEEALSO] = "\n\026\001\017*** See also #%lu.\n";
  427.    Pointer[LNG_MESSAGEISBOTH] = "\n\026\001\017*** This is a reply to #%lu.  *** See also #%lu.\n";
  428.    Pointer[LNG_MESSAGETEXT] = "\026\001\003%s\n";
  429.    Pointer[LNG_MESSAGEQUOTE] = "\026\001\017%s\n";
  430.    Pointer[LNG_MESSAGEKLUDGE] = "\026\001\003%s\n";
  431.    Pointer[LNG_MESSAGEORIGIN] = "\026\001\002%s\n";
  432.  
  433.    // Fullscreen message reader
  434.    Pointer[LNG_MESSAGEHDR] = "\x0C\x16\x01\x13─ \x16\x01\x1E%s \x16\x01\x13\031─%c";
  435.    Pointer[LNG_MESSAGENUMBER] = "%lu of %lu";
  436.    Pointer[LNG_MESSAGENUMBER1] = "%lu of %lu -%lu";
  437.    Pointer[LNG_MESSAGENUMBER2] = "%lu of %lu +%lu";
  438.    Pointer[LNG_MESSAGENUMBER3] = "%lu of %lu -%lu +%lu";
  439.    Pointer[LNG_MESSAGEFLAGS] = "\x16\x01\x1F   Msg#: \x16\x01\x1C%-35.35s \x16\x01\x1F%-.35s\x16\x07\n";
  440.    Pointer[LNG_MESSAGEFROM] = "\x16\x01\x1F   From: \x16\x01\x1E%-35.35s \x16\x01\x1F%-16.16s \x16\x01\x1F%-18.18s";
  441.    Pointer[LNG_MESSAGETO] = "\x16\x01\x1F     To: \x16\x01\x1E%-35.35s \x16\x01\x1F%-16.16s \x16\x01\x1F%-18.18s";
  442.    Pointer[LNG_MESSAGESUBJECT] = "\x16\x01\x1FSubject: \x16\x01\x1E%s\x16\007\n";
  443.    Pointer[LNG_MESSAGEFILE] = "\x16\x01\037File(s): \x16\x01\x1E%s\x16\007\n";
  444.  
  445.    // File areas
  446.    Pointer[LNG_FILEAREAREQUEST] = "\n\026\001\017File area [Area, \"[\"=Prior, \"]\"=Next, \"?\"=List]: \026\001\x1E";
  447.    Pointer[LNG_FILEAREAHEADER] = "\n\026\001\017Area             Files  Description\n\026\001\017\031─\017  \031─\005  \031─\067\n";
  448.    Pointer[LNG_FILEAREASEPARATOR] = "\026\001\017\031─\017  \031─\005  \031─\067\n";
  449.    Pointer[LNG_FILEAREADESCRIPTION1] = "\026\001\016Use your arrow keys or CTRL-X / CTRL-E to hilight an area, RETURN selects it.\n";
  450.    Pointer[LNG_FILEAREADESCRIPTION2] = "\026\001\016Hit CTRL-V for next page, CTRL-Y for previous page, or X to exit.";
  451.    Pointer[LNG_FILEAREACURSOR] = "\x16\x01\x70%-15.15s\x16\x01\x07";
  452.    Pointer[LNG_FILEAREAKEY] = "\026\001\015%-15.15s\x16\x01\x07";
  453.    Pointer[LNG_FILEAREALIST] = "\026\001\015%-15.15s  \026\001\002%5ld  \026\001\003%.55s\n";
  454.    Pointer[LNG_FILEAREANOTAVAILABLE] = "\n\026\001\017That area doesn't exist\n";
  455.    Pointer[LNG_FILEPROTOCOLLIST] = "  \x16\x01\013%s ... \x16\x01\016%s\n";
  456.    Pointer[LNG_FILETAGGEDWARNING] = "\n\026\001\015You have %u files tagged for later download.\nDo you want to download these files now";
  457.    Pointer[LNG_FILENOBYTESWARNING] = "\n\026\001\015You don't have enough bytes to download these files.\n\006\007\006\007";
  458.    Pointer[LNG_FILENOTIMEWARNING] = "\n\026\001\015You don't have enough time to download these files.\n\006\007\006\007";
  459.    Pointer[LNG_FILEBEGINDOWNLOAD] = "\x16\x01\012Beginning %s download of the file %s\n\n\x16\x01\012(Hit \x16\x01\013CTRL-X \x16\x01\012a few times to abort)\n";
  460.    Pointer[LNG_FILEBEGINDOWNLOAD2] = "\x16\x01\012Beginning %s download of the file(s)\n\n\x16\x01\012(Hit \x16\x01\013CTRL-X \x16\x01\012a few times to abort)\n";
  461.    Pointer[LNG_FILETAGGEDHEADER] = "\n\x16\x01\x0FYou have tagged the following files:\n\n";
  462.    Pointer[LNG_FILETAGGEDLIST] = "\026\001\016(%d) \026\001\015%-12.12s \026\001\016in area \026\001\015%s \026\001\012(%02lu:%02lu, %lu bytes)\n";
  463.    Pointer[LNG_FILETAGGEDTOTAL] = "\n\026\001\016Total: \026\001\012%lu bytes \026\001\016(%lu:%02lu)\n";
  464.    Pointer[LNG_FILENOTAGGED] = "\n\026\001\014No files are tagged.\n";
  465.    Pointer[LNG_FILEDOWNLOADERROR] = "\006\007\n\n\x16\x01\015*** ERROR DOWNLOADING FILES ***\n\006\007\006\007";
  466.    Pointer[LNG_FILEDOWNLOADCOMPLETE] = "\006\007\n\n\x16\x01\016*** DOWNLOAD COMPLETE ***\n\006\007\006\007";
  467.    Pointer[LNG_FILEBUILDLIST] = "\n\x16\x01\017Building the list of files. Please wait... ";
  468.  
  469.    Pointer[LNG_FILETAGLISTED] = "\r\026\007\x16\x01\017Filename(s) to tag (#%d): ";
  470.    Pointer[LNG_FILELISTTAGCONFIRM] = "\r026\007\026\001\016(%d) \026\001\015%-12.12s \026\001\012(%02lu:%02lu, %lu bytes)  ";
  471.    Pointer[LNG_FILELISTNOTFOUND] = "\r\026\007\026\001\014I see no \"%s\" here.  ";
  472.    Pointer[LNG_FILELISTHEADER] = "\026\001\017 File Name    Size  Date     Description\n \031─\014 \031─\005 \031─\010 \031─\062\n";
  473.    Pointer[LNG_FILELISTSEPARATOR] = " \031─\014 \031─\005 \031─\010 \031─\062\n";
  474.    Pointer[LNG_FILELISTDESCRIPTION1] = "\026\001\016Use your arrow keys or CTRL-X / CTRL-E to hilight a file, RETURN view details.\n";
  475.    Pointer[LNG_FILELISTDESCRIPTION2] = "\026\001\016Hit CTRL-V for next page, CTRL-Y for previous page, or X to exit.";
  476.    Pointer[LNG_FILELISTTAGGED] = "\026\001\016*%-12.12s*\026\001\015%4ldK \026\001\002%2d/%02d/%02d \026\001\003%.50s\n";
  477.    Pointer[LNG_FILELISTNORMAL] = "\026\001\016 %-12.12s \026\001\015%4ldK \026\001\002%2d/%02d/%02d \026\001\003%.50s\n";
  478.    Pointer[LNG_FILELISTMOREQUESTION] = "\026\001\017More [Y,n,t,=]? \026\001\007";
  479.    Pointer[LNG_FILELISTDELETEMOREQUESTION] = "\r                  \r";
  480.    Pointer[LNG_FILELISTTAGKEY] = "T";
  481.    Pointer[LNG_FILELISTNOFILESFOUND] = "\n\x16\x01\015Sorry, no files are found to match your search/list parameters.\n\006\007\006\007";
  482.    Pointer[LNG_FILELISTCOMMENT] = "                             \026\001\003%.50s\n";
  483.    Pointer[LNG_FILENAMETODELETE] = "\n\x16\x01\013Enter file name to delete, or RETURN to exit: ";
  484.    Pointer[LNG_FILEDELETED] = "\n\x16\x01\x0D%s deleted from Library records...\n\006\007\006\007";
  485.    Pointer[LNG_FILETODETAG] = "\n\026\001\017File number to detag [1-%d, or A)ll]: ";
  486.    Pointer[LNG_FILEDETAGGED] = "\n\026\001\016File \026\001\015%s \026\001\016detagged.";
  487.    Pointer[LNG_FILETAGEMPTY] = "\n\026\001\016File queue is now empty.\n";
  488.    Pointer[LNG_FILETOTAG] = "\n\x16\x01\017Filename(s) to tag (#%d): ";
  489.    Pointer[LNG_FILETAGCONFIRM] = "\026\001\016(%d) \026\001\015%-12.12s \026\001\012(%02lu:%02lu, %lu bytes)";
  490.    Pointer[LNG_FILENOTFOUND] = "\n\026\007\026\001\014I see no \"%s\" here.\n";
  491.  
  492.    // Change options
  493.    Pointer[LNG_CURRENTPASSWORD] = "\n\026\001\017Current password: ";
  494.    Pointer[LNG_WHYPASSWORD] = "\nA password is a single word (no spaces).\nIt must be 4 to %d letters (or numbers) long.\n\n";
  495.    Pointer[LNG_WRONGPASSWORD] = "\n\026\001\014Wrong password!\n";
  496.  
  497.    // Multiline
  498.    Pointer[LNG_ONLINETITLE] = "\x0C\n\026\001\017\031 \x14OnLine Users at %s\n\026\001\014\031 \x14\031─\x28\n\n";
  499.    Pointer[LNG_ONLINEHEADER] = "\x16\x01\012Name                       Line  Speed  Status               Location\n\026\001\002\031─\x19  \031─\x04 \031─\x06  \031─\x13  \031─\x12\n";
  500.    Pointer[LNG_ONLINEENTRY] = "\026\001\013%-25.25s   \026\001\017%2u   %-5lu  \026\001\016%-19.19s  %-.18s\n";
  501.  
  502.    // Miscellaneous
  503.    Pointer[LNG_MENUERROR] = "\n\x16\x01\x0DPlease select one of the choices presented.\n\006\007\006\007";
  504.  
  505.  
  506.  
  507.  
  508.  
  509.    Pointer[LNG_ASKADDRESS] = "\n\x16\x01\013Enter your street address or P.O. Box:\n\x16\x01\x1E";
  510.    Pointer[LNG_ASKCOMPANYNAME] = "\n\x16\x01\013Now enter your company name, or just RETURN if none:\n\x16\x01\x1E";
  511.    Pointer[LNG_ASKSEX] = "\n\x16\x01\013What is your sex? (M)ale or (F)emale? \x16\x01\x1E";
  512.    Pointer[LNG_ENTERNAMEORNEW] = "\nèPlease enter your full name (or \"New\"): ";
  513.  
  514.    Pointer[LNG_MSGFLAG_RCV] = "Rcv ";
  515.    Pointer[LNG_MSGFLAG_SNT] = "Snt ";
  516.    Pointer[LNG_MSGFLAG_PVT] = "Pvt ";
  517.    Pointer[LNG_MSGFLAG_CRA] = "Cra ";
  518.    Pointer[LNG_MSGFLAG_KS] = "K/s ";
  519.    Pointer[LNG_MSGFLAG_LOC] = "Loc ";
  520.    Pointer[LNG_MSGFLAG_HLD] = "Hld ";
  521.    Pointer[LNG_MSGFLAG_ATT] = "Att ";
  522.    Pointer[LNG_MSGFLAG_FRQ] = "Frq ";
  523.    Pointer[LNG_MSGFLAG_TRS] = "Trs ";
  524.  
  525.    Pointer[LNG_ENDOFMESSAGES] = "\n\x16\x01\x0DYou have reached the end of these messages.\n\006\007\006\007";
  526.    Pointer[LNG_READMENU] = "\n\x16\x01\013(R)eply, (E)mail reply, (P)revious, (N)ext or e(X)it: ";
  527.    Pointer[LNG_ENDREADMENU] = "\n\x16\x01\013(P)revious message, (R)e-Read last message or e(X)it: ";
  528.    Pointer[LNG_NEXTMESSAGE] = "N";
  529.    Pointer[LNG_EXITREADMESSAGE] = "X";
  530.    Pointer[LNG_PREVIOUSMESSAGE] = "P";
  531.    Pointer[LNG_REREADMESSAGE] = "R";
  532.    Pointer[LNG_REPLYMESSAGE] = "R";
  533.    Pointer[LNG_EMAILREPLYMESSAGE] = "R";
  534.    Pointer[LNG_CONFERENCENOTAVAILABLE] = "\n\026\001\014This Conference isn't available to you.\n";
  535.    Pointer[LNG_STARTWITHMESSAGE] = "\n\x16\x01\013Enter message number to start with, F for the\nfirst message, L for the last, or ? for help";
  536.    Pointer[LNG_NEWMESSAGES] = ".\n(Just hit RETURN to start with new messages)";
  537.  
  538.    Pointer[LNG_FORUMNAME] = "\014\026\001\012FORUM: %s\n";
  539.    Pointer[LNG_FORUMOPERATOR] = "\026\001\012Forum-Op: %s\n";
  540.    Pointer[LNG_FORUMTOPIC] = "\026\001\012Forum Topic: %s\n\n";
  541.  
  542.  
  543.    Pointer[LNG_FILENOTFOUNDINAREA] = "\n\026\001\015File not found in this library\n\006\007\006\007";
  544.    Pointer[LNG_FILEDESCRIPTION] = "\x16\x01\x0E %-12.12s %4ldK \x16\x01\x0A%2d/%02d/%02d %.50s\n";
  545.    Pointer[LNG_FILEDOWNLOADNAME] = "\n\x16\x01\017File(s) to download (#%d): ";
  546.    Pointer[LNG_DOWNLOADFILENAME] = "\026\001\016(%d) \026\001\015%-12.12s \026\001\012(%02lu:%02lu, %lu bytes)";
  547.    Pointer[LNG_NOFILEHERE] = "\n\026\001\014I see no \"%s\" here.\n";
  548.    Pointer[LNG_DISPLAYWHICHFILE] = "\n\x16\x01\017Display which file? ";
  549.  
  550.  
  551.    Pointer[LNG_HAVETAGGED] = "\n\026\001\015You have %u tagged files.\n";
  552.    Pointer[LNG_YOUSURE] = "\n\x16\x01\013Are you sure (Y/N)? ";
  553. #endif
  554. }
  555.  
  556. USHORT TLanguage::Load (PSZ pszFile)
  557. {
  558.    FILE *fp;
  559.    USHORT RetVal = FALSE;
  560.    CHAR *Temp, *Key, *Arg, *p, *Pointer;
  561.    ULONG Size = 0L;
  562.  
  563.    if ((fp = _fsopen (pszFile, "rt", SH_DENYNO)) != NULL) {
  564.       RetVal = TRUE;
  565.       strcpy (File, pszFile);
  566.  
  567.       if (TextMemory != NULL) {
  568.          free (TextMemory);
  569.          TextMemory = NULL;
  570.       }
  571.       Default ();
  572.  
  573.       if ((Temp = (CHAR *)malloc (MAX_LINE)) != NULL) {
  574.          while (fgets (Temp, MAX_LINE - 1, fp) != NULL) {
  575.             if ((Key = strtok (Temp, " =")) != NULL) {
  576.                if ((p = strtok (NULL, "")) != NULL) {
  577.                   while (*p != '\0' && *p != '\"')
  578.                      p++;
  579.                   if (*p == '\"') {
  580.                      Arg = p + 1;
  581.                      if ((p = strchr (p, '\0')) != NULL) {
  582.                         while (*p != '\"' && p > Arg)
  583.                            *p-- = '\0';
  584.                         *p-- = '\0';
  585.                      }
  586.                      if (CheckKeyword (Key) != 0)
  587.                         Size += strlen (Arg) + 1;
  588.                   }
  589.                }
  590.             }
  591.          }
  592.  
  593. #if defined(__DOS__) && defined(__BORLANDC__)
  594.          if ((TextMemory = (PSZ)farmalloc (Size)) != NULL) {
  595. #else
  596.          if ((TextMemory = (PSZ)malloc (Size)) != NULL) {
  597. #endif
  598.             rewind (fp);
  599.             Pointer = TextMemory;
  600.  
  601.             while (fgets (Temp, MAX_LINE - 1, fp) != NULL) {
  602.                if ((Key = strtok (Temp, " =")) != NULL) {
  603.                   if ((p = strtok (NULL, "")) != NULL) {
  604.                      while (*p != '\0' && *p != '\"')
  605.                         p++;
  606.                      if (*p == '\"') {
  607.                         Arg = p + 1;
  608.                         if ((p = strchr (p, '\0')) != NULL) {
  609.                            while (*p != '\"' && p > Arg)
  610.                               *p-- = '\0';
  611.                            *p-- = '\0';
  612.                         }
  613.                         Pointer = CopyString (CheckKeyword (Key), Arg, Pointer);
  614.                      }
  615.                   }
  616.                }
  617.             }
  618.          }
  619.  
  620.          free (Temp);
  621.       }
  622.  
  623.       fclose (fp);
  624.    }
  625.  
  626.    return (RetVal);
  627. }
  628.  
  629. PSZ TLanguage::Text (USHORT Id)
  630. {
  631.    PSZ RetVal = "";
  632.  
  633.    if (Id >= 1 && Id < LNG_MAX_ENTRIES)
  634.       RetVal = Pointer[Id];
  635.  
  636.    return (RetVal);
  637. }
  638.  
  639.  
  640.