diff --git a/ChangeLog b/ChangeLog index 9ad6142b..6dd5496a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,27 @@ $Id$ -v0.91.3 11-Feb-2007 +v0.91.4 17-Feb-2007 + + upgrade: + Start mbsetup, enter global setup, save and exit mbsetup. + + mbselib: + Moved default language paths into ~/share/int + + mbsebbs: + Moved default language paths into ~/share/int + + mbsetup: + Moved default language paths into ~/share/int + + mbtask: + Moved default language paths into ~/share/int + + lang: + Renamed language files and changed installation paths. + + +v0.91.3 11-Feb-2007 - 17-Feb-2007 mbselib: Added coding and decoding to strings that are processed by the diff --git a/Makefile b/Makefile index 7f9cb5fc..4d0c6d64 100644 --- a/Makefile +++ b/Makefile @@ -56,46 +56,14 @@ install: @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/log @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/tmp @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/home - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/chinese - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/chinese/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/chinese/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/chinese/macro - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/dutch - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/dutch/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/dutch/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/dutch/macro - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/english - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/english/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/english/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/english/macro @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0755 ${PREFIX}/share @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0755 ${PREFIX}/share/doc @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0755 ${PREFIX}/share/doc/html @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0755 ${PREFIX}/share/doc/tags @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/de - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/en - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/es - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/fr - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/gl - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/it - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/nl - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/spanish - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/spanish/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/spanish/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/spanish/macro - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/galego - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/galego/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/galego/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/galego/macro - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/german - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/german/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/german/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/german/macro - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/french - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/french/txtfiles - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/french/menus - @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/french/macro + @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/menus + @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/macro + @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/int/txtfiles @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0775 ${PREFIX}/ftp @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0775 ${PREFIX}/ftp/pub @${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0775 ${PREFIX}/ftp/pub/local @@ -146,6 +114,12 @@ install: echo; echo "If there is nothing important in ${PREFIX}/doc" ; \ echo "you may remove that obsolete directory." ; \ fi + @for d in de en es fr gl it nl; do \ + if [ -d ${PREFIX}/share/int/$$d ] ; then \ + rmdir ${PREFIX}/share/int/$$d ; \ + echo "Removed directory ${PREFIX}/share/int/$$d" ; \ + fi ; \ + done @rm -rf ${PREFIX}/sema @rm -rf ${PREFIX}/tmp/arc diff --git a/Makefile.global.in b/Makefile.global.in index 6b6ca2cd..7d8f3eca 100644 --- a/Makefile.global.in +++ b/Makefile.global.in @@ -14,6 +14,7 @@ BINDIR = @prefix@/bin ETCDIR = @prefix@/etc DOCDIR = @prefix@/doc VARDIR = @prefix@/var +INTDIR = @prefix@/share/int OWNER = @OWNER@ GROUP = @GROUP@ ROWNER = @ROWNER@ diff --git a/TODO b/TODO index 4823379e..8702b5f0 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ $Id$ - MBSE BBS V0.91.3 TODO list. + MBSE BBS V0.91.4 TODO list. --------------------------- These are a list of things that must be implemented one way or diff --git a/configure b/configure index 74b37c80..8533405b 100755 --- a/configure +++ b/configure @@ -1718,7 +1718,7 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang PACKAGE="mbsebbs" MAJOR="0" MINOR="91" -REVISION="3" +REVISION="4" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2007 Michiel Broek, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2007 M. Broek" diff --git a/configure.in b/configure.in index 27e0f6c2..c2e67127 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,7 @@ dnl PACKAGE="mbsebbs" MAJOR="0" MINOR="91" -REVISION="3" +REVISION="4" VERSION="$MAJOR.$MINOR.$REVISION" COPYRIGHT="Copyright (C) 1997-2007 Michiel Broek, All Rights Reserved" SHORTRIGHT="Copyright (C) 1997-2007 M. Broek" diff --git a/examples/Makefile b/examples/Makefile index 4fab8ccc..a3fc4edb 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -32,44 +32,44 @@ help: @echo "You may replace the word english above with spanish galego german dutch" english-menus: - @tar xfC menus-en.tar ${PREFIX}/english/menus + @tar xfC menus-en.tar ${PREFIX}/share/int/menus/en @echo "Installed default English menus" english-txtfiles: - @tar xfC txtfiles-en.tar ${PREFIX}/english/txtfiles + @tar xfC txtfiles-en.tar ${PREFIX}/share/int/txtfiles/en @echo "Installed default English txtfiles" english-macros: - @tar xfC templates-en.tar ${PREFIX}/english/macro + @tar xfC templates-en.tar ${PREFIX}/share/int/macro/en @echo "Installed default English macro files" english: english-menus english-macros english-txtfiles spanish-menus: - @tar xfC menus-es.tar ${PREFIX}/spanish/menus + @tar xfC menus-es.tar ${PREFIX}/share/int/menus/es @echo "Installed default Spanish menus" spanish-txtfiles: - @tar xfC txtfiles-es.tar ${PREFIX}/spanish/txtfiles + @tar xfC txtfiles-es.tar ${PREFIX}/share/int/txtfiles/es @echo "Installed default Spanish txtfiles" spanish-macros: - @tar xfC templates-es.tar ${PREFIX}/spanish/macro + @tar xfC templates-es.tar ${PREFIX}/share/int/macro/es @echo "Installed default Spanish macro files" spanish: spanish-menus spanish-txtfiles spanish-macros german-macros: - @tar xfC templates-de.tar ${PREFIX}/german/macro + @tar xfC templates-de.tar ${PREFIX}/share/int/macro/de @echo "Installed default German macro files" german: german-macros dutch-macros: - @tar xfC templates-nl.tar ${PREFIX}/dutch/macro + @tar xfC templates-nl.tar ${PREFIX}/share/int/macro/nl @echo "Installed default Dutch macro files" dutch: dutch-macros @@ -91,14 +91,14 @@ install: ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 footer.txt ${ETCDIR} ; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 footer.txt ${ETCDIR}" ; \ fi - @if [ ! -f ${PREFIX}/english/menus/main.mnu ]; then ${MAKE} -s english-menus ; fi - @if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then ${MAKE} -s english-txtfiles ; fi - @if [ ! -f ${PREFIX}/english/macro/html.tic ]; then ${MAKE} -s english-macros ; fi - @if [ ! -f ${PREFIX}/spanish/menus/main.mnu ]; then ${MAKE} -s spanish-menus ; fi - @if [ ! -f ${PREFIX}/spanish/txtfiles/main.ans ]; then ${MAKE} -s spanish-txtfiles ; fi - @if [ ! -f ${PREFIX}/spanish/macro/html.tic ]; then ${MAKE} -s spanish-macros ; fi - @if [ ! -f ${PREFIX}/german/macro/html.tic ]; then ${MAKE} -s german-macros ; fi - @if [ ! -f ${PREFIX}/dutch/macro/html.tic ]; then ${MAKE} -s dutch-macros ; fi + @if [ ! -f ${PREFIX}/share/int/menus/en/main.mnu ]; then ${MAKE} -s english-menus ; fi + @if [ ! -f ${PREFIX}/share/int/txtfiles/en/main.ans ]; then ${MAKE} -s english-txtfiles ; fi + @if [ ! -f ${PREFIX}/share/int/macro/en/html.tic ]; then ${MAKE} -s english-macros ; fi + @if [ ! -f ${PREFIX}/share/int/menus/es/main.mnu ]; then ${MAKE} -s spanish-menus ; fi + @if [ ! -f ${PREFIX}/share/int/txtfiles/es/main.ans ]; then ${MAKE} -s spanish-txtfiles ; fi + @if [ ! -f ${PREFIX}/share/int/macro/es/html.tic ]; then ${MAKE} -s spanish-macros ; fi + @if [ ! -f ${PREFIX}/share/int/macro/es/html.tic ]; then ${MAKE} -s german-macros ; fi + @if [ ! -f ${PREFIX}/share/int/macro/es/html.tic ]; then ${MAKE} -s dutch-macros ; fi clean: rm -f *.h~ *.c~ core filelist Makefile.bak diff --git a/html/images/language.png b/html/images/language.png index 9efee082..0da4f797 100644 Binary files a/html/images/language.png and b/html/images/language.png differ diff --git a/html/setup/global.html b/html/setup/global.html index c26fc06c..d02f80bd 100644 --- a/html/setup/global.html +++ b/html/setup/global.html @@ -14,7 +14,7 @@
-
Last update 16-Nov-2005
+
Last update 17-Feb-2007

MBSE BBS Setup - Global Setup

In this setup you can edit all global settings for MBSE BBS. All sections will @@ -62,7 +62,6 @@ a chat network. Debug logfile The name of the debug logfile Mgr logfile The name of the area-/filemgr logfile Default menu The name of the default main menu -Default language The name of the default language Chat logfile The name of the logfile for chatting Welcome logo The name of the BBS logo ANSI file @@ -71,19 +70,16 @@ a chat network.

1.4. Edit Global Paths

-BBS Menus         The path to the default menus
-Txtfiles          The path to the default ANSI and ASCII textfiles
-Macro's           The path to the default macro templates
 Home dirs         The path to the users home directories
 FTP base          The FTP base path, ie. /opt/mbse/ftp/pub
 Arealists         The path where area lists and filebone lists are stored
 Ext. edit         The full path and filename to the external editor
 Rules dir         The path to the directory to store area rules
-
 Magic's           Where the magic filerequests are kept
 DOS path          The DOS drive and path
 Unix path         The Translated DOS path in real
 LeaveCase         Leave outbound .flo filenames as is, No forces to uppercase
+
 Nodelists         The path to the nodelist directory
 Inbound           The unprotected fidonet inbound
 Prot inb.         The (password) protected fidonet inbound
@@ -136,6 +132,7 @@ files.
 Simult. logins    Maximum simultaneous logins allowed, 0 is unlimited, 1 is adviced.
 Child priority    Subproces nice priority, 0=high, 15=low CPU load.
 Filesystem sync   Call sync before and after execute.
+Default language  Default language (English).
 
The minimum diskspace setting is to prevent that files get corrupted if your filesystem is full. All drives are checked except CD-roms and floppies and the /boot directory if that @@ -154,6 +151,10 @@ mail and files can get corrupted. XxxxBSD systems use synchronous directory updates and don't need this switch. If you don't know what all this is about, leave this to the default setting.

+Choice of default language. English is the best choice because that is the only +language that is complete in the default installation. In the user setup another +language may be used, the language set here is then used as a backup. +

1.6. User flag Descriptions.

diff --git a/html/setup/language.html b/html/setup/language.html index 3752dad6..063ec390 100644 --- a/html/setup/language.html +++ b/html/setup/language.html @@ -14,14 +14,14 @@

-
Last update 09-Sep-2005
+
Last update 17-Feb-2007

MBSE BBS Setup - BBS Setup - Language Setup.

Language introduction.

-You need to define at least one language, this is the default language. -The paths to the BBS menus and Txtfiles for the default language -must be exactly the same as defined in the global setup, menus 1.3.1 and 1.3.2
+You need to define at least one language, this is the default language. +The ISO language code of the dfeault language needs to be the same as in the +global setup 1.5.24 and should be set to en. I did this so you can make your own local languages next to the default languages. If something is not present in your local language, the BBS will fall back to the default @@ -29,6 +29,19 @@ language. It is therefore wise to name all menus, macro templates and textfiles the same for all languages used. When you setup the languages for the first time, entries for English, Dutch, Spanish, Galego, German, French and Chinese languages are created. +

+And important note about the ISO code, don't change this. And if you do, +then you must change the directory name under /opt/mbse/share/int +to the same name as the code here. For example for the en code the system +expects the following paths and files: +

+

+/opt/mbse/share/int/language.en
+/opt/mbse/share/int/menus/en/*.mnu
+/opt/mbse/share/int/txtfiles/en/*.ans
+/opt/mbse/share/int/txtfiles/en/*.asc
+/opt/mbse/share/int/macro/en/*
+

 

Language setup.

@@ -36,11 +49,8 @@ Spanish, Galego, German, French and Chinese languages are created.
 Select      The letter to select this language.
 Name        The name of this language.
-Menupath    The path to the menu files.
-Textpath    The path to the ANSI and ASCII textfiles.
-Macropath   The path to the macro templates.
+ISO code    The 2 letter ISO code of the language.
 Available   If this language is available.
-Datafile    The name of the language datafile in ~/etc
 Security    The minimum security level to select this language.
 Deleted     If this language must be deleted.
 
diff --git a/lang/.cvsignore b/lang/.cvsignore index ff183b4b..256af178 100644 --- a/lang/.cvsignore +++ b/lang/.cvsignore @@ -1 +1 @@ -dutch.lang english.lang filelist galego.lang german.lang germandu.lang spanish.lang french.lang chinese.lang +language.nl language.en filelist language.gl language.de language.es language.fr language.zh diff --git a/lang/Makefile b/lang/Makefile index 5d2717f7..5d54aa59 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -4,41 +4,40 @@ include ../Makefile.global -OTHER = Makefile README Language.xref -SDAT = english.txt dutch.txt spanish.txt galego.txt german.txt germandu.txt french.txt chinese.txt -LDAT = english.lang dutch.lang spanish.lang galego.lang german.lang germandu.lang french.lang chinese.lang +OTHER = Makefile README Language.xref germandu.txt +SDAT = source.en source.nl source.es source.gl source.de source.fr source.zh +LDAT = language.en language.nl language.es language.gl language.de language.fr language.zh + all: ${LDAT} clean: - rm -f core filelist Makefile.bak *.lang + rm -f core filelist Makefile.bak language.* install: ${LDAT} - ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0444 ${LDAT} ${ETCDIR} + ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0444 ${LDAT} ${INTDIR} -english.lang: english.txt - ../mbutils/mblang english.lang english.txt +language.en: source.en + ../mbutils/mblang language.en source.en -dutch.lang: dutch.txt - ../mbutils/mblang dutch.lang dutch.txt +language.nl: source.nl + ../mbutils/mblang language.nl source.nl -spanish.lang: spanish.txt - ../mbutils/mblang spanish.lang spanish.txt +language.es: source.es + ../mbutils/mblang language.es source.es -galego.lang: galego.txt - ../mbutils/mblang galego.lang galego.txt +language.gl: source.gl + ../mbutils/mblang language.gl source.gl -german.lang: german.txt - ../mbutils/mblang german.lang german.txt +language.de: source.de + ../mbutils/mblang language.de source.de -germandu.lang: germandu.txt - ../mbutils/mblang germandu.lang germandu.txt +language.fr: source.fr + ../mbutils/mblang language.fr source.fr -french.lang: french.txt - ../mbutils/mblang french.lang french.txt +language.zh: source.zh + ../mbutils/mblang language.zh source.zh -chinese.lang: chinese.txt - ../mbutils/mblang chinese.lang chinese.txt filelist: Makefile BASE=`pwd`; \ diff --git a/lang/README b/lang/README index 5bc3666a..73f1e946 100644 --- a/lang/README +++ b/lang/README @@ -6,9 +6,9 @@ $Id$ This directory contains the language sources for MBSE BBS. The file Language.xref is only a reference file with linenumbers and source -references. The files english.txt, dutch.txt and italian.txt are the -real language sources. The resulting files dutch.lang, english.lang -and italian.lang are placed in the ~/etc directory where the bbs +references. The files source.en, source.nl and source.de are the +real language sources. The resulting files language.nl, language.en +and language.de are placed in the ~/share/int directory where the bbs will expect them to be. If you make your own language files, use Language.xref as a guide. @@ -29,12 +29,15 @@ Michiel. Current language maintainters: -english Michiel Broek -dutch Michiel Broek -italian Vacant -spanisch Redy Rodriguez -galego Redy Rodriguez -german Harald Wuensch -germandu Malte Tychsen <2:240/9350@fidonet> -french Francois Thunus <2:270/24@fidonet> +en Michiel Broek +nl Michiel Broek +es Redy Rodriguez +gl Redy Rodriguez +de Harald Wuensch +germandu Malte Tychsen <2:240/9350@fidonet> (alternative german). +fr Francois Thunus <2:270/24@fidonet> + +If you want to use the germandu language instead of the default german +language then run "mblang germandu.txt language.de" and install the +file laguage.de in /opt/mbse/share/int. diff --git a/lang/german.txt b/lang/source.de similarity index 100% rename from lang/german.txt rename to lang/source.de diff --git a/lang/english.txt b/lang/source.en similarity index 100% rename from lang/english.txt rename to lang/source.en diff --git a/lang/spanish.txt b/lang/source.es similarity index 100% rename from lang/spanish.txt rename to lang/source.es diff --git a/lang/french.txt b/lang/source.fr similarity index 100% rename from lang/french.txt rename to lang/source.fr diff --git a/lang/galego.txt b/lang/source.gl similarity index 100% rename from lang/galego.txt rename to lang/source.gl diff --git a/lang/dutch.txt b/lang/source.nl similarity index 100% rename from lang/dutch.txt rename to lang/source.nl diff --git a/lang/chinese.txt b/lang/source.zh similarity index 100% rename from lang/chinese.txt rename to lang/source.zh diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index a6fb2dc7..f80e896f 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -384,7 +384,7 @@ FILE *OpenMacro(const char *filename, int Language, int htmlmode) while (fread(&lang, langhdr.recsize, 1, pLang) == 1) { if ((lang.LangKey[0] == Language) && (lang.Available)) { - snprintf(temp, PATH_MAX -1, "%s/%s", lang.MacroPath, filename); + snprintf(temp, PATH_MAX -1, "%s/share/int/macro/%s/%s", getenv("MBSE_ROOT"), lang.lc, filename); break; } } @@ -403,7 +403,7 @@ FILE *OpenMacro(const char *filename, int Language, int htmlmode) */ if (fi == NULL) { Syslog('-', "Macro file \"%s\" for language %c not found, trying default", filename, Language); - snprintf(temp, PATH_MAX -1, "%s/%s", CFG.bbs_macros, filename); + snprintf(temp, PATH_MAX -1, "%s/share/int/macro/%s/%s", getenv("MBSE_ROOT"), CFG.deflang, filename); fi = fopen(temp,"r"); } diff --git a/lib/mbse.h b/lib/mbse.h index 09e369d7..0a0a1c11 100644 --- a/lib/mbse.h +++ b/lib/mbse.h @@ -4,7 +4,7 @@ * Purpose ...............: Global variables for MBSE BBS * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -108,6 +108,6 @@ struct tm *l_date; /* Structure for Date */ time_t ltime; time_t Time_Now; - +char current_language[10]; /* Current language of the user */ #endif diff --git a/lib/mbselib.h b/lib/mbselib.h index 54441028..af66dc50 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS main library header * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -963,14 +963,14 @@ struct sysconfig { /* FileNames */ char error_log[15]; /* Name of Error Log */ char default_menu[15]; /* Default Menu */ - char current_language[15]; /* Default Language */ + char xcurrent_language[15]; /* Default Language */ char chat_log[15]; /* Chat Logfile */ char welcome_logo[15]; /* Welcome Logofile */ /* Paths */ char rnewspath[65]; /* Path to rnews */ - char bbs_menus[65]; /* Default Menus */ - char bbs_txtfiles[65]; /* Default Textfiles */ + char xbbs_menus[65]; + char xbbs_txtfiles[65]; char nntpnode[65]; /* NNTP server */ char msgs_path[65]; /* Path to *.msg area */ char alists_path[65]; /* Area lists storage */ @@ -1088,7 +1088,7 @@ struct sysconfig { char xCallScript[51]; /* Mail Options */ - char xquotestr[11]; /* Quote String */ + char deflang[11]; /* Default language */ int xMaxTimeBalance; /* Obsolete Time Bank Door */ int xMaxTimeWithdraw; @@ -1238,7 +1238,7 @@ struct sysconfig { int nntpdupes; /* NNTP dupes database size */ int newsfeed; /* Newsfeed mode */ int maxarticles; /* Default max articles */ - char bbs_macros[65]; /* Default macros path */ + char xbbs_macros[65]; char out_queue[65]; /* Outbound queue path */ char mgrlog[15]; /* Area/File-mgr logfile */ @@ -1412,13 +1412,14 @@ struct languagehdr { struct language { char Name[30]; /* Name of Language */ char LangKey[2]; /* Language Key */ - char MenuPath[81]; /* Path of menu directory */ - char TextPath[81]; /* Path of text files */ + char xMenuPath[81]; /* Path of menu directory */ + char xTextPath[81]; /* Path of text files */ unsigned Available : 1; /* Availability of Language*/ unsigned Deleted : 1; /* Language is deleted */ - char Filename[81]; /* Path of language file */ + char xFilename[81]; /* Path of language file */ securityrec Security; /* Security level */ - char MacroPath[81]; /* Path to the macro files */ + char xMacroPath[81]; /* Path to the macro files */ + char lc[10]; /* ISO language code */ }; diff --git a/mbsebbs/change.c b/mbsebbs/change.c index 9a78cd2d..505542a8 100644 --- a/mbsebbs/change.c +++ b/mbsebbs/change.c @@ -4,7 +4,7 @@ * Purpose ...............: Change user settings * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -111,7 +111,7 @@ int Chg_Language(int NewMode) while (fread(&lang, langhdr.recsize, 1, pLang) == 1) { strcpy(lang.LangKey,tu(lang.LangKey)); if ((lang.LangKey[0] == iLang) && (lang.Available)) { - strcpy(CFG.current_language, lang.Filename); + strcpy(current_language, lang.lc); iFoundLang = TRUE; break; } @@ -126,7 +126,7 @@ int Chg_Language(int NewMode) Enter(2); } else { exitinfo.iLanguage = iLang; - strcpy(CFG.current_language, lang.Filename); + strcpy(current_language, lang.lc); Free_Language(); InitLanguage(); diff --git a/mbsebbs/dispfile.c b/mbsebbs/dispfile.c index eb09b812..64caf287 100644 --- a/mbsebbs/dispfile.c +++ b/mbsebbs/dispfile.c @@ -4,7 +4,7 @@ * Purpose ...............: Display ANSI/ASCII textfiles * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -251,16 +251,16 @@ int DisplayFile(char *filename) */ pFileName = NULL; if (exitinfo.GraphMode) { - snprintf(newfile, PATH_MAX, "%s/%s.ans", lang.TextPath, filename); + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), lang.lc, filename); if ((pFileName = fopen(newfile, "rb")) == NULL) { - snprintf(newfile, PATH_MAX, "%s/%s.ans", CFG.bbs_txtfiles, filename); + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.ans", getenv("MBSE_ROOT"), CFG.deflang, filename); pFileName = fopen(newfile, "rb"); } } if (pFileName == NULL) { - snprintf(newfile, PATH_MAX, "%s/%s.asc", lang.TextPath, filename); + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.asc", getenv("MBSE_ROOT"), lang.lc, filename); if ((pFileName = fopen(newfile, "rb")) == NULL) { - snprintf(newfile, PATH_MAX, "%s/%s.asc", CFG.bbs_txtfiles, filename); + snprintf(newfile, PATH_MAX, "%s/share/int/txtfiles/%s/%s.asc", getenv("MBSE_ROOT"), CFG.deflang, filename); if ((pFileName = fopen(newfile, "rb")) == NULL) { free(sFileName); free(tmp); diff --git a/mbsebbs/language.c b/mbsebbs/language.c index 6fbe381a..560895c9 100644 --- a/mbsebbs/language.c +++ b/mbsebbs/language.c @@ -4,7 +4,7 @@ * Purpose ...............: Language functions. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -103,7 +103,7 @@ void Set_Language(int iLanguage) fread(&langhdr, sizeof(langhdr), 1, pLang); while (fread(&lang, langhdr.recsize, 1, pLang) == 1) { if ((lang.LangKey[0] == iLanguage) && (lang.Available)) { - strcpy(CFG.current_language, lang.Filename); + strcpy(current_language, lang.lc); break; } } @@ -126,7 +126,7 @@ void InitLanguage() temp = calloc(PATH_MAX, sizeof(char)); - snprintf(temp, PATH_MAX, "%s/etc/%s", getenv("MBSE_ROOT"), CFG.current_language); + snprintf(temp, PATH_MAX, "%s/share/int/language.%s", getenv("MBSE_ROOT"), current_language); if ((pLang = fopen(temp, "rb")) == NULL) { WriteError("$FATAL: Can't open %s", temp); ExitClient(MBERR_INIT_ERROR); @@ -148,7 +148,7 @@ void InitLanguage() } fclose(pLang); - Syslog('b', "%d language lines read (%s)", iLang, CFG.current_language); + Syslog('b', "%d language lines read (%s)", iLang, current_language); free(temp); } diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index 0456f269..ebf2a53d 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -181,6 +181,7 @@ int main(int argc, char **argv) /* * Initialize */ + snprintf(current_language, 10, "%s", CFG.deflang); InitLanguage(); InitMenu(); memset(&MsgBase, 0, sizeof(MsgBase)); diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index 893095de..68341477 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -4,7 +4,7 @@ * Purpose ...............: Display and handle the menus. * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -107,9 +107,9 @@ void menu() * Open menufile, first users language menu, if it fails * try to open the default menu. */ - snprintf(sMenuPathFileName, PATH_MAX, "%s/%s", lang.MenuPath, Menus[MenuLevel]); + snprintf(sMenuPathFileName, PATH_MAX, "%s/share/int/menus/%s/%s", getenv("MBSE_ROOT"), lang.lc, Menus[MenuLevel]); if ((pMenuFile = fopen(sMenuPathFileName, "r")) == NULL) { - snprintf(sMenuPathFileName, PATH_MAX, "%s/%s", CFG.bbs_menus, Menus[MenuLevel]); + snprintf(sMenuPathFileName, PATH_MAX, "%s/share/int/menus/%s/%s", getenv("MBSE_ROOT"), CFG.deflang, Menus[MenuLevel]); pMenuFile = fopen(sMenuPathFileName,"r"); if (pMenuFile != NULL) Syslog('b', "Menu %s (Default)", Menus[MenuLevel]); diff --git a/mbsebbs/misc.c b/mbsebbs/misc.c index 88129db0..9ee93791 100644 --- a/mbsebbs/misc.c +++ b/mbsebbs/misc.c @@ -4,7 +4,7 @@ * Purpose ...............: Misc functions * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -118,7 +118,7 @@ void DisplayLogo() temp = calloc(PATH_MAX, sizeof(char)); sString = calloc(1024, sizeof(char)); - snprintf(temp, PATH_MAX, "%s/%s", CFG.bbs_txtfiles, CFG.welcome_logo); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/%s", getenv("MBSE_ROOT"), CFG.deflang, CFG.welcome_logo); if ((pLogo = fopen(temp,"rb")) == NULL) WriteError("$DisplayLogo: Can't open %s", temp); else { diff --git a/mbsebbs/page.c b/mbsebbs/page.c index 62939bf2..70f9858f 100644 --- a/mbsebbs/page.c +++ b/mbsebbs/page.c @@ -5,7 +5,7 @@ * Todo ..................: Implement new config settings. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -289,7 +289,7 @@ void PageReason() temp = calloc(PATH_MAX, sizeof(char)); String = calloc(81, sizeof(char)); - snprintf(temp, PATH_MAX, "%s/page.asc", CFG.bbs_txtfiles); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/page.asc", getenv("MBSE_ROOT"), CFG.deflang); if ((Page = fopen(temp, "r")) != NULL) { while (( fgets(String, 80 ,Page)) != NULL) diff --git a/mbsebbs/user.c b/mbsebbs/user.c index 2d98a6f5..30a19fa1 100644 --- a/mbsebbs/user.c +++ b/mbsebbs/user.c @@ -6,7 +6,7 @@ * does a lot of checking in general. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -529,18 +529,18 @@ void user(void) */ st.st_mtime = 0; if (exitinfo.GraphMode) { - snprintf(temp, PATH_MAX, "%s/onceonly.ans", lang.TextPath); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), lang.lc); stat(temp, &st); if (st.st_mtime == 0) { - snprintf(temp, PATH_MAX, "%s/onceonly.ans", CFG.bbs_txtfiles); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.ans", getenv("MBSE_ROOT"), CFG.deflang); stat(temp, &st); } } if (st.st_mtime == 0) { - snprintf(temp, PATH_MAX, "%s/onceonly.asc", lang.TextPath); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.asc", getenv("MBSE_ROOT"), lang.lc); stat(temp, &st); if (st.st_mtime == 0) { - snprintf(temp, PATH_MAX, "%s/onceonly.asc", CFG.bbs_txtfiles); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s/onceonly.asc", getenv("MBSE_ROOT"), CFG.deflang); stat(temp, &st); } } diff --git a/mbsetup/Makefile b/mbsetup/Makefile index a662034b..6e9cd681 100644 --- a/mbsetup/Makefile +++ b/mbsetup/Makefile @@ -92,7 +92,7 @@ m_tty.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_modem. mutil.o: ../config.h ../lib/mbselib.h ../lib/diesel.h screen.h ledit.h mutil.h m_archive.o: ../config.h ../lib/mbselib.h ../paths.h screen.h mutil.h ledit.h stlist.h m_global.h m_archive.h m_fdb.o: ../config.h ../lib/mbselib.h ../lib/users.h ../lib/mbsedb.h screen.h mutil.h ledit.h m_global.h m_farea.h m_fdb.h -m_global.o: ../config.h ../paths.h ../lib/mbselib.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_limits.h m_global.h +m_global.o: ../config.h ../paths.h ../lib/mbselib.h screen.h mutil.h ledit.h m_node.h m_marea.h m_ticarea.h m_new.h m_fgroup.h m_mgroup.h m_limits.h m_global.h m_lang.h m_magic.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_ticarea.h m_global.h m_magic.h m_mgroup.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h stlist.h m_global.h m_node.h m_marea.h m_mgroup.h m_node.o: ../config.h ../lib/mbselib.h screen.h mutil.h ledit.h grlist.h stlist.h m_global.h m_lang.h m_ticarea.h m_marea.h m_archive.h m_node.h diff --git a/mbsetup/m_global.c b/mbsetup/m_global.c index 1e76c155..fe74308e 100644 --- a/mbsetup/m_global.c +++ b/mbsetup/m_global.c @@ -4,7 +4,7 @@ * Purpose ...............: Global Setup Program * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -42,6 +42,7 @@ #include "m_mgroup.h" #include "m_limits.h" #include "m_global.h" +#include "m_lang.h" char *some_fn; @@ -187,9 +188,8 @@ void e_filenames(void) mbse_mvprintw( 9, 6, "3. Debug logfile"); mbse_mvprintw(10, 6, "4. Mgr logfile"); mbse_mvprintw(11, 6, "5. Default Menu"); - mbse_mvprintw(12, 6, "6. Default Language"); - mbse_mvprintw(13, 6, "7. Chat Logfile"); - mbse_mvprintw(14, 6, "8. Welcome Logo"); + mbse_mvprintw(12, 6, "6. Chat Logfile"); + mbse_mvprintw(13, 6, "7. Welcome Logo"); for (;;) { set_color(WHITE, BLACK); @@ -198,20 +198,18 @@ void e_filenames(void) show_str( 9,28,14, CFG.debuglog); show_str(10,28,14, CFG.mgrlog); show_str(11,28,14, CFG.default_menu); - show_str(12,28,14, CFG.current_language); - show_str(13,28,14, CFG.chat_log); - show_str(14,28,14, CFG.welcome_logo); + show_str(12,28,14, CFG.chat_log); + show_str(13,28,14, CFG.welcome_logo); - switch(select_menu(8)) { + switch(select_menu(7)) { case 0: return; case 1: E_STR( 7,28,14, CFG.logfile, "The name of the ^system^ logfile.") case 2: E_STR( 8,28,14, CFG.error_log, "The name of the ^errors^ logfile.") case 3: E_STR( 9,28,14, CFG.debuglog, "The name of the ^debug^ logfile.") case 4: E_STR(10,28,14, CFG.mgrlog, "The name of the ^area-/filemgr^ logfile.") case 5: E_STR(11,28,14, CFG.default_menu, "The name of the ^default^ (top) ^menu^.") - case 6: E_STR(12,28,14, CFG.current_language, "The name of the ^default language^.") - case 7: E_STR(13,28,14, CFG.chat_log, "The name of the ^chat^ logfile.") - case 8: E_STR(14,28,14, CFG.welcome_logo, "The name of the ^BBS logo^ file.") + case 6: E_STR(12,28,14, CFG.chat_log, "The name of the ^chat^ logfile.") + case 7: E_STR(13,28,14, CFG.welcome_logo, "The name of the ^BBS logo^ file.") } } } @@ -222,60 +220,48 @@ void e_global2(void) { clr_index(); set_color(WHITE, BLACK); - mbse_mvprintw( 4, 6, "1.4 EDIT GLOBAL PATHS - 2"); + mbse_mvprintw( 4, 6, "1.4 EDIT GLOBAL PATHS - 2"); set_color(CYAN, BLACK); - mbse_mvprintw( 6, 2, "1. Magic's"); - mbse_mvprintw( 7, 2, "2. DOS path"); - mbse_mvprintw( 8, 2, "3. Unix path"); - mbse_mvprintw( 9, 2, "4. LeaveCase"); - mbse_mvprintw(10, 2, "5. Nodelists"); - mbse_mvprintw(11, 2, "6. Inbound"); - mbse_mvprintw(12, 2, "7. Prot inb."); - mbse_mvprintw(13, 2, "8. Outbound"); - mbse_mvprintw(14, 2, "9. Out queue"); - mbse_mvprintw(15, 2, "10. *.msgs"); - mbse_mvprintw(16, 2, "11. Bad TIC's"); - mbse_mvprintw(17, 2, "12. TIC queue"); - mbse_mvprintw(18, 2, "13. TMail DOS"); - mbse_mvprintw(19, 2, "14. TMail Win"); + mbse_mvprintw( 6, 2, "1. Nodelists"); + mbse_mvprintw( 7, 2, "2. Inbound"); + mbse_mvprintw( 8, 2, "3. Prot inb."); + mbse_mvprintw( 9, 2, "4. Outbound"); + mbse_mvprintw(10, 2, "5. Out queue"); + mbse_mvprintw(11, 2, "6. *.msgs"); + mbse_mvprintw(12, 2, "7. Bad TIC's"); + mbse_mvprintw(13, 2, "8. TIC queue"); + mbse_mvprintw(14, 2, "9. TMail DOS"); + mbse_mvprintw(15, 2, "10. TMail Win"); for (;;) { set_color(WHITE, BLACK); - show_str( 6,16,64, CFG.req_magic); - show_str( 7,16,64, CFG.dospath); - show_str( 8,16,64, CFG.uxpath); - show_bool(9,16, CFG.leavecase); - show_str(10,16,64, CFG.nodelists); - show_str(11,16,64, CFG.inbound); - show_str(12,16,64, CFG.pinbound); - show_str(13,16,64, CFG.outbound); - show_str(14,16,64, CFG.out_queue); - show_str(15,16,64, CFG.msgs_path); - show_str(16,16,64, CFG.badtic); - show_str(17,16,64, CFG.ticout); - show_str(18,16,64, CFG.tmailshort); - show_str(19,16,64, CFG.tmaillong); + show_str( 6,16,64, CFG.nodelists); + show_str( 7,16,64, CFG.inbound); + show_str( 8,16,64, CFG.pinbound); + show_str( 9,16,64, CFG.outbound); + show_str(10,16,64, CFG.out_queue); + show_str(11,16,64, CFG.msgs_path); + show_str(12,16,64, CFG.badtic); + show_str(13,16,64, CFG.ticout); + show_str(14,16,64, CFG.tmailshort); + show_str(15,16,64, CFG.tmaillong); - switch (select_menu(14)) { + switch (select_menu(10)) { case 0: return; - case 1: E_PTH( 6,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.", 0750) - case 2: E_STR( 7,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation") - case 3: E_PTH( 8,16,64, CFG.uxpath, "The translated ^Unix^ path.", 0750) - case 4: E_BOOL(9,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.") - case 5: E_PTH(10,16,64, CFG.nodelists, "The path to the ^nodelists^.", 0750) - case 6: E_PTH(11,16,64, CFG.inbound, "The path to the ^inbound^ for unknown systems.", 0750) - case 7: E_PTH(12,16,64, CFG.pinbound, "The path to the ^nodelists^ for protected systems.", 0750) - case 8: E_PTH(13,16,64, CFG.outbound, "The path to the base ^outbound^ directory.", 0750) - case 9: E_PTH(14,16,64, CFG.out_queue, "The path to the ^temp outbound queue^ directory.", 0750) - case 10:E_PTH(15,16,64, CFG.msgs_path, "The path to the ^*.msgs^ directory.", 0750) - case 11:E_PTH(16,16,64, CFG.badtic, "The path to the ^bad tic files^.", 0750) - case 12:E_PTH(17,16,64, CFG.ticout, "The path to the ^outgoing TIC^ files.", 0750) - case 13:if (strlen(CFG.tmailshort) == 0) + case 1: E_PTH( 6,16,64, CFG.nodelists, "The path to the ^nodelists^.", 0750) + case 2: E_PTH( 7,16,64, CFG.inbound, "The path to the ^inbound^ for unknown systems.", 0750) + case 3: E_PTH( 8,16,64, CFG.pinbound, "The path to the ^nodelists^ for protected systems.", 0750) + case 4: E_PTH( 9,16,64, CFG.outbound, "The path to the base ^outbound^ directory.", 0750) + case 5: E_PTH(10,16,64, CFG.out_queue, "The path to the ^temp outbound queue^ directory.", 0750) + case 6: E_PTH(11,16,64, CFG.msgs_path, "The path to the ^*.msgs^ directory.", 0750) + case 7: E_PTH(12,16,64, CFG.badtic, "The path to the ^bad tic files^.", 0750) + case 8: E_PTH(13,16,64, CFG.ticout, "The path to the ^outgoing TIC^ files.", 0750) + case 9: if (strlen(CFG.tmailshort) == 0) snprintf(CFG.tmailshort, 65, "%s/var/tmail/short", getenv("MBSE_ROOT")); - E_PTH(18,16,64, CFG.tmailshort, "The ^T-Mail 8.3 basepath^ (blank = disable)", 0770) - case 14:if (strlen(CFG.tmaillong) == 0) + E_PTH(14,16,64, CFG.tmailshort, "The ^T-Mail 8.3 basepath^ (blank = disable)", 0770) + case 10:if (strlen(CFG.tmaillong) == 0) snprintf(CFG.tmaillong, 65, "%s/var/tmail/long", getenv("MBSE_ROOT")); - E_PTH(19,16,64, CFG.tmaillong, "The ^T-Mail long basepath^ (blank = disable)", 0770) + E_PTH(15,16,64, CFG.tmaillong, "The ^T-Mail long basepath^ (blank = disable)", 0770) } } } @@ -286,17 +272,18 @@ void s_global(void) { clr_index(); set_color(WHITE, BLACK); - mbse_mvprintw( 4, 6, "1.4 EDIT GLOBAL PATHS"); + mbse_mvprintw( 4, 6, "1.4 EDIT GLOBAL PATHS"); set_color(CYAN, BLACK); - mbse_mvprintw( 6, 2, "1. BBS menus"); - mbse_mvprintw( 7, 2, "2. Txtfiles"); - mbse_mvprintw( 8, 2, "3. Macro's"); - mbse_mvprintw( 9, 2, "4. Home dirs"); - mbse_mvprintw(10, 2, "5. Ftp base"); - mbse_mvprintw(11, 2, "6. Arealists"); - mbse_mvprintw(12, 2, "7. Ext. edit"); - mbse_mvprintw(13, 2, "8. Rules dir"); - mbse_mvprintw(14, 2, "9. Next Screen"); + mbse_mvprintw( 6, 2, "1. Home dirs"); + mbse_mvprintw( 7, 2, "2. Ftp base"); + mbse_mvprintw( 8, 2, "3. Arealists"); + mbse_mvprintw( 9, 2, "4. Ext. edit"); + mbse_mvprintw(10, 2, "5. Rules dir"); + mbse_mvprintw(11, 2, "6. Magic's"); + mbse_mvprintw(12, 2, "7. DOS path"); + mbse_mvprintw(13, 2, "8. Unix path"); + mbse_mvprintw(14, 2, "9. LeaveCase"); + mbse_mvprintw(15, 2, "10. Next Screen"); } @@ -307,26 +294,28 @@ void e_global(void) for (;;) { set_color(WHITE, BLACK); - show_str( 6,16,64, CFG.bbs_menus); - show_str( 7,16,64, CFG.bbs_txtfiles); - show_str( 8,16,64, CFG.bbs_macros); - show_str( 9,16,64, CFG.bbs_usersdir); - show_str(10,16,64, CFG.ftp_base); - show_str(11,16,64, CFG.alists_path); - show_str(12,16,64, CFG.externaleditor); - show_str(13,16,64, CFG.rulesdir); + show_str( 6,16,64, CFG.bbs_usersdir); + show_str( 7,16,64, CFG.ftp_base); + show_str( 8,16,64, CFG.alists_path); + show_str( 9,16,64, CFG.externaleditor); + show_str( 10,16,64, CFG.rulesdir); + show_str( 11,16,64, CFG.req_magic); + show_str( 12,16,64, CFG.dospath); + show_str( 13,16,64, CFG.uxpath); + show_bool(14,16, CFG.leavecase); - switch (select_menu(9)) { + switch (select_menu(10)) { case 0: return; - case 1: E_PTH( 6,16,64, CFG.bbs_menus, "The path to the ^default menus^.", 0750) - case 2: E_PTH( 7,16,64, CFG.bbs_txtfiles, "The path to the ^default textfiles^.", 0750) - case 3: E_PTH( 8,16,64, CFG.bbs_macros, "The path to the ^default macro templates^.", 0750) - case 4: E_PTH( 9,16,64, CFG.bbs_usersdir, "The path to the ^users home^ directories.", 0770) - case 5: E_PTH(10,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory", 0750) - case 6: E_PTH(11,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.", 0750) - case 7: E_STR(12,16,64, CFG.externaleditor, "The full path and filename to the ^external msg editor^ (blank=disable)") - case 8: E_PTH(13,16,64, CFG.rulesdir, "The path where the ^arearules^ are stored", 0750) - case 9: e_global2(); + case 1: E_PTH( 6,16,64, CFG.bbs_usersdir, "The path to the ^users home^ directories.", 0770) + case 2: E_PTH( 7,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory", 0750) + case 3: E_PTH( 8,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.", 0750) + case 4: E_STR( 9,16,64, CFG.externaleditor, "The full path and filename to the ^external msg editor^ (blank=disable)") + case 5: E_PTH( 10,16,64, CFG.rulesdir, "The path where the ^arearules^ are stored", 0750) + case 6: E_PTH( 11,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.", 0750) + case 7: E_STR( 12,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation") + case 8: E_PTH( 13,16,64, CFG.uxpath, "The translated ^Unix^ path.", 0750) + case 9: E_BOOL(14,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.") + case 10:e_global2(); s_global(); break; } @@ -365,6 +354,7 @@ void b_screen(void) mbse_mvprintw(15,37, "21. Simult. logins"); mbse_mvprintw(16,37, "22. Child priority"); mbse_mvprintw(17,37, "23. Filesystem sync"); + mbse_mvprintw(18,37, "24. Default language"); set_color(WHITE, BLACK); show_bool( 7,24, CFG.exclude_sysop); @@ -391,6 +381,7 @@ void b_screen(void) show_int( 15,59, CFG.max_logins); show_int( 16,59, CFG.priority); show_bool(17,59, CFG.do_sync); + show_str( 18,59, 10, CFG.deflang); } @@ -400,7 +391,7 @@ void e_bbsglob(void) b_screen(); for (;;) { - switch(select_menu(23)) { + switch(select_menu(24)) { case 0: return; case 1: E_BOOL( 7,24, CFG.exclude_sysop, "^Exclude^ sysop from lists.") case 2: E_BOOL( 8,24, CFG.iConnectString, "Show ^connect string^ at logon") @@ -426,6 +417,10 @@ void e_bbsglob(void) case 21:E_INT( 15,59, CFG.max_logins, "Maximum ^simultaneous logins^ allowed, 0 means unlimited") case 22:E_IRC( 16,59, CFG.priority, 0, 15, "Subproces ^nice priority^, 0=high, 15=low CPU load") case 23:E_BOOL(17,59, CFG.do_sync, "Call ^sync^ before and after execute, use Yes on GNU/Linux") + case 24:PickLanguage((char *)"1.5.24"); + snprintf(CFG.deflang, 10, "%s", lang.lc); + b_screen(); + break; } } } @@ -1456,14 +1451,9 @@ void global_menu(void) crc = 0xffffffff; crc = upd_crc32((char *)&CFG, crc, sizeof(CFG)); - if (strlen(CFG.bbs_macros) == 0) { - snprintf(CFG.bbs_macros, 65, "%s/english/macro", getenv("MBSE_ROOT")); - Syslog('+', "Main config, upgraded default macro path"); - } - if (strlen(CFG.out_queue) == 0) { snprintf(CFG.out_queue, 65, "%s/var/queue", getenv("MBSE_ROOT")); - Syslog('+', "Main config, upgraded for new queue"); + Syslog('+', "Main config, upgraded for new queue"); } if (strlen(CFG.mgrlog) == 0) { @@ -1506,6 +1496,11 @@ void global_menu(void) } free(temp); + if (strlen(CFG.deflang) == 0) { + snprintf(CFG.deflang, 10, "%s", (char *)"en"); + Syslog('+', "Main config, upgraded default language to \"en\""); + } + if (!CFG.is_upgraded) { CFG.priority = 15; #ifdef __linux__ @@ -1813,7 +1808,6 @@ int global_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)"Debug logfile", CFG.debuglog); add_webtable(wp, (char *)"Manager logfile", CFG.mgrlog); add_webtable(wp, (char *)"Default menu", CFG.default_menu); - add_webtable(wp, (char *)"Default language", CFG.current_language); add_webtable(wp, (char *)"Chat logfile", CFG.chat_log); add_webtable(wp, (char *)"Welcome logo", CFG.welcome_logo); fprintf(wp, "\n"); @@ -1826,7 +1820,6 @@ int global_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Debug logfile %s\n", CFG.debuglog); fprintf(fp, " Manager logfile %s\n", CFG.mgrlog); fprintf(fp, " Default menu %s\n", CFG.default_menu); - fprintf(fp, " Default language %s\n", CFG.current_language); fprintf(fp, " Chat logfile %s\n", CFG.chat_log); fprintf(fp, " Welcome logo %s\n", CFG.welcome_logo); @@ -1834,9 +1827,6 @@ int global_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "\n"); fprintf(wp, "\n"); fprintf(wp, "\n"); - add_webtable(wp, (char *)"Menufiles", CFG.bbs_menus); - add_webtable(wp, (char *)"Textfiles", CFG.bbs_txtfiles); - add_webtable(wp, (char *)"Macro templates", CFG.bbs_macros); add_webtable(wp, (char *)"Users homedirs", CFG.bbs_usersdir); add_webtable(wp, (char *)"Nodelists", CFG.nodelists); add_webtable(wp, (char *)"Unsafe inbound", CFG.inbound); @@ -1858,9 +1848,6 @@ int global_doc(FILE *fp, FILE *toc, int page) fprintf(wp, "Top\n"); fprintf(wp, "
\n"); addtoc(fp, toc, 1, 5, page, (char *)"Pathnames"); - fprintf(fp, " Menufiles %s\n", CFG.bbs_menus); - fprintf(fp, " Textfiles %s\n", CFG.bbs_txtfiles); - fprintf(fp, " Macros %s\n", CFG.bbs_macros); fprintf(fp, " Users homedirs %s\n", CFG.bbs_usersdir); fprintf(fp, " Nodelists %s\n", CFG.nodelists); fprintf(fp, " Unsafe inbound %s\n", CFG.inbound); diff --git a/mbsetup/m_lang.c b/mbsetup/m_lang.c index 94fcb9d9..a0b3a5ae 100644 --- a/mbsetup/m_lang.c +++ b/mbsetup/m_lang.c @@ -4,7 +4,7 @@ * Purpose ...............: Setup Languages. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -43,15 +43,12 @@ int LangUpdated = 0; void AddLang(char *, char *, char *, FILE *); -void AddLang(char *Name, char *Key, char *Path, FILE *fil) +void AddLang(char *Name, char *Key, char *lc, FILE *fil) { memset(&lang, 0, sizeof(lang)); snprintf(lang.Name, 30, "%s", Name); snprintf(lang.LangKey, 2, "%s", Key); - snprintf(lang.MenuPath, 81, "%s/%s/menus", getenv("MBSE_ROOT"), Path); - snprintf(lang.TextPath, 81, "%s/%s/txtfiles", getenv("MBSE_ROOT"), Path); - snprintf(lang.MacroPath, 81, "%s/%s/macro", getenv("MBSE_ROOT"), Path); - snprintf(lang.Filename, 81, "%s.lang", Path); + snprintf(lang.lc, 10, "%s", lc); lang.Available = TRUE; fwrite(&lang, sizeof(lang), 1, fil); } @@ -79,13 +76,13 @@ int CountLanguage(void) /* * Setup default records */ - AddLang((char *)"English", (char *)"E", (char *)"english", fil); count++; - AddLang((char *)"Nederlands", (char *)"N", (char *)"dutch", fil); count++; - AddLang((char *)"Spanish", (char *)"S", (char *)"spanish", fil); count++; - AddLang((char *)"Galego", (char *)"G", (char *)"galego", fil); count++; - AddLang((char *)"Deutsch", (char *)"D", (char *)"german", fil); count++; - AddLang((char *)"French", (char *)"F", (char *)"french", fil); count++; - AddLang((char *)"Chinese", (char *)"C", (char *)"chinese", fil); count++; + AddLang((char *)"English", (char *)"E", (char *)"en", fil); count++; + AddLang((char *)"Nederlands", (char *)"N", (char *)"nl", fil); count++; + AddLang((char *)"Spanish", (char *)"S", (char *)"es", fil); count++; + AddLang((char *)"Galego", (char *)"G", (char *)"gl", fil); count++; + AddLang((char *)"Deutsch", (char *)"D", (char *)"de", fil); count++; + AddLang((char *)"French", (char *)"F", (char *)"fr", fil); count++; + AddLang((char *)"Chinese", (char *)"C", (char *)"zh", fil); count++; fclose(fil); chmod(ffile, 0640); @@ -104,6 +101,80 @@ int CountLanguage(void) +void UpgradeLanguage(char *name, char *lc) +{ + char *temp; + int rc; + + temp = calloc(PATH_MAX, sizeof(char)); + snprintf(temp, PATH_MAX, "%s/share/foo", getenv("MBSE_ROOT")); + mkdirs(temp, 0770); + snprintf(temp, PATH_MAX, "%s/share/int/foo", getenv("MBSE_ROOT")); + mkdirs(temp, 0770); + + if (strstr(lang.xMenuPath, name)) { + snprintf(lang.lc, 10, "%s", lc); + + /* + * Now build old and new paths of the language files. + */ + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s", getenv("MBSE_ROOT"), lc); + if (strcmp(lang.xMenuPath, temp)) { + mkdirs(temp, 0770); + rc = rename(lang.xMenuPath, temp); + if (rc) { + WriteError("$Can't move %s to %s", lang.xMenuPath, temp); + } else { + Syslog('+', "Moved %s to %s", lang.xMenuPath, temp); + snprintf(lang.xMenuPath, PATH_MAX, temp); + } + } else { + Syslog('+', "%s already upgraded", temp); + } + + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s", getenv("MBSE_ROOT"), lc); + if (strcmp(lang.xTextPath, temp)) { + mkdirs(temp, 0770); + rc = rename(lang.xTextPath, temp); + if (rc) { + WriteError("$Can't move %s to %s", lang.xTextPath, temp); + } else { + Syslog('+', "Moved %s to %s", lang.xTextPath, temp); + snprintf(lang.xTextPath, PATH_MAX, temp); + } + } else { + Syslog('+', "%s already upgraded", temp); + } + + snprintf(temp, PATH_MAX, "%s/share/int/macro/%s", getenv("MBSE_ROOT"), lc); + if (strcmp(lang.xMacroPath, temp)) { + mkdirs(temp, 0770); + rc = rename(lang.xMacroPath, temp); + if (rc) { + WriteError("$Can't move %s to %s", lang.xMacroPath, temp); + } else { + Syslog('+', "Moved %s to %s", lang.xMacroPath, temp); + snprintf(lang.xMacroPath, PATH_MAX, temp); + } + } else { + Syslog('+', "%s already upgraded", temp); + } + + snprintf(temp, PATH_MAX, "%s/%s", getenv("MBSE_ROOT"), name); + rc = rmdir(temp); + if (rc) { + WriteError("$Can't remove %s", temp); + } else { + Syslog('+', "Removed directory %s", temp); + } + + } + + free(temp); +} + + + /* * Open database for editing. The datafile is copied, if the format * is changed it will be converted on the fly. All editing must be @@ -143,6 +214,25 @@ int OpenLanguage(void) */ memset(&lang, 0, sizeof(lang)); while (fread(&lang, oldsize, 1, fin) == 1) { + if (strlen(lang.lc) == 0) { + if (strstr(lang.xMenuPath, (char *)"english")) { + UpgradeLanguage((char *)"english", (char *)"en"); + } else if (strstr(lang.xMenuPath, (char *)"german")) { + UpgradeLanguage((char *)"german", (char *)"de"); + } else if (strstr(lang.xMenuPath, (char *)"dutch")) { + UpgradeLanguage((char *)"dutch", (char *)"nl"); + } else if (strstr(lang.xMenuPath, (char *)"spanish")) { + UpgradeLanguage((char *)"spanish", (char *)"es"); + } else if (strstr(lang.xMenuPath, (char *)"galego")) { + UpgradeLanguage((char *)"galego", (char *)"gl"); + } else if (strstr(lang.xMenuPath, (char *)"french")) { + UpgradeLanguage((char *)"french", (char *)"fr"); + } else if (strstr(lang.xMenuPath, (char *)"chinese")) { + UpgradeLanguage((char *)"chinese", (char *)"zh"); + } else { + WriteError("Unknown language \"%s\", please update manually", lang.Name); + } + } fwrite(&lang, sizeof(lang), 1, fout); memset(&lang, 0, sizeof(lang)); } @@ -232,13 +322,10 @@ void s_lang(void) set_color(CYAN, BLACK); mbse_mvprintw( 7, 2, "1. Select"); mbse_mvprintw( 8, 2, "2. Name"); - mbse_mvprintw( 9, 2, "3. Menupath"); - mbse_mvprintw(10, 2, "4. Textpath"); - mbse_mvprintw(11, 2, "5. Macropath"); - mbse_mvprintw(12, 2, "6. Available"); - mbse_mvprintw(13, 2, "7. Datafile"); - mbse_mvprintw(14, 2, "8. Security"); - mbse_mvprintw(15, 2, "9. Deleted"); + mbse_mvprintw( 9, 2, "3. ISO name"); + mbse_mvprintw(10, 2, "4. Available"); + mbse_mvprintw(11, 2, "5. Security"); + mbse_mvprintw(12, 2, "6. Deleted"); } @@ -281,15 +368,12 @@ int EditLangRec(int Area) set_color(WHITE, BLACK); show_str( 7,16, 1, lang.LangKey); show_str( 8,16,30, lang.Name); - show_str( 9,16,64, lang.MenuPath); - show_str( 10,16,64, lang.TextPath); - show_str( 11,16,64, lang.MacroPath); - show_bool(12,16, lang.Available); - show_str( 13,16,24, lang.Filename); - show_sec( 14,16, lang.Security); - show_bool(15,16, lang.Deleted); + show_str( 9,16,64, lang.lc); + show_bool(10,16, lang.Available); + show_sec( 11,16, lang.Security); + show_bool(12,16, lang.Deleted); - j = select_menu(9); + j = select_menu(6); switch(j) { case 0: crc1 = 0xffffffff; crc1 = upd_crc32((char *)&lang, crc1, sizeof(lang)); @@ -311,13 +395,10 @@ int EditLangRec(int Area) return 0; case 1: E_UPS( 7,16,1, lang.LangKey, "The ^Key^ to select this language") case 2: E_STR( 8,16,30,lang.Name, "The ^name^ of this language") - case 3: E_PTH( 9,16,64,lang.MenuPath, "The ^Menus Path^ of this language", 0755) - case 4: E_PTH( 10,16,64,lang.TextPath, "The ^Textfile path^ of this language", 0755) - case 5: E_PTH( 11,16,64,lang.MacroPath,"The ^Macro template path^ if this language", 0755) - case 6: E_BOOL(12,16, lang.Available,"Is this language ^available^") - case 7: E_STR( 13,16,24,lang.Filename, "The ^Filename^ (without path) of the language datafile") - case 8: E_SEC( 14,16, lang.Security, "8.2. LANGUAGE SECURITY", s_lang) - case 9: E_BOOL(15,16, lang.Deleted, "Is this language record ^Deleted^") + case 3: E_STR( 9,16,10,lang.lc, "The ^ISO name^ of this language") + case 4: E_BOOL(10,16, lang.Available,"Is this language ^available^") + case 5: E_SEC( 11,16, lang.Security, "8.2. LANGUAGE SECURITY", s_lang) + case 6: E_BOOL(12,16, lang.Deleted, "Is this language record ^Deleted^") } } @@ -501,7 +582,7 @@ int bbs_lang_doc(FILE *fp, FILE *toc, int page) while ((fread(&lang, langhdr.recsize, 1, no)) == 1) { - if (j == 5) { + if (j == 6) { page = newpage(fp, page); fprintf(fp, "\n"); j = 0; @@ -518,16 +599,14 @@ int bbs_lang_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)"Language key", lang.LangKey); add_webtable(wp, (char *)"Language name", lang.Name); add_webtable(wp, (char *)"Available", getboolean(lang.Available)); - add_webtable(wp, (char *)"Menu path", lang.MenuPath); - add_webtable(wp, (char *)"Textfiles path", lang.TextPath); - add_webtable(wp, (char *)"Macrofiles path", lang.MacroPath); - add_webtable(wp, (char *)"Language file", lang.Filename); + add_webtable(wp, (char *)"ISO name", lang.lc); web_secflags(wp, (char *)"Security level", lang.Security); fprintf(wp, "\n"); fprintf(wp, "
\n"); fprintf(wp, "
\n"); fprintf(wp, "

Menu files

\n"); - if ((dp = opendir(lang.MenuPath))) { + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s", getenv("MBSE_ROOT"), lang.lc); + if ((dp = opendir(temp))) { while ((de = readdir(dp))) { if (de->d_name[0] != '.') { fprintf(wp, "%s
\n", de->d_name); @@ -537,7 +616,8 @@ int bbs_lang_doc(FILE *fp, FILE *toc, int page) } fprintf(wp, "
\n"); fprintf(wp, "

Text files

\n"); - if ((dp = opendir(lang.TextPath))) { + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s", getenv("MBSE_ROOT"), lang.lc); + if ((dp = opendir(temp))) { while ((de = readdir(dp))) { if (de->d_name[0] != '.') { fprintf(wp, "%s
\n", de->d_name); @@ -547,7 +627,8 @@ int bbs_lang_doc(FILE *fp, FILE *toc, int page) } fprintf(wp, "
\n"); fprintf(wp, "

Macro template files

\n"); - if ((dp = opendir(lang.MacroPath))) { + snprintf(temp, PATH_MAX, "%s/share/int/macro/%s", getenv("MBSE_ROOT"), lang.lc); + if ((dp = opendir(temp))) { while ((de = readdir(dp))) { if (de->d_name[0] != '.') { fprintf(wp, "%s
\n", de->d_name); @@ -561,10 +642,7 @@ int bbs_lang_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Language key %s\n", lang.LangKey); fprintf(fp, " Language name %s\n", lang.Name); fprintf(fp, " Available %s\n", getboolean(lang.Available)); - fprintf(fp, " Menu path %s\n", lang.MenuPath); - fprintf(fp, " Textfiles path %s\n", lang.TextPath); - fprintf(fp, " Macrofiles path %s\n", lang.MacroPath); - fprintf(fp, " Language file %s\n", lang.Filename); + fprintf(fp, " ISO name %s\n", lang.lc); fprintf(fp, " Security level %s\n", get_secstr(lang.Security)); fprintf(fp, "\n\n"); j++; diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index 70b5219d..0f14394d 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -4,7 +4,7 @@ * Purpose ...............: Edit BBS menus * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -316,10 +316,10 @@ void EditMenu(char *Name) IsDoing("Edit Menu"); working(1, 0, 0); - snprintf(mtemp, PATH_MAX, "%s/%s.tmp", lang.MenuPath, Name); + snprintf(mtemp, PATH_MAX, "%s/share/int/menus/%s/%s.tmp", getenv("MBSE_ROOT"), lang.lc, Name); tmp = fopen(mtemp, "w+"); - snprintf(temp, PATH_MAX, "%s/%s.mnu", lang.MenuPath, Name); + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s/%s.mnu", getenv("MBSE_ROOT"), lang.lc, Name); if ((fil = fopen(temp, "r")) != NULL) { while (fread(&menus, sizeof(menus), 1, fil) == 1) { fwrite(&menus, sizeof(menus), 1, tmp); @@ -378,7 +378,7 @@ void EditMenu(char *Name) if (MenuUpdated) { if (yes_no((char *)"Menu is changed, save changes") == 1) { working(1, 0, 0); - snprintf(temp, PATH_MAX, "%s/%s.mnu", lang.MenuPath, Name); + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s/%s.mnu", getenv("MBSE_ROOT"), lang.lc, Name); if ((fil = fopen(temp, "w+")) == NULL) { working(2, 0, 0); } else { @@ -497,7 +497,7 @@ void EditMenus(void) DIR *dp; FILE *fil; struct dirent *de; - char menuname[50][11], temp[81], pick[12], *p; + char menuname[50][11], temp[PATH_MAX], pick[12], *p; Syslog('+', "Start menu edit"); memset(&menuname, 0, sizeof(menuname)); @@ -508,7 +508,9 @@ void EditMenus(void) for (;;) { clr_index(); mcount = 0; - if ((dp = opendir(lang.MenuPath)) != NULL) { + + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s", getenv("MBSE_ROOT"), lang.lc); + if ((dp = opendir(temp)) != NULL) { working(1, 0, 0); while ((de = readdir(dp))) { @@ -551,7 +553,9 @@ void EditMenus(void) memset(&temp, 0, sizeof(temp)); strcpy(temp, edit_str(LINES -3, 22, 10, temp, (char *)"Enter a new ^menu^ name without extension")); if (strlen(temp)) { - p = xstrcpy(lang.MenuPath); + p = xstrcpy(getenv("MBSE_ROOT")); + p = xstrcat(p, (char *)"/share/int/menus/"); + p = xstrcat(p, lang.lc); p = xstrcat(p, (char *)"/"); p = xstrcat(p, temp); p = xstrcat(p, (char *)".mnu"); @@ -606,12 +610,13 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page) fprintf(ip, "

BBS Menus for %s

\n", lang.Name); fprintf(ip, "
    \n"); - if ((dp = opendir(lang.MenuPath)) != NULL) { + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s", getenv("MBSE_ROOT"), lang.lc); + if ((dp = opendir(temp)) != NULL) { while ((de = readdir(dp))) { if (de->d_name[0] != '.') { j = 0; fprintf(ip, "
  • %s
  • \n", lang.LangKey, de->d_name, de->d_name); - snprintf(temp, PATH_MAX, "%s/%s", lang.MenuPath, de->d_name); + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s/%s", getenv("MBSE_ROOT"), lang.lc, de->d_name); fprintf(fp, "\n MENU %s (%s)\n\n", de->d_name, lang.Name); if ((mn = fopen(temp, "r")) != NULL) { snprintf(temp, 81, "menu_%s_%s.html", lang.LangKey, de->d_name); diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c index e6759aa8..d6f0dfcf 100644 --- a/mbtask/mbtask.c +++ b/mbtask/mbtask.c @@ -158,7 +158,7 @@ void load_maincfg(void) snprintf(CFG.logfile, 15, "system.log"); snprintf(CFG.error_log, 15, "error.log"); snprintf(CFG.default_menu, 15, "main.mnu"); - snprintf(CFG.current_language, 15, "english.lang"); + snprintf(CFG.deflang, 10, "en"); snprintf(CFG.chat_log, 15, "chat.log"); snprintf(CFG.welcome_logo, 15, "logo.asc"); snprintf(CFG.mgrlog, 15, "manager.log"); @@ -167,9 +167,6 @@ void load_maincfg(void) /* * Fill Global defaults */ - snprintf(CFG.bbs_menus, 65, "%s/english/menus", getenv("MBSE_ROOT")); - snprintf(CFG.bbs_txtfiles, 65, "%s/english/txtfiles", getenv("MBSE_ROOT")); - snprintf(CFG.bbs_macros, 65, "%s/english/macro", getenv("MBSE_ROOT")); snprintf(CFG.bbs_usersdir, 65, "%s/home", getenv("MBSE_ROOT")); snprintf(CFG.nodelists, 65, "%s/var/nodelist", getenv("MBSE_ROOT")); snprintf(CFG.inbound, 65, "%s/var/unknown", getenv("MBSE_ROOT")); diff --git a/mbtask/taskdisk.c b/mbtask/taskdisk.c index dc6c4fae..51d940cd 100644 --- a/mbtask/taskdisk.c +++ b/mbtask/taskdisk.c @@ -4,7 +4,7 @@ * Purpose ...............: Give status of all filesystems * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2007 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -472,8 +472,6 @@ void diskwatch(void) tidy_mfslist(&mfs); add_path(getenv("MBSE_ROOT")); - add_path(CFG.bbs_menus); - add_path(CFG.bbs_txtfiles); add_path(CFG.alists_path); add_path(CFG.req_magic); add_path(CFG.bbs_usersdir); @@ -482,7 +480,6 @@ void diskwatch(void) add_path(CFG.pinbound); add_path(CFG.outbound); add_path(CFG.ftp_base); - add_path(CFG.bbs_macros); add_path(CFG.out_queue); add_path(CFG.rulesdir); add_path(CFG.tmailshort); @@ -522,9 +519,12 @@ void diskwatch(void) while (fread(&lang, langhdr.recsize, 1, fp)) { if (lang.Available) { - add_path(lang.MenuPath); - add_path(lang.TextPath); - add_path(lang.MacroPath); + snprintf(temp, PATH_MAX, "%s/share/int/menus/%s", getenv("MBSE_ROOT"), lang.lc); + add_path(temp); + snprintf(temp, PATH_MAX, "%s/share/int/txtfiles/%s", getenv("MBSE_ROOT"), lang.lc); + add_path(temp); + snprintf(temp, PATH_MAX, "%s/share/int/macro/%s", getenv("MBSE_ROOT"), lang.lc); + add_path(temp); } } fclose(fp);