Differences

This shows you the differences between two versions of the page.

doc:tutorial:add_new_lang_05.0 [2009/03/05 11:28]
geofff
doc:tutorial:add_new_lang_05.0 [2009/03/09 20:14] (current)
geofff misc formatting changes
Line 1: Line 1:
 +==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:
 +<code>
 +         Language Name: ZZZZZZ
 +    Filename Extension: .ZZZ
 +                Prefix: Zzz   (See notes below on prefixes)
 +</code>
 +
 +  * 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 [[http://www.multieditsoftware.com/forums/download.php?id=445|here]]
 +
 +The attached zip file contains the following files which comprise the installer:
 +<code>
 +  ZZZZZZ.dat
 +  ZZZZZZ.del
 +  ZZZZZZ.mwl
 +  ZZZZZZ.s
 +  ZZZZZZ.upd
 +  Install.lst
 +</code>
 +
 +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** ((Published proof of Fermat's Last Theorem in 1995)):
 +
 +<code>
 +         Language Name: Wiles
 +    Filename Extension: .WIL
 +                Prefix: Wes   (See notes below on prefixes)
 +</code>
 +
 +Copy these files to an empty directory (Note: Leave out this ReadMe.txt file):
 +<code>
 +  Install.lst
 +  ZZZZZZ.dat
 +  ZZZZZZ.del
 +  ZZZZZZ.mwl
 +  ZZZZZZ.s
 +  ZZZZZZ.upd
 +</code>
 +----
 +===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:\\
 +<code>
 +  ZZZZZZ.upd
 +  ZZZZZZ.del
 +</code>
 +
 +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:
 +  * Adding Language Support. 1: Syntax Highlighting
 +  * http://www.multieditsoftware.com/forums/viewtopic.php?t=1614
 +  * http://www.multiedit.com/forums/viewtopic.php?t=2013
 +
 +(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:
 +  - 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
 +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
 +  - 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
 +    * http://www.multieditsoftware.com/TheDev/v04_i08_2007.htm#CMC
 +    * http://www.multiedit.com/forums/viewtopic.php?t=2013
 +  - 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:
 +
 +  * [[doc/tutorial/add_new_lang_02|Adding Language Support 2: Language Specific Macros]]
 +  * http://www.multieditsoftware.com/forums/viewtopic.php?t=1854
 +
 +Some of these names could be the same. e.g. you could have:
 +Code:
 +         Language Name: AWK
 +    Filename Extension: .AWK
 +                Prefix: Awk
 +
 
doc/tutorial/add_new_lang_05.0.txt · Last modified: 2009/03/09 20:14 by geofff     Back to top