home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / DEMO510.ZIP / LANGUAGE.INS / LANGUAGE.DOC next >
Text File  |  1999-01-25  |  14KB  |  280 lines

  1.            -----------------------------------------------
  2.                           Searchlight BBS
  3.                   Language File Format and Editing
  4.            -----------------------------------------------
  5.  
  6.  
  7. INTRODUCTION ........................................................
  8.  
  9.     Beginning with verison 4.0, Searchlight BBS uses external files to 
  10. contain all of the text strings and messages used online.  The default 
  11. language file, DEFAULT.LNG, is included with Searchlight; other language 
  12. files can be obtained.  This document shows you how to create your own 
  13. language files by modifying the default language.
  14.  
  15.     If you are familiar with earlier versions of Searchlight, the 
  16. DEFAULT.LNG file replaces the STRINGS.SYS file.  The physical format of 
  17. DEFAULT.LNG is exactly the same as STRINGS.SYS, so you can use existing 
  18. utilities that operate on STRINGS.SYS with DEFAULT.LNG.  Searchlight 4.0 
  19. adds many new entries to the file, including entries for internal menus 
  20. which were previously hard-coded and could not be modified.  
  21.  
  22.     Note that language files contain only the messages normally displayed 
  23. to callers.  They do not contain messages that appear on the local console, 
  24. such as the messages from the CONFIG program or file transfer status 
  25. screens.  
  26.  
  27.  
  28. A WORD TO THE WISE ..................................................
  29.  
  30.     Before you make any changes to your DEFAULT.LNG file, be sure you have 
  31. a safe back-up copy of the original.  In the event that you make any 
  32. mistakes, you will need your original DEFAULT.LNG file to restore your 
  33. system to normal operation.  Also, you will need your original DEFAULT.LNG 
  34. file if you wish to port your changes to future releases of SLBBS.  
  35.  
  36.     Searchlight contains a facility for managing multiple languages.  
  37. Rather than change your default language file, you may wish to copy the 
  38. default file, modify the copy, and enter it as a new language choice in 
  39. your configuration.  See your manual for more information.  
  40.  
  41.     Any changes you make to the strings in the DEFAULT.LNG file must be 
  42. done with regard to the context in which the string appears in Searchlight.  
  43. While the DEFAULT.LNG file allows you to change string lengths, many 
  44. strings used by Searchlight contain leading or trailing spaces and must be 
  45. maintained at a certain fixed string length.  For example, strings which 
  46. form headings should not be shortened or lengthened.  Many strings, such as 
  47. menu description strings, have a maximum length that allows them to be 
  48. displayed in a particular format on the screen.  When changing any string, 
  49. examine its context in the program and related strings to make sure that 
  50. you do not exceed the maximum allowable width.  
  51.  
  52.     All language file editing is done AT YOUR OWN RISK.  We cannot 
  53. guarantee that Searchlight will operate correctly with any *.LNG file other 
  54. than the original file provided or alternate language files obtained from 
  55. us, nor can we guarantee that your changes will be compatible with future 
  56. versions of SLBBS (although we will do our best to see that they are).  
  57.  
  58.  
  59. UNPACKING THE LANGUAGE FILE: XSYS.EXE ..............................
  60.  
  61.     The program XSYS.EXE 'unpacks' a language data file into a plain-text 
  62. file that can be edited by your word processor or text editor.  To use it, 
  63. type 'XSYS.EXE <languagefle> <filename>' where the <languagefile> is the 
  64. name of a language file (like DEFAULT.LNG) and <filename> is the name of a 
  65. plain text file to receive the text.  For example: 
  66.  
  67.     C> XSYS DEFAULT.LNG DEFAULT.TXT
  68.  
  69.     This command will write a text file called DEFAULT.TXT that contains 
  70. the default Searchlight language strings as plain text.  By examining 
  71. DEFAULT.TXT with your word processor, you will discover a series of lines 
  72. which look like this: 
  73.  
  74.     10 'Searchlight BBS DOS Shell -- Type EXIT to return to SLBBS'
  75.     11 'Enter Filename:'
  76.     12 'Can't open file $'
  77.     13 '--- Log Open at '
  78.     14 '    Online: $'
  79.     15 'Message from $ on line $'
  80.  
  81.     The format consists of a line number, followed by a space and a line of 
  82. text contained within single quote marks.  The single quotes are not 
  83. absolutely neccesary, but they are provided so that lines with trailing 
  84. spaces (such as line #13 above) will be clearly shown and will not be 
  85. truncated (many word processors truncate trailing spaces).  
  86.  
  87.     Line numbers are not continuous.  This is done deliberately to 
  88. facilitate expansion of the language file.  Messages are generally grouped 
  89. in the order that they appear in Searchlight, although this is not always 
  90. the case.  Finally, replaceable parameters are implemented in some strings 
  91. via the '$' character.  Upon printing these strings, Searchlight replaces 
  92. the '$' with an actual name, number or other value.  For example, in string 
  93. #15, the username and node number of the station sending a message is 
  94. substituted into the string before it is printed.  
  95.  
  96.     To change messages, edit your 'plain text' file with any ASCII word 
  97. processor.  If using a Wordstar-type editor, be sure to select 'non-
  98. document' mode.  In general, simple word processers or program editors are 
  99. best used as these will not introduce any unwanted characters into the 
  100. data.  
  101.  
  102.     When making changes, do not change or add line numbers and do not add 
  103. or remove '$' characters from strings.  While you can change the position 
  104. of '$' characters if you wish, you cannot change the order in which 
  105. parameters will appear in strings containing more than one '$'.  As 
  106. mentioned above, many strings are formatted to a particular length and it 
  107. is best to leave these the same length.  In some cases you may change an 
  108. entire group of strings to a different length.  However, you cannot change 
  109. the format with which Searchlight displays actual listings and data, so I 
  110. suggest that you do not try to change list headings, etc.  The maximum 
  111. length of most strings should not normally exceed 80 characters (a few 
  112. strings contain color codes and are longer than 80 characters).  
  113.  
  114.     It's worth noting that you can insert any additional, non-numbered 
  115. lines into the source text as comments.  The MSYS program reads only 
  116. numbered lines, and will ignore anything else.  
  117.  
  118.  
  119. REPACKING THE LANGUAGE FILE: MSYS.EXE ...............................
  120.  
  121.     Once you have made the desired changes to the 'plain text' copy of the 
  122. strings, you'll will need to convert the source text back into a language 
  123. file for Searchlight to use.  To do that, use the MSYS program provided by 
  124. typing 'MSYS <filename> <languagefile>', where <filename> is the name of 
  125. your plain-text file and <languagefile> is the name of a language file 
  126. (like DEFAULT.LNG).  For example, type 
  127.  
  128.     C> MSYS DEFAULT.TXT DEFAULT.LNG
  129.  
  130. to regenerate DEFAULT.LNG from the DEFAULT.TXT file used in the above 
  131. example.  Run Searchlight and check that your string changes have been 
  132. installed.  
  133.  
  134.     MSYS.EXE requires the input file to be in numerical order, and will 
  135. abort if it finds unordered lines in the input.  If you end up with an out 
  136. of order file, you can sort it with the DOS SORT command before repacking 
  137. it with MSYS.  
  138.  
  139.     To create more changes in the future, simply edit your plain text file 
  140. again and run MSYS as required to regenerate the new language file.  
  141.  
  142.  
  143. UPGRADING TO NEW VERSIONS OF SEARCHLIGHT ..........................
  144.  
  145.     Each new version of Searchlight will likely contain a newly revised 
  146. DEFAULT.LNG file.  In order to maintain your customizations across 
  147. versions, we recommend the following procedure: 
  148.  
  149.     - Unpack the ORIGINAL, unmodified DEFAULT.LNG files from the old and 
  150. new versions of Searchlight to separate files.  Use a file compare utility 
  151. to pinpoint the differences between the two files.  
  152.  
  153.     - Take any NEW strings that appear in the newer copy of DEFAULT.LNG and 
  154. merge them into your modified plain-text strings file.  Examine any CHANGED 
  155. strings between the versions and replace the old version of the string with 
  156. the new.  Finally, delete any strings which no longer appear in the new 
  157. language file.  
  158.  
  159.     - Use MSYS to repack your custom language file.  Never attempt to run 
  160. any new version of Searchlight with an old language file until you update 
  161. the old file.  
  162.  
  163.  
  164. NOTES AND TIPS ......................................................
  165.  
  166.     o You cannot add your own colors to the internal Searchlight strings, 
  167. nor can you change the default colors with which strings and parameters are 
  168. shown (except of course by changing your color settings in the CONFIG 
  169. program).  
  170.  
  171.     o Strings used as choices on Options menus are expressed as 
  172. 'Choice1/Choice2/Choice3' etc.  These may be editied if desired, but do not 
  173. change the number of choices in the string.  
  174.  
  175.     o Some strings, in particular 'Yes/No' option strings and other short, 
  176. common messages, are used in many different places in the program.  By 
  177. changing these strings, you affect every part of the program in which they 
  178. appear.
  179.  
  180.     o Strings for internal menus (like the menu that appears following a 
  181. message or the new user menu) appear in a format that looks like this:
  182.  
  183.     311 Reply/R/R/Reply to this message
  184.  
  185. The string is divided into four sections: text of the command, the command 
  186. hotkey, the internal command letter, and a description (some commands of 
  187. this type lack the description).  If you want to edit a string of this 
  188. type, you can change the command, hotkey and description.  Never change the 
  189. internal command letter, otherwise the command will not work.  For example, 
  190. if we wanted to change 'Reply' to 'Answer' and make 'A' the function 
  191. hotkey, we could change this line to read: 
  192.  
  193.     311 Answer/A/R/Answer this message
  194.  
  195. Notice that the internal command letter (R) remains the same.  Callers will 
  196. never see the internal command letter, however.  
  197.  
  198. You can remove commands from a particular internal menu by blanking the 
  199. string that controls the command.  For example, if you wanted to eliminate 
  200. the Reply command from the choices following a message, you could blank 
  201. string number 311.  You cannot add new choices to an internal menu.  
  202.  
  203. Here is another example of a correct modification:
  204.  
  205.   Original line: 1050 Yes/Y/Y    Translations: 1050 Sure/S/Y
  206.                                                1050 Oui/O/Y
  207.  
  208. Notice that in each case, the hot key is changed to match the new command 
  209. word, but the internal function letter is always "Y".  
  210.  
  211. If you are familiar with pre-Searchlight 4.0 strings files, strings for 
  212. menu choices can generally be found at the same location in the language 
  213. file as the descriptions of the menu choices in previous versions.  Most 
  214. other new additions can be found at index locations 1040 through 1100, 
  215. including the following: 
  216.  
  217. o Data for Yes, No, Cancel and Quit choices are at locations 1049 to 1052.
  218.   Modifying these lines affects all the Yes/No/Quit prompts.
  219.  
  220. o Data for the Continue, Stop, Tag prompt appears in lines 1053-1055.
  221.  
  222. o Data for the OK box in RIP mode is on line 1056. (In general, RIP mode 
  223.   uses the same string numbers as ANSI mode for the same functions, so
  224.   modifying the strings once is good for both modes. However, be sure that
  225.   new commands are short enough to fit within the RIP buttons allocated for 
  226.   them).
  227.   
  228. o The text of the "Press [Enter]" prompt is on lines 1062 & 1063.
  229.  
  230. o The text for the days of the week (Sun, Mon, Tue, etc.) is located in 
  231.   strings 1080 through 1086. These can be edited up to a maximum of 20
  232.   characters each. As with other strings of this type, be aware that 
  233.   formatting problems can occur in some displays if long strings are used.
  234.  
  235.  
  236. LANGUAGE TRANSLATIONS AND ADDITIONAL HELP ...........................
  237.  
  238.     Searchlight Software offers predefined language files for a number of 
  239. common languages. Contact us for more information, or if you need 
  240. assistance in translating the default language file for your needs.
  241.  
  242.  
  243. LANGUAGE FILE FORMAT ................................................
  244.  
  245.     You do not need to know or use the internal file format of language 
  246. files to modify them with the XSYS and MSYS utilities.  However, we discuss 
  247. the language file format here for those who wish to write their own 
  248. procedures.  
  249.  
  250.     Searchlight's language files implement a logical array of up to 2048 
  251. variable-length strings.  Each string has a fixed position in the array; 
  252. many array positions are unoccupied and thus reserved for future expansion.  
  253. Within Searchlight, strings are referenced by number only.  The language 
  254. file contains an index which allows fast, random access to the string data.  
  255.  
  256.     The language file format is extremely simple.  At the beginning of the 
  257. file there is a 2048-byte record consisting of one byte binary string 
  258. lengths for all 2048 possible strings.  The string lengths are followed 
  259. immediately by the string texts, in ascending numerical order, without 
  260. delimiters.  Unused strings are represented by zeros in the string length 
  261. table and NO text appears for these strings within the textual portion of 
  262. the file.  
  263.  
  264.     Searchlight uses language files by reading the string length table at 
  265. start-up, then computing a larger table containing the lengths and starting 
  266. address of each string.  The starting address is computed by consecutively 
  267. adding string lengths together.  At this point, any string in the file is 
  268. quickly accessed by performing a seek to its starting address, followed by 
  269. a read of the requisite number of bytes into a string buffer.  Where 
  270. parameters are concerned, subsequent processing replaces '$' characters 
  271. with the actual values from an internal stack.  
  272.  
  273.     Language files are not difficult to use and you may wish to develop 
  274. your own procedures for processing and maintaining them, especially if you 
  275. are attempting a large scale translation.  
  276.  
  277. --------------------------------------------------------------------
  278.                                                Frank LaRosa 6/27/89
  279.                                                     Updated 5/08/94
  280.