Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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