% text_tag_method = :textarea == input[:type] ? :text_area_tag : :text_field_tag %> <% render_locale_input = ->(locale, options) do send(text_tag_method, input[:name].to_s.gsub(/\[(\w+)\]$/, "[\\1_#{locale}]"), (input[:object]["#{input[:attr]}_#{locale}"].presence || input[:object][input[:attr].to_s] rescue ''), options) end %>