The sequence aeiou might deserve to be a constant:
VOWEL = 'aeiou' ... if word[0] =~ /[#{VOWEL}]/i ... when /[#{VOWEL}]/ ... consonants = word.slice!(/[^#{VOWEL}]*/) Handling of capitalization can be handled by, at the beginning of the function, noticing whether or not the word is capitalized, and then downcasing it:
is_capitalized = word =~ /^A-Z/ word = word.downcase and at the end, capitalizing it again if needed.
word = word.capitalized if is_capitalized This removes considerations of case from the rest of the function.
Expressions like word[0] =~ /.../ can be replaced with word =~ /^.../. Similarly, word[1] =~ /.../ can be replaced with `word =~ /...$/
Taken altogether, these suggestions yield a #translate_word more like this:
def translate_word(word) is_capitalized = word =~ /^[A-Z]/ word = word.downcase if (word =~ /^#{VOWEL}/i) case word when /#{VOWEL}$/ word += "yay" when /y$/ word += "nay" else word += "ay" end else consonants = word.slice!(/^[^#{VOWEL}]*/) word += consonants + "ay" end word = word.capitalize if is_capitalized word end