home *** CD-ROM | disk | FTP | other *** search
- -- LINGUA -- MULTILANGUAGE SUPPORT FOR YOUR PROGRAMS -- SHAREWARE --
-
- The LINGUA package is designed to help C-programmers to develop applications
- that must be released in multiple languages. The end user gets a program
- plus one or more datafiles containing all text in the program. One
- datafile for each different language. A language can be chosen at
- run time. This thus avoids different .exe files for different languages.
- The programmer needs only to compile one executable and to make a text data
- file for every supported language. It's also easy to afterwards create
- support for yet another language and send the data file to interested
- customers.
-
-
- HOW IT WORKS
-
- The package consists of a program, LINGUA, and a module, UI_TEXT (UI
- stands for User Interface). The module should be compiled and linked with
- your application program. This module is the same for any language and
- is very small (about 2KB). For every supported language a text file is
- prepared by the programmer according to a specified format. This text
- file is then encrypted by LINGUA, so users cannot alter and perhaps corrupt
- it just by editing it. These encrypted text files are shipped with
- the application and one of them is loaded by the module UI_TEXT at run
- time so the application speaks the desired language.
-
-
- FILES IN THE PACKAGE
-
- LINGUA.DOC You're reading it
- LINGUA.EXE Utility to encrypt .TXT file to .ETF file
- LINGUA.C Source of the above
- UI_TEXT.OBJ Module to be linked with your application (small model)
- UI_TEXT.C Source of the above
- LINGDEMO.EXE Small demo program, usage e.g.: lingdemo francais
- LINGDEMO.C Source of the above
- ENGLISH.TXT Text files for demo program
- FRANCAIS.TXT
- DEUTSCH.TXT
- NL.TXT
- ENGLISH.ETF Encrypted files for demo program
- DEUTSCH.ETF
- FRANCAIS.ETF
- NL.ETF
- UI_TEXT.H Header file created by LINGUA from .txt files above
-
-
- USAGE
-
- First of all, do not use ANY literal strings in your C-source, but
- always use identifiers, e.g. not "Press any key" but ANYKEY.
- Write your program in any way you like while observing this main rule.
-
- At the same time create and maintain a text file with all literal
- text for the program in your native language. This file may have any
- name but its extension should be .TXT for use by LINGUA. The lines in
- this text file should all begin (at the first position!) with an identifier,
- corresponding to the identifiers used in the program. Behind the identifier
- follows the literal string that should be used in run time. Comment lines
- are allowed, they must begin with #. In the literal strings _ signifies
- a leading or trailing space, and - denotes an empty string. String arrays,
- in which not every item has its own name, are represented by [ after an
- identifier's name followed by one or more lines starting with only [.
-
- Example file english.txt:
-
- #english.txt
- #empty string
- ZEROTH -
- #normal strings
- FIRST one
- SECOND two times
- #array of five items
- THIRD[ three
- [ four
- [ five
- [ -
- [ seven
- #leading and trailing spaces
- EIGHTH __eight__
- #that's it!
- NINTH nine
-
- Whenever any identifier in this text file has been added/edited/deleted,
- run the utility LINGUA, like:
-
- lingua english
-
- and recompile (like you would also have to do if you had edited
- literal strings in your source code).
-
- LINGUA creates two files: english.etf and ui_text.h (ETF stands for
- Encrypted Text File). The header file UI_TEXT.H must be included in the
- source file that takes care of the loading and unloading of the text
- at run time. Since this header is not language dependent, no
- recompilation for another language is necessary. It contains only
- defines for all identifiers as show below.
-
- Example file ui_text.h:
-
- /* UI_TEXT.H */
-
- void ui_loadtext(char *fname,char *vers);
- void ui_unloadtext(void);
- extern char **ui_text;
-
- #define ZEROTH ui_text[0]
- #define FIRST ui_text[1]
- #define SECOND ui_text[2]
- #define THIRD (ui_text+3)
- #define EIGHTH ui_text[8]
- #define NINTH ui_text[9]
-
- When your application is finished, make a copy of the original .TXT
- file and change the literal strings in the copy to another language.
- Be careful not to change the identifiers at the start of every line though!
- When you run LINGUA on this text file a new .ETF file is created
- (and also a ui_text.h, but this one is identical to the one in the
- original language).
-
- In the application program, start with a call to ui_loadtext (in
- the UI_TEXT module). End the application program with a call to
- ui_unloadtext. Another language may be loaded at that point too.
-
- Example file lingdemo.c (link with ui_text.c):
-
- #include <stdio.h>
- #include "ui_text.h"
-
- int main(int argc,char *argv[])
- {
- char filename[81],version[81];
-
- if (argc>3) return 1;
- if (argc==3) strcpy(version,argv[2]); else version[0]='\0';
- if (argc>=2) strcpy(filename,argv[1]); else strcpy(filename,"english");
-
- ui_loadtext(filename,version);
- printf("%s%s%s%s%s%s%s%s%s",
- FIRST,SECOND,
- THIRD[0],THIRD[1],THIRD[2],THIRD[3],THIRD[4],
- EIGHTH,NINTH);
- ui_unloadtext();
- return 0;
- }
-
- Execute this example program by:
-
- lingdemo <name of etf-file without extension>
-
- e.g.:
-
- lingdemo english
-
- If so desired an optional version number (or other string) may be
- given as second argument for the LINGUA utility. This same version
- number should then be used as the second parameter in the call
- to ui_loadtext. This can be useful to let ui_loadtext reject a file
- from a previous version of your application program.
-
-
- SHAREWARE NOTICE
-
- You may copy and distribute this program freely, as long as all parts
- of the package are included without modification. This is a shareware
- (NOT public domain) package; if you like it and use it on a regular
- basis please register it. Registration can be done at no charge by
- sending me a picture postcard from were you live or work. Suggestions
- for improvement are welcomed any time. Please do NOT modify the source
- code and pass that on. Send modified source code to me and I will
- include your modification, if I consider it useful, in a future release.
-
- COMMERCIAL USERS -MUST- REGISTER AND SHOULD MENTION THE USE OF LINGUA
- IN THEIR DOCUMENTATION: LINGUA (C) SICHEMSOFT, WAGENINGEN, NETHERLANDS.
-
- I hope many people, programmers and users alike, will benefit from LINGUA!
-
- Anneke Sicherer-Roetman
- Roghorst 160
- 6708 KS Wageningen
- Netherlands
- email: anneke@ruucv1.chem.ruu.nl
- anneke@hutruu54.bitnet