#include "bbs.h"

char *msg(const char *upname, const int nr, const int lang)
{
int k;
static char noerrormsg[100];
static char *bbs[] = {
  "Abbruch wegen Signals",
  "Terminated by signal",
  "Abbruch wegen SigTerm",
  "Terminated by SigTerm",
  "Abbruch wegen SigHup",
  "Terminated by SigHup",
  "Abbruch wegen unbekannten Signals",
  "Terminated by unknown signal",
  "Komandozeile zu lang",
  "command line too long",
  "interner Fehler beim Komandozeileneinlesen",
  "internal error at reading command line",
  "Autologout wegen Timeout (Kommandoeigabe)",
  "autologout by waiting for command",
  "%s %s: unbekannter Befehl",
  "%s %s: unknown command"
};
static char *bbsinit[] = {
  "Login erfolglos",
  "Login failed"
};
static char *windowtext[] = {
  "Druecke eine Taste",
  "Press a key to continue"
};
static char *tlpager[] = {
  "Pager (Ende): [Backspace,Q]>",
  "Pager (end): [Backspace,Q]>",
  "Pager (Anfang): [Space,Q]>",
  "Pager (top): [Space,Q]>",
  "Pager (Zeile %d): [Space,Backspace,Q]>",
  "Pager (line %d): [Space,Backspace,Q]>",
  "Pager (Alles): [Q]>",
  "Pager (all): [Q]>",
  "Pager (leer): [Q]>",
  "Pager (empty): [Q]>"
};
static char *usergreeting[] = {
  "\n\nTerminaltyp ist %s (druecke [Return] wenn ok, sonst gebe anderen an): ",
  "\n\nTerminaltyp is %s (press [Return] if ok, else enter another): ",
  "\n Terminaltyp %s ist nicht verfuegbar, versuche einen anderen: ",
  "\n Terminaltyp %s is not available, try another one: "
};
static char *do_sprache[] = {
  "Sprache: %s",
  "Language: %s"
};
static char *do_autozmodem[] = {
  "automatische Uploads per Z-Modem: an",
  "automatic Z-Modem-Uploads: on",
  "automatische Uploads per Z-Modem: aus",
  "automatic Z-Modem-uploads: off"
};
static char *do_fullist[] = {
  "Dateien bei Directorywechsel mit auflisten: ja",
  "list files on change directory also: yes",
  "Dateien bei Directorywechsel mit auflisten: nein",
  "list files on change directory also: no",
};
static char *do_get[] = {
  "%s: existiert nicht (nicht uebertragen)",
  "%s: not existent (no transfer)",
  "%s: keine Datei (nicht uebertragen)",
  "%s: not a file (no transfer)",
  "%s: keine Leseberechtigung (nicht uebertragen)" 
  "%s: no reading permittion (no transfer)"
};
static char *do_home[] = {
  "unzulaessiges Homedirectory",
  "wrong home",
  "Sorry: Home kann auf Sicherheitslevel 0 nicht veraendert werden",
  "sorry: you cannot change home at security level 0"
};
static char *do_protokoll[] = {
  "Sorry:\nKermit nicht erlaubt",
  "Sorry:\nKermit not allowed"
};
static char *do_put[] = {
  "keine Schreibberechtigung zum Download in %s, Abbruch",
  "no permittion for downloading in %s, aborted"
};
static char *do_showfile[] = {
  "%s: existiert nicht",
  "%s: not existent",
  "%s: keine Datei",
  "%s: not a file",
  "%s: keine Leseberechtigung",
  "%s: no reading permittion",
  "Pager (Ende): [Backspace,Q]>",
  "Pager (end): [Backspace,Q]>",
  "Pager (Anfang): [Space,Q]>",
  "Pager (top): [Space,Q]>",
  "Pager (Zeile %d): [Space,Backspace,Q]>",
  "Pager (line %d): [Space,Backspace,Q]>",
  "Pager (Alles): [Q]>",
  "Pager (all): [Q]>"
};
static char *do_newpasswd[] = {
  "%s: unbekannter Benutzer",
  "%s: unknown user",
  "%s: neues Password durch %s",
  "%s: new password by %s",
  "Password geaendert",
  "password changed",
  "Password nicht geaendert",
  "password not changed"
};
static char *pathnamesexpand[] = {
  "keine Backquotes in Pfadnamen erlaubt",
  "no backquotes allowed",
  "keine Pfeile in Pfadnamen erlaubt",
  "no arrows allowed",
  "keine senkrechten Striche in Pfadnamen erlaubt",
  "no vertical bars allowed",
  "keine &-Zeichen in Pfadnamen erlaubt",
  "no amphersands allowed"
};
static char *expandfilenames[] = {
  "Argumentzeile zu lang",
  "arguments too long",
  "Fehlerhaftes Suchmuster: %s",
  "wrong pattern: %s",
  "Filenamenexpansion ergibt zuviele Files",
  "expanding filenamens: too many names",
  "Argumentzeilenexpansion zu lang",
  "expanding filenames: too long"
};
static char *talkscreen[] = {
  " Druecke Escape zum beenden ",
  " Press Escape to exit talk "
};
static char *iniconnecttouser[] = {
  "Talk beendet",
  "talk finished",
  "Talk von der anderen Seite abgelehnt",
  "talk rejected by remote user",
  "warte auf Antwort (druecke 'Q' zum Abbrechen) [Q]> ",
  "waiting for response (press 'Q' to abort) [Q]> ",
  "Talk abgebrochen",
  "talk aborted",
  "andere Seite ist belegt",
  "other party is busy"
};
static char *remconnecttouser[] = {
  "Talk beendet",
  "talk finished",
  "Talk abgebrochen",
  "talk aborted",
  "User %s wuenscht Talk: 'A' nimmt an, 'Q' lehnt ab [A,Q]> ",
  "User %s wants to talk: A accepts, Q rejects [A,Q]> "
};
static char *getkeyonprompt[] = {
  "Druecke 'Escape' zum Abbrechen",
  "press 'Escape' to abort"
};
static char *getcmdline_c[] = {
  "*** Programm BBS ***",
  "*** Program BBS ***",
  "*** Programm BBS: Systemparameter ***",
  "*** Program BBS: System Configuration ***",
  "*** Programm BBS: BBS-System ***",
  "*** Program BBS: BBS-System ***",
  "Arbeitsdirectory: %s",
  "working directory: %s"
};
static char *selectmenue_c[] = {
  "Druecken Sie eine der in '[]' angegebenen Tasten:",
  "Press a key from '[]':"
};
static char *menueselect_c[] = {
  "Pager (Ende): [Backspace,Return], waehle: [A-",
  "Pager (end): [Backspace,Return], select: [A-",
  "Pager (Anfang): [Space,Return], waehle: [A-",
  "Pager (top): [Space,Return], select: [A-",
  "Pager (Zeile %d): [Space,Backspace,Return], waehle: [A-",
  "Pager (line %d): [Space,Backspace,Return], select: [A-",
  "Pager (Alles): [Return], waehle: [A-",
  "Pager (all): [Return], select: [A-",
  "Pager (leer): [Return], KEINE WAHL>",
  "Pager (empty): [Return], NO SELECT>"
};
static char *put_c[] = {
  "Uploads per Z-Modem werden automatisch erkannt.\nBei Problemen kann im 'Systemparameter'-Menue die Automatik\ndesaktiviert werden",
  "Uploads by Z-Modem will be recognized automatically.\nOn problems, deactivate it (menu 'System Configuration')"
};
static char *sprache_c[] = {
  "waehle Sprache:",
  "select language:",
  "momentane Sprache ist: ",
  "current language is: ",
  "Quit (ohne Aenderung)",
  "Quit (without change)",
  "Druecken Sie eine der in '[]' angegebenen Tasten:",
  "Press a key from '[]':"
};
static char *autozmodem_c[] = {
  "waehle automatische Uploads per Z-Modem:",
  "select automatic Z-Modem-uploads:",
  "Automatik ist an",
  "automatic is on",
  "Automatik ist aus",
  "automatic is off",
  "Aendern",
  "toggle",
  "Quit (ohne Aenderung)",
  "Quit (without change)",
  "Druecken Sie eine der in '[]' angegebenen Tasten:",
  "Press a key from '[]':"
};
static char *fullist_c[] = {
  "Dateien bei Directorywechsel mit anzeigen:",
  "List files on change directory also:",
  "Ja",
  "Yes",
  "Nein",
  "No",
  "Aendern",
  "toggle",
  "Quit (ohne Aenderung)",
  "Quit (without change)",
  "Druecken Sie eine der in '[]' angegebenen Tasten:",
  "Press a key from '[]':"
};
static char *protokoll_c[] = {
  "waehle Uebertragungsprotokoll:",
  "select transfer protocol:",
  "momentanes Protokoll ist: ",
  "current protocol is: ",
  "Quit (ohne Aenderung)",
  "Quit (without change)",
  "Druecken Sie eine der in '[]' angegebenen Tasten:",
  "Press a key from '[]':"
};
static char *talk_c[] = {
  "BELEGT",
  "BUSY",
  "GESCHAEFTIG",
  "WORKING",
  "waehle Gespraechspartner:",
  "select other party:"
};
static char *term_c[] = {
  "Terminaltyp: momentan: %s, neu: ",
  "Term: currently: %s new: ",
  "\nTerminaltyp %s ist unbekannt, neu: ",
  "\nunknown term %s, new: ",
  "\nZeilenanzahl: momentan: %d, neu: ",
  "\nLines: currently: %d, new: ",
  "\nSpaltenanzahl: momentan: %d, neu: ",
  "\nColumns: currently %d, new: ",
  "Terminaltyp einstellen:\n\n",
  "change terminal:\n\n"
};
static char *newpasswd_c[] = {
  "waehle neues Password (maximal %d Zeichen):",
  "select new password (%d chars maximum):",
  "Sie duerfen Ihr Password nicht veraendern",
  "You are not allowed to change password",
  "Name des Benutzers:",
  "Username to change:",
  "neues Password:",
  "new password:",
  "bitte neues Password wiederholen:",
  "please repeat new password:",
  "ungleiche Eingabe, Aktion abgebrochen",
  "different passwords, action terminated"
};
static char *selectdir_c[] = {
  "waehle das neue Directory:",
  "select new directory:",
  "Arbeitsverzeichnis",
  "working directory",
  "Datei",
  "File"
};
static char *selectfiles_c[] = {
  "waehle das File:",
  "select file",
  "markiere das gewuenschte File:",
  "select file",
  "markiere die gewuenschten Files:",
  "select files"
};
static char *wildcardselect_c[] = {
  "Fehlerhaftes Suchmuster: %s",
  "wrong pattern: %s",
  "Gebe regulaeren Ausdruck ein (? fuer Kurzhilfe):",
  "Enter regular expression (? for help):",
  "* steht fuer einen beliebigen Teilstring,\n? fuer ein oder null beliebiges Zeichen,\n[x-y] steht fuer jedes Zeichen im Bereich x-y",
  "* matches an arbitray part,\n? matches one or zero chars,\n[x-y] matches every character in x-y once",
  "* steht fuer einen beliebigen Teilstring",
  "* matches an arbitray part"
};
static char *bbsquit_c[] = {
  "BBS wirklich beenden? [J,N]",
  "really quit BBS? [Y,N]"
};

  k = 2*nr + lang;
  if (strcmp(upname,"bbs")==0) {
    return bbs[k];
  }
  else if (strcmp(upname,"bbsinit")==0) {
    return bbsinit[k];
  }
  else if (strcmp(upname,"windowtext")==0) {
    return windowtext[k];
  }
  else if (strcmp(upname,"tlpager")==0) {
    return tlpager[k];
  }
  else if (strcmp(upname,"usergreeting")==0) {
    return usergreeting[k];
  }
  else if (strcmp(upname,"do_sprache")==0) {
    return do_sprache[k];
  }
  else if (strcmp(upname,"do_autozmodem")==0) {
    return do_autozmodem[k];
  }
  else if (strcmp(upname,"do_fullist")==0) {
    return do_fullist[k];
  }
  else if (strcmp(upname,"do_get")==0) {
    return do_get[k];
  }
  else if (strcmp(upname,"do_home")==0) {
    return do_home[k];
  }
  else if (strcmp(upname,"do_protokoll")==0) {
    return do_protokoll[k];
  }
  else if (strcmp(upname,"do_put")==0) {
    return do_put[k];
  }
  else if (strcmp(upname,"do_showfile")==0) {
    return do_showfile[k];
  }
  else if (strcmp(upname,"do_newpasswd")==0) {
    return do_newpasswd[k];
  }
  else if (strcmp(upname,"pathnamesexpand")==0) {
    return pathnamesexpand[k];
  }
  else if (strcmp(upname,"expandfilenames")==0) {
    return expandfilenames[k];
  }
  else if (strcmp(upname,"iniconnecttouser")==0) {
    return iniconnecttouser[k];
  }
  else if (strcmp(upname,"talkscreen")==0) {
    return talkscreen[k];
  }
  else if (strcmp(upname,"remconnecttouser")==0) {
    return remconnecttouser[k];
  }
  else if (strcmp(upname,"getkeyonprompt")==0) {
    return getkeyonprompt[k];
  }
  else if (strcmp(upname,"getcmdline_c")==0) {
    return getcmdline_c[k];
  }
  else if (strcmp(upname,"selectmenue_c")==0) {
    return selectmenue_c[k];
  }
  else if (strcmp(upname,"menueselect_c")==0) {
    return menueselect_c[k];
  }
  else if (strcmp(upname,"put_c")==0) {
    return put_c[k];
  }
  else if (strcmp(upname,"sprache_c")==0) {
    return sprache_c[k];
  }
  else if (strcmp(upname,"autozmodem_c")==0) {
    return autozmodem_c[k];
  }
  else if (strcmp(upname,"fullist_c")==0) {
    return fullist_c[k];
  }
  else if (strcmp(upname,"talk_c")==0) {
    return talk_c[k];
  }
  else if (strcmp(upname,"protokoll_c")==0) {
    return protokoll_c[k];
  }
  else if (strcmp(upname,"term_c")==0) {
    return term_c[k];
  }
  else if (strcmp(upname,"newpasswd_c")==0) {
    return newpasswd_c[k];
  }
  else if (strcmp(upname,"selectdir_c")==0) {
    return selectdir_c[k];
  }
  else if (strcmp(upname,"selectfiles_c")==0) {
    return selectfiles_c[k];
  }
  else if (strcmp(upname,"wildcardselect_c")==0) {
    return wildcardselect_c[k];
  }
  else if (strcmp(upname,"bbsquit_c")==0) {
    return bbsquit_c[k];
  }

  sprintf(noerrormsg,"msg: no string found for %s, %i",upname,nr);
  return  noerrormsg;
}
