WebVocab is a simple utility to replace words in Firefox (Greasemonkey enabled) browsers with another, user-specified, word. It is intended as a vocabulary study tool/game.

If, for example, you are trying to learn your colors in Latin, WebVocab might replace all the instances of red in your web browser with the word RUFUS.


I think I've removed the kinks from the web generation system. Give it a shot!

You don't need Perl anymore to create your own vocab entries!! See the online generation section below!


To make this work, all you need is:

  1. The Firefox web browser (I'm using 1.5).
  2. The Firefox extension Greasemonkey installed (you want this anyway, it's amazing!).

Optionally, if you'd like to generate the user scripts on your own computer (rather than using the web generation system) you'll need a working installation of Perl. If you opt to build your files locally, you'll also need the latest version of the generation code. Don't worry about this if the idea of installing Perl scares you. Just use the online interface!

Getting Started:

Assuming you have Greasemonkey working under Firefox, click this: example_vocab.user.js. If Greasemonkey is properly installed, you will see an option at the top of your browser to install the small example script. Install the script and you're set!

The example script just has a few types of words defined. They are the first few ordinal and cardinal numbers, a few words involving dates/times, and some colors in Latin. If you start browsing around, you should see these types of words being replaced by their all-capitals Latin equivalent.

Adding your own vocab words:

Vocab word pairs are stored in a very simple file format. It's probably easiest for you to just look at the short example vocab file.

Each line contains one vocab entry, where the English and Latin words (or German, Spanish, etc.) are separated by a colon (:). Comments can begin anywhere on the line with the # symbol, and lines that have no non-commented text (that is, they have no vocab entry), are simply ignored. You'll probably want to comment and use blank lines to structure your vocab files so they are easy to maintain.

Here is a small example snippet of a vocab definition file.

#some simple example vocab entries

#some nouns
bishop:antistes #this is singular
bishops:antistites #this is the plural form

#now let's add a number

Building vocab user scripts with the web generation system:

Generating a vocab script is now easy to do online. Just edit and save your vocab file on your own machine and use the following form to upload it. After you've uploaded your file and the generator is finished, just save the output to your machine with a '.user.js' ending, point Firefox to it, and install as before.

Select your vocabulary file to upload:

Building vocab user scripts with a local installation of Perl:

The generate_GM_user_script.pl Perl script compiles .user.js files locally. It takes two arguments: 1) the input vocab file and 2) the output user script file to create. Note that user scripts (what gets read in by Greasemonkey) MUST end with '.user.js'. If you're output file doesn't contain the '.user.js' ending, it will be appended automatically.

Assuming the generate_GM_user_script.pl works okay, point Firefox to your new user script and install as before. Your updated vocabulary should now be "translated" in the browser. Enjoy!

More complex vocab entries:

WebVocab let's you add additional information to vocab entries for other purposes. For example, WebVocab normally has no idea what the part of speech is for the word getting replaced. It is just blindly replacing words. For example, if you have a vocab entry learned:eruditus, WebVocab will replace the word learned in both I learned that 2+2=4 and The learned man knows his math. This is probably not what you want. To get around this a bit, you can optionally specify one or more flags with your vocab entries. These are included as a third field in your entry, like this:


Here's what the flags do:

How to help:

(and some features I'd like to include in future releases) If you know anything about JavaScript or Greasemonkey, you probably know more about it than I do. I have no illusions that this idea couldn't be implemented in a much much better way. Some things I'd like to include in future versions:
  1. Rather than replace words with the uppercase second language equivalent, do something like replace them with a bolded (or colorized) second language equivalent.
  2. Make mouseovers on the new text show the word that was replaced.
  3. Do anything to make it faster.

Reporting bugs or requesting new features:

Email me, at olsson at math dawt umd dot edu.

Known problems:

SourceForge.net Logo