What is this?

BabelFox is a small web application that takes a Google spreadsheet and converts it into a fancy FoxReplace file, complete with custom regular expressions and other bells and whistles. All of the magic happens here.

For example, observe what happens to a page at the Economist:

While the point is to help you to practice language learning while you surf the web, it can be used to convert any type of FoxReplace list. Lists are given a permalink that can be shared with others (either through email or through the Shared Library on this site), all without exposing your Google account name or the original document's URL.

For more information, read this blog post.

Step 1: Install FoxReplace

You need to be using the FireFox browser, and you need to install the FoxReplace add-on.

You can get Firefox here: http://www.mozilla.com/firefox
You can get FoxReplace here: https://addons.mozilla.org/firefox/addon/6510

If you just want to see BabelFox in action without creating your own spreadsheet, you can skip to Step 4.


Creating a spreadsheet

The Share button

The spreadsheet's published URL

Step 2: Create an online spreadsheet using Google Docs

If you don't have a Google account, get one here. Create a new spreadsheet in Google Docs (http://docs.google.com) by selecting "Spreadsheet" from the "New" dropdown. Set up your spreadsheet like this:

  • The title of the document becomes the title of the BabelFox output.
  • You need a header row, but it is ultimately ignored. Use it to label your entries.
  • The third and fourth columns are optional.
Now just fill your spreadsheet! There is no size limit, although extremely large sets may slow down Firefox.

Step 3: Publish your spreadsheet and copy the published URL

Click on the "Share" dropdown on the upper right side of your Google spreadsheet and select "Publish as web page." Copy the entire link that appears, which should look something like this...
http://spreadsheets.google.com/pub?key=xxXXxXxxxXxXxxXxXXXXXxXx
...and then click "Publish now." Select the "Automatically re-publish when changes are made" option. Note: If you ever change the status to "Stop publishing," then the spreadsheet will no longer be available to BabelFox.



Shared Library

Here are some examples of shared sets.
Random Chinese vocab by Anonymous
Random Chinese words
Swear word list by Elliott
This list takes the most common English swear words and replaces them with benign equivalents. Instead of writing 'f@#$', which only brings attention to the word (and your mind silently puts the vulgarity back in), the word is rendered 'fudge'...which has the added benefit of making vulgar writer sound ridiculous.
Most common Spanish nouns by Elliott
This is a list of the most common Spanish nouns

Step 4: Load and process the spreadsheet

To load your Google spreadsheet, paste its published URL into the input box below. Alternately, you can load a shared set from the "Shared Library" on the right side of the page.

Spreadsheet
http://spreadsheets.google.com/pub?key=xxXxXxxxXxXxxXxXXXXXxXx

There is no output file available at this time.

Load a spreadsheet by following the instructions above. You may either load your own spreadsheet or select one from the Shared Library. Once a spreadsheet is loaded, press the "Process spreadsheet" button.




Opening the FoxReplace options

Step 5: Import/Sync with FoxReplace

Note: The "Import from URL" feature appears to be broken. Just follow the steps below.

If everything went smoothly with loading and processing the spreadsheet, you should have already saved a backup of your custom output file to your hard drive. Now all that is left is to either put that XML file into FoxReplace, or sync the online version.

Go to Firefox's "Tools" menu, find the "FoxReplace" item, and click the "FoxReplace options..." link. (Also, I recommend turning "Auto-replace with page load" on.)

OPTION 1: Import once
From the options menu, click on the "Import" button in the lower right hand corner. Then select your saved BabelFox XML file, press "Open," and you're good to go!

OPTION 2: Sync continuously
You can now sync (one-way sync to be exact) your FoxReplace set with your Google spreadsheet! You may ignore all the Import buttons (especially "Import from URL" which, as mentioned, appears to be broken). Just paste the output URL into the "Update from URL" input box, close the options menu, wait one minute (if you kept the default setting), and re-open that options menu—you should see your most current substitutions list all ready to go!

Troubleshooting

  • Make sure that your FoxReplace add-on is installed (you need to restart Firefox if you haven't already).
  • Make sure your spreadsheet is still "publishing" and that it is set to auto-refresh.
  • If you are using a set from the Shared Library that isn't working, its likely because the author has stop publishing it. Nothing can be done about that, I'm afraid. I'll try to clean out dead spreadsheets.
  • Keep in mind that some regular expressions may bog down Firefox. If the script consistently takes a lnog time to process on your computer, considering changing the regular expression search input.

Source Code

I'd be happy to share any of the code used to grab the spreadsheet data, generate the XML, or display this page. Just post a comment below.

BabelFox was built with ColdFusion, Scriptaculous, and SACK. The Comments section is a modded template from BlogCFC.

Feedback

Comments

Comment Moderation is enabled. Your comment will not appear until approved.
This sounds like an incredibly awesome idea. Now if I can just get someone to make me beginner, intermediate, and advanced vocab lists in several foreign languages ... =)
# Posted by Sammy Larbi    Sunday, Mar 29 2009, 11:58 AM
Hi,
I use foxreplace too. Currently, i create the xml by hand and would be interested in how you created the xml file automatically. Thanks.. Gail
# Posted by Gail    Sunday, Mar 29 2009, 3:07 PM
Hi Gail, thanks for the comment.

The XML is generated using a ColdFusion server-side script. I put the data from Google Spreadsheets into a 2-D array, then its just a simple output loop into an cfm file with an XML cfheader.

You are free to use BabelFox to automate the process, and you can keep your XML output private; just follow the steps on http://elliottandlara.com/babelfox (first create a Google Spreadsheet, provide its published URL in the box at Step 4, and then download the XML file). Please try it out, and let me know what you think!

I just got word from FoxReplace's author that he can add an "import online XML" feature in the next release, and maybe a syncing feature down the road. So it will be even easier...you'll just need to update a Google spreadsheet to manage your FoxReplace set.
# Posted by Elliott    Sunday, Mar 29 2009, 6:34 PM
Dude, that was a sweet prank! I'm taking notes :-)
# Posted by Bryce Goodwin    Thursday, Apr 23 2009, 5:24 AM
@Bryce
Thanks! Just be careful if you do it on a shared computer; its easy to forget about the prank and get confused yourself. ;-)
# Posted by Elliott    Thursday, Apr 23 2009, 3:51 PM
I've been trying to add entries to the FoxReplace XML file by hand, but the results won't import. I've been trying to stick to the format generated by FoxReplace itself, but I can't seem to get it to work. Can anybody point me to the solution.
TIA
# Posted by Shard    Sunday, Aug 02 2009, 6:37 PM
Hi. I processed my sheet (which is rather long) and the resulting .xml file included only the title of the sheet, down in Column A, Row 8. Did I do something wrong?
I've been trying to edit an existing FoxReplace.xml file by hand, adding just the <substitution><substitution> tags ans everything in between, but I can't get FoxReplace to import it.
Any help would be appreciated. Congratulations on your work.
# Posted by Shard    Monday, Aug 03 2009, 3:11 AM
Hi Shard. There are a few things that can break the XML. If you're doing it by hand, I'd suggest starting with a working, bare-bones FoxReplace list and slowly add more entries until it breaks. It's probably a single character throwing you off.

I don't have a ton of time, but i could give it a quick look. You could email me (elliottandlara@gmail.com) your by-hand XML file and the URL to your published Google Doc, and I'll take a look at them both and see if I have any suggestions.
# Posted by Elliott    Tuesday, Aug 04 2009, 12:38 AM
Thanks for the tool. I made a file to shorten recipe units (see http://elliottandlara.com/babelfox/output.cfm?i=B5...), and it imported fine from my computer. But I really want to make this available to others using the option to import from a URL. When I did so, however, I got an error, "ReferenceError: XMLHttpRequest is not defined". Am I doing something wrong?
# Posted by AC Goodin    Saturday, Oct 16 2010, 1:07 PM
Thanks AC. I'll take a look and see if I can figure out what is going on (I was able to replicate the problem as you described). I'll post here if/when I find a solution.

EDIT: I realized that this feature did exist last year and worked fine. My suspicion is that the newest version of Firefox has broken Foxreplace's functionality. I'll see if I can test that.
# Posted by Elliott    Sunday, Oct 17 2010, 5:17 PM
AC - after playing around with it, I was able to get it to work fine.

The "Update from URL" feature appears to work flawlessly - which is great, since that is what makes babelfox useful (allowing you to update your Google spreadsheet and have your changes sync to your browser).

My advice is to ignore the "Import from URL" button/function, since it appears to have a bug. Just paste the XML link it the "Update" textbox instead. (I have added new instructions on elliottandlara.com/babelfox to reflect this change)

Let me know if you have further troubles...
# Posted by Elliott    Sunday, Oct 17 2010, 6:13 PM
Hi, I am trying to convert the spreadsheet with the URL below to an XML file. The XML file will be downloaded into Google Merchant. I am getting a message that the URL does not appear to be a Google spreadsheet.
[link hidden]

Please help. Thank you
# Posted by Omoyemi    Sunday, Feb 27 2011, 12:23 PM
Omoyemi, I'm not able to access your spreadsheet. However, the type of XML file generated by my app is specifically for the FoxReplace extension. Have you tried downloading/exporting your spreadsheet as an XML file directly from Google Docs?
# Posted by Elliott    Sunday, Feb 27 2011, 6:49 PM
I'm also getting an "This does not appear to be a valid Google spreadsheet." error with https://spreadsheets.google.com/pub?key=0AhADYlhLM...

It would be excellent if there was a solution to this, I've been looking for something which does this kind of thing for literally years (being a non-programmer I've not been able to put it together myself), and this should work even better than I'd have needed. I'd like to use it to link up various communities of competitive pokemon players from different languages, but it's hampered massively by google translate's/every other tool I've found's extremely poor handling of the specific terms we have. It'd be fairly easy to set up something which could translate to/from any language, if only your tool would give the XML.
# Posted by ete    Thursday, Dec 08 2011, 2:09 PM
@ete - I'll take a look at this next week (I have tests coming up soon). Its been ages since I played around with this, and Google is constantly updating its code so that stuff like this often breaks.
# Posted by Elliott    Saturday, Dec 10 2011, 1:44 PM
 Loading...