FHS 97 - Language Customization


Some Background
Over the years that I have been writing these programs, one of the more surprising results has been their acceptance by persons whose native language is not English. Many of these users have expressed a desire to be able to at least produce reports with headings, titles and labels in their own language. To accomodate the customization of the software, a compressed version of the source code for the programs was made available to individuals who wanted to undertake the task, and some of these modified versions of the basic set of programs have appeared in German, Swedish, Finnish, and perhaps other languages. One user had even been given permission to revise the extended version of the programs and offer it to registered users of the programs. But I have long promised to make changes to the software that would make it easier to customize it for such users.

What I wanted to do was remove all language specific items to separate files, outside the programs, and provide program support for modifying the contents of those files. The programs would read the necessary information from the files at "run time" making it possible to easily switch between different languages with a single set of programs.

I actually spent about 6 months preliminary work on the task in 1992, before the Jan 93 update to the software was complete, but wasn't able to get back to work on it until the middle of 1993. It has involved a near complete rewrite of the programs, converting them from the old BASICA or GWBASIC language to Microsoft Professional Basic 7.1 (which at this time is almost as "dead" a language as GWBASIC). In the process, the programs have become very much "table driven", with most of the tables being user customizable.

FHS Language Files
The new update to FHS employs four "language files" to hold customization information relating to the language being used. Three of these relate to the language of the user of the programs, and the fourth relates to the language of the person receiving the reports.

These files are:

  1. the TABLES file - FHSTABLE.TDF - containing among other items:
    • a SOUNDEX table for customizing the Soundex routine for special characters
    • a UCTRAN table for providing upper-case translations for special characters
    • a SNGLKEY table for providing Single Key responses to program messages (some people would prefer "O"ui to "Y"es for an affirmative response to queries)
  2. the Screen Format file - FHSSFMTS.SDF - containing the definitions for all screen formats used by the programs, including, of course, the text of all literals appearing on the screen (at this time, with about 3/4ths of the programs written, this file has 240 screen formats in it);
  3. the Messages file - FHSMSGS.MDF - containing the text of all program messages (this file also has the default message response that will be passed to the program if the user simply taps the space bar or presses the enter key);
  4. the Report Definition file - FHSRPTS.RDF - containing information for formatting reports, including:
    • Report TABLES:
      • MONTHS - providing 3 character abbreviations for month names
      • GENDER - providing sex codes that appear in reports
      • RELATION - providing relationship labels that appear in reports
      • REFERENC - providing codes used for types of references appearing in report/chart indexes
    • Report VARIABLES - which are miscellaneous special words or phrases that are used in reports. For example: STDHDLN, STDFTLN are variables that are used as Standard Heading Lines and Standard Footing Lines in most reports, and COPYRITE is a variable giving the format for a line that may be printed at the bottom of report pages
    • Report FIELDS - which are tables providing abbreviations, column headings, or labels for family file data items that appear in reports and charts
    • Individual Report Definitions - which include default settings for report options and formatting specifications for report Headings, Titles and Footings

The first three of these tables provide support for language customizations for the person who is using the software. The fourth provides support for customizatization according to the language of the person receiving reports. Multiple sets of these language files can coexist in the FHS program directory (where they must reside); the different language files are distinguished by the first three characters of the file name. The particular language files that will be used when an FHS work session begins are identified by using FHS Configuration File settings, or DOS Environment variable settings, and language files can be switched during an FHS session.

Modifying Language Files
Main Menu option F3-B is used to customize these language files through program sub-options:


The following paragraphs indicate how each of these customization options work.

TABLES - Use Up/Down arrow keys to choose a table and then press Enter to display the contents of the table. Use Up/Down keys to choose a Table entry and then press the Enter key to make changes to that entry. Press the Enter key again to end the update, and press the ESCape key to return to the list of tables. Use F6 to print a report of table information and F1 to save the changes in an appropriately named language file.

SCREEN FORMATS - The screen formats are grouped by FHS program type, identified by a four character code and descriptive label. There is also an "XXXX" group of formats that are used by multiple programs. Select a format group by using the Up/Down/Enter keys. A list of formats in the group will be shown. Use Up/Down/Enter to select a format. The field descriptions will be shown including the location on the screen, the length, and default text. Pressing the F7 key will show how the format appears on the screen. Use the Up/Down/Enter keys to select a field whose text you wish to modify, make changes, and then press the Enter key to complete the change. (Pressing ALT+Enter will allow you to modify the location of the field on the screen as well...Pressing the CTRL+F1 keys places you in "Master Edit" mode, which gives you full update privileges. This option should be used with caution.) Program option F6 allows you to print a report of screen format definitions, and option F1 allows you to Save all changes to an appropriately named file.

MESSAGES - Messages are also grouped by FHS program type. Use Up/Down/Enter to select a message group, then use Up/Down/Enter again to select a message whose text is to be changed. Press Enter when the change is complete, and press the ESCape key to return to the list of message groups. Option F6 produces a report of message information. Option F1 allows you to save all changes in a file. (Note: portions of some messages are contained in square brackets; e.g. "[NVAR1]". This represents a dynamic "System Variable" which will be replaced by a program supplied value when the message is displayed. These parts of the messages should not be changed.)

REPORT DEFINITIONS - Each report description consists of several components as well. These include:

Within the program that customizes report definitions, option F6 can be used to print a report of "report definitions". Again, option F1 is used to Save any changes in an appropriately named file.

USING FHS LANGUAGE ENVIRONMENT VARIABLES
The prefixes that are to be used for the language files at the start of an FHS session are saved in the configuration file: FHSCONFG.CFG. However you can override these values using the DOS SET command before starting an FHS session. The format for setting the FHSLANG Environment variable is:

SET FHSLANG=ddd:ttt:sss:mmm:rrr

where:

For Example:
  1. SET FHSLANG=FRN::::GMN will use language files: FRNTABLE.TDF, FRNSFMTS.SDF, FRNMSGS.MDF and GMNRPTS.RDF
  2. SET FHSLANG=FHS::XYZ will use language files: FHSTABLE.TDF, XYZSFMTS.SDF, FHSMSGS.MDF and FHSRPTS.RDF