From 6fe7dc22bcc50ee4985e0a86bbe5a637b520f836 Mon Sep 17 00:00:00 2001 From: Marko Lovic Date: Thu, 23 Aug 2018 18:29:04 +0200 Subject: [PATCH] Fix translatable field labels to not include locale Label for field :title should be "Title", not "Title en" --- app/helpers/translatable_form_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index 82cd10a93..1c160e69d 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -41,7 +41,9 @@ module TranslatableFormHelper @template.capture do @object.globalize_locales.each do |locale| Globalize.with_locale(locale) do + label_without_locale = @object.class.human_attribute_name(method) final_options = @template.merge_translatable_field_options(options, locale) + .reverse_merge(label: label_without_locale) @template.concat send(field_type, "#{method}_#{locale}", final_options) end end