Actions
Bug #2588
closedLDAP auth sources form labels not translated due to STI
Description
When adding a new LDAP authentication source, none of the form labels have been translated. The field method in layout_helper calls s_() on the gettext Model|Field string, but this doesn't work well with STI, returning the subclass name while the translation extraction uses the base STI class name.
122: content_tag :div, :class => "control-group #{fluid ? "row-fluid" : ""} #{error.empty? ? "" : 'error'}" do
=> 123: binding.pry
124: label = options.delete(:label)
125: label ||= (f.object.class.respond_to?(:gettext_translation_for_attribute_name) &&
126: s_(f.object.class.gettext_translation_for_attribute_name attr)) if f
[3] pry(#<#<Class:0x007f97e985cd60>>)> f.object.class.gettext_translation_for_attribute_name attr
=> "AuthSourceLdap|Tls"
While the model attributes file is based off of the schema which doesn't have STI subclass names:
$ grep AuthSource locale/model_attributes.rb | tail -3
_('AuthSource|Onthefly register')
_('AuthSource|Port')
_('AuthSource|Tls')
Updated by Anonymous over 12 years ago
Updated by Anonymous over 12 years ago
- Status changed from New to Ready For Testing
Updated by Anonymous over 12 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 2e1e6f713d49ef6f5274d798f8882faa2579f680.
Actions