Skip to content

Instantly share code, notes, and snippets.

@rhulse
Created April 19, 2009 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhulse/98245 to your computer and use it in GitHub Desktop.
Save rhulse/98245 to your computer and use it in GitHub Desktop.
Turn a date string in English into Maori
def convert_date_to_maori(date_string)
tereo_date = date_string.clone
h = {
/January/ => 'Kohi-tātea',
/February/ => 'Hui-tanguru',
/March/ => 'Poutū-te-rangi',
/April/ => 'Paengawhā-whā',
/May/ => 'Haratua',
/June/ => 'Pipiri',
/July/ => 'Hōngongoi',
/August/ => 'Here-turi-kōkā',
/September/ => 'Mahuru',
/October/ => 'Whiringa-ā-nuku',
/November/ => 'Whiringa-ā-rangi',
/December/ => 'Hakihea',
/Monday/ => 'Rāhina',
/Tuesday/ => 'Rātū',
/Wednesday/ => 'Rāapa',
/Thursday/ => 'Rāpare',
/Friday/ => 'Rāmere',
/Saturday/ => 'Rāhoroi',
/Sunday/ => 'Rātapu'
}
h.each_pair do |regexp, replacement|
tereo_date.gsub! regexp, replacement
end
tereo_date
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment