Project

General

Profile

Actions

Bug #2588

closed

LDAP auth sources form labels not translated due to STI

Added by Dominic Cleal almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Internationalization
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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')

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #2596: Upgrade to the new version of gettext_i18n_railsClosed05/31/2013Actions
Actions #1

Updated by Anonymous almost 11 years ago

  • Assignee set to Anonymous
Actions #3

Updated by Anonymous almost 11 years ago

  • Status changed from New to Ready For Testing
Actions #4

Updated by Anonymous almost 11 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF