Adding Language Support: 5.0 Creating an Add-On installer

This is a template for adding support for a new language. Currently it is set up as:

         Language Name: ZZZZZZ
    Filename Extension: .ZZZ
                Prefix: Zzz   (See notes below on prefixes)
  • The new language is called ZZZZZZ
  • The file extension for this language is .ZZZ
  • The prefix used for this language is Zzz (See notes below on prefixes)
  • The code can be downloaded here

The attached zip file contains the following files which comprise the installer:

  ZZZZZZ.dat
  ZZZZZZ.del
  ZZZZZZ.mwl
  ZZZZZZ.s
  ZZZZZZ.upd
  Install.lst

All we need to do is:

  1. Change the name of the language from ZZZZZZ to the name of your language.
  2. Change the file extension from .ZZZ to the extension for your language.
  3. Change the prefix from Zzz to some 3 letters for your language.
  4. Add the keywords for your language to ZZZZZZ.mwl
  5. Rename the modifed files ZZZZZZ.* to <your language>.*
  6. Test install our new language support.

Then we can:

  1. Have a look at the new filename extension entry we created.
  2. Have a look at the new language entry we created.
  3. Fine Tune the language setup.

Example:
To set up a language named Wiles 1):

         Language Name: Wiles
    Filename Extension: .WIL
                Prefix: Wes   (See notes below on prefixes)

Copy these files to an empty directory (Note: Leave out this ReadMe.txt file):

  Install.lst
  ZZZZZZ.dat
  ZZZZZZ.del
  ZZZZZZ.mwl
  ZZZZZZ.s
  ZZZZZZ.upd

Change the name of the language from ZZZZZZ to the name of your language

Our new language is called Wiles.
Do a File Search & Replace, search for “ZZZZZZ”, replace with “Wiles” (SEARCH → FILE REPLACE)

Change the file extension from .ZZZ to the extension for your language

Two files:
  ZZZZZZ.upd
  ZZZZZZ.del

For these two files only, do a CASE SENSITIVE Search & Replace, replace “ZZZ” with “WIL”

Change the prefix from Zzz to some 3 letters for your language

Our new language prefix is Wes.
Do a CASE SENSITIVE File Search & Replace, search for “Zzz”, replace with “Wes”. (There are a lot of them, so select 'All Files' to quickly do them all)

Add the keyword file listing the keywords for your language

Edit file ZZZZZZ.mwl and add the keywords.
There are 4 sections:
  • WordList1.wl
  • WordList2.wl
  • WordList3.wl
  • WordList4.wl

The only difference is the color Multi-Edit displays the keywords in. In the Color Setup dialog: TOOLS → CUSTOMIZE → General(left side) → COLOR SETUP (right side). The four colors correspond to:

  • Reserved Words 1
  • Reserved Words 2
  • Reserved Words 3
  • Reserved Words 4

For more, see this article:

(You could simply place all the keywords under WordList1.wl)

Rename ZZZZZZ.* to <your language>.*

Our new language is called Wiles. Our files are now named:
  • Install.lst
  • Wiles.dat
  • Wiles.del
  • Wiles.mwl
  • Wiles.s
  • Wiles.upd

Test install our new language support.

Note: Before doing this, check to see if you already have some support for this language and/or filename extension. Perform steps 7 & 8 now to check this. If you do find existing entries for your language, go to step 9: “Fine tune the language setup”, and copy over those existing entries to your *.upd install file, then come back here and test install your new language.

Run INSTALL ADD-ON PACKAGES to install your new language:

  1. TOOLS → INSTALL ADD-ON PACKAGES
  2. Browse to the directory with your new install files we just made and click OK.
  3. The new install package should show up.
    • It searches for file install.lst
    • install.lst is also where the version number is stored.
  4. Click 'Install'
  5. For a reinstall, select 'Full Install' if it asks.

Have a look at the new filename extension entry:

  1. TOOLS → CUSTOMIZE → General(left side) → FILENAME EXTENSIONS (right side)
  2. Select WIL (probably at the bottom of the list)
  3. and click 'Edit'

Make any necessary changes.

Have a look at the new language entry:

  1. TOOLS → CUSTOMIZE → General(left side) → LANGUAGES (right side)
  2. Select Wiles (probably at the bottom of the list)
  3. and click 'Edit'

Make any necessary changes.

Fine tune the language setup

Repeat previous 2 steps to fine tune the new filename extension setup and the new language setup.

When the new Language Setup and Filename Extension dialogs are correct, we can update our installer file Wiles.upd

  1. Exit Multi-Edit
  2. Go to the Multi-Edit Config directory and find file MeConfig.db
    See: How to find the Meconfig.db and Wcmdmap.db files
  3. Make a copy of MeConfig.db.
    We will examine the copy only and leave the original alone.
  4. Start Multi-Edit.
    • Load the copy of MeConfig.db
    • Load Wiles.upd
  5. In Wiles.upd note that there are two lines that start with “Dat”
    • Those are the two lines we will change.
    • (Note: these lines have embedded 0x7F characters in them that might look like squares.)
  6. In the copy of MeConfig.db, search for “EXT=WIL”. Replace the line in Wiles.upd with this line, and precede the line with “Dat ”
  7. In the copy of MeConfig.db, search for “LANG=Wiles”. Replace the line in Wiles.upd with this line, and precede the line with “Dat ”

We have now updated our installer files. Try installing it again. We can also port this installer to other computers now.


NOTES:

PREFIXES: Just make something up. For a list of currently used prefixes, see:

Some of these names could be the same. e.g. you could have:
Code:

       Language Name: AWK
  Filename Extension: .AWK
              Prefix: Awk
1) Published proof of Fermat's Last Theorem in 1995
 
doc/tutorial/add_new_lang_05.0.txt · Last modified: 2009/03/09 20:14 by geofff     Back to top