Just Another Monday Morning

Posted by Trejkaz Mon, 14 May 2007 00:13:00 GMT

Monday morning came with a request to change the company web site to American “English”.

My first thought was that we’re not a US company, so we shouldn’t need to conform to US spelling. The reasoning I got back was that US companies got scared off by British spelling.

This reasoning sounds pretty ludicrous to me, and besides, if we switch to American spelling, won’t that “scare off” the entire rest of the English speaking world?

So I thought, OK… maybe we can do this and yet not do this.

#!/usr/bin/ruby
#
# Breaks proper English spelling for the benefit of yanks.
# Word list is incomplete, but covers enough to be useful for now.

ARGF.each_line do |line|
    line.sub!(/\b(amort|apolog|author|capital|critic|emphas|general|harmon|initial|maxim|minim|optim|real|recogn|visual)is(e|ed|es|er|or|ation)\b/, '\1iz\2')
    line.sub!(/\b(anal|catal|paral)ys(e|ed|es|er|or)\b/, '\1yz\2')
    line.sub!(/\b(arm|behavi|col|flav|harb|hon|hum|neighb|sav|savi)our(s?)\b/, '\1or\2')
    line.sub!(/\b(defen|licen|offen|preten)ce(s?)\b/, '\1se\2')
    line.sub!(/\b(calib|cent|fib|kilomet|lit|meag|met|theat)re(s?)\b/, '\1er\2')
    line.sub!(/\bpractis(e|ed|ing)\b/, 'practic\1')
    puts line;
end

My only concern is that it might match an ID somewhere in the HTML which will mess the CSS up, but otherwise, it’s looking like a damn good idea.

Tags , , , ,  | no comments