Alias_method_chain with i18n

Hello,

I was investigating solutions for i18n with will_paginate and I found
a possible solution at

The author adds to application_helper.rb the following code:

#############################################
include WillPaginate::ViewHelpers

def will_paginate_with_i18n(collection, options = {})
will_paginate_without_i18n(collection, options.merge(:previous_label
=> I18n.t(‘will_paginate.previous’), :next_label =>
I18n.t(‘will_paginate.next’)))
end

alias_method_chain :will_paginate, :i18n
#############################################

What I would like to understand is how this code is working, the
“magic” behind it.

I’m also having a problem with this code with passenger. The code
works fine with webrick but with passenger the program breaks at
include WillPaginate::ViewHelpers with ‘uninitialized constant
WillPaginate::ViewHelpers’ error. I tested it in the same environment.

Regards,

Paulo A.