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:
- Change the name of the language from ZZZZZZ to the name of your language.
- Change the file extension from .ZZZ to the extension for your language.
- Change the prefix from Zzz to some 3 letters for your language.
- Add the keywords for your language to ZZZZZZ.mwl
- Rename the modifed files ZZZZZZ.* to <your language>.*
- Test install our new language support.
Then we can:
- Have a look at the new filename extension entry we created.
- Have a look at the new language entry we created.
- 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
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
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
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
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:
- Adding Language Support. 1: Syntax Highlighting
(You could simply place all the keywords under WordList1.wl)
Rename ZZZZZZ.* to <your language>.*
- Install.lst
- Wiles.dat
- Wiles.del
- Wiles.mwl
- Wiles.s
- Wiles.upd
Test install our new language support.
Run INSTALL ADD-ON PACKAGES to install your new language:
- TOOLS → INSTALL ADD-ON PACKAGES
- Browse to the directory with your new install files we just made and click OK.
- The new install package should show up.
- It searches for file install.lst
- install.lst is also where the version number is stored.
- Click 'Install'
- For a reinstall, select 'Full Install' if it asks.
Have a look at the new filename extension entry:
- TOOLS → CUSTOMIZE → General(left side) → FILENAME EXTENSIONS (right side)
- Select WIL (probably at the bottom of the list)
- and click 'Edit'
Make any necessary changes.
Have a look at the new language entry:
- TOOLS → CUSTOMIZE → General(left side) → LANGUAGES (right side)
- Select Wiles (probably at the bottom of the list)
- and click 'Edit'
Make any necessary changes.
Fine tune the language setup
When the new Language Setup and Filename Extension dialogs are correct, we can update our installer file Wiles.upd
- Exit Multi-Edit
- Go to the Multi-Edit Config directory and find file MeConfig.db
See: How to find the Meconfig.db and Wcmdmap.db files - Make a copy of
MeConfig.db.
We will examine the copy only and leave the original alone. - Start Multi-Edit.
- Load the copy of MeConfig.db
- Load Wiles.upd
- 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.)
- 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 ”
- 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