We internationalized our site months ago, but forgot one part: The drop down where a user picks their timezone.
How do you translate the following line:
fishwebby's solution didn't work for me when priority time zones where provided in the time_zone_select. Easiest is to just stick this in /config/initializers/time_zone_patch.rb :
# See https://stackoverflow.com/questions/1396623/translating-rails-timezones
class ActiveSupport::TimeZone
def to_s
offset = "(GMT#{formatted_offset})"
translated_name = I18n.t(name, :scope => :time_zones, :default => name)
%(#{offset} #{translated_name})
end
end
No need to modify your view code either.
You can use it in conjunction with this fork of the rails-i18n gem. It includes the spanish timezone translations that were provided in another response to this question. I will be adding more translations as needed or as provided until the original gem authors merge the timezones into their project.