Class | ActiveRecord::Base |
In: |
lib/gettext/active_record.rb
|
Parent: | Object |
# File lib/gettext/active_record.rb, line 156 156: def columns_with_gettext 157: unless defined? @columns 158: @columns = nil 159: end 160: unless @columns 161: @columns = columns_without_gettext 162: @columns.each {|column| 163: column.table_class = self 164: } 165: end 166: @columns 167: end
((Deprecated)) Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation instead.
Sets a your own explanation of the error message dialog.
# File lib/gettext/active_record.rb, line 194 194: def set_error_message_explanation(msg, plural_msg = nil) 195: ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation(msg, plural_msg) 196: end
((Deprecated)) Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title instead.
Sets a your own title of error message dialog.
# File lib/gettext/active_record.rb, line 180 180: def set_error_message_title(msg, plural_msg = nil) 181: ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title(msg, plural_msg) 182: end
Sets the untranslate columns. (e.g.) untranslate :foo, :bar, :baz
# File lib/gettext/active_record.rb, line 139 139: def untranslate(*w) 140: ary = @@gettext_untranslate_columns[self] || [] 141: ary += w.collect{|v| v.to_s} 142: @@gettext_untranslate_columns[self] = ary 143: end
Returns true if the column is set "untranslate". (e.g.) untranslate? :foo
# File lib/gettext/active_record.rb, line 147 147: def untranslate?(columnname) 148: ary = @@gettext_untranslate_columns[self] || [] 149: ary.include?(columnname) 150: end
Untranslate all of the tablename/fieldnames in this model class.
# File lib/gettext/active_record.rb, line 128 128: def untranslate_all 129: @@gettext_untranslate[self] = true 130: end
Returns true if "untranslate_all" is called. Otherwise false.
# File lib/gettext/active_record.rb, line 133 133: def untranslate_all? 134: @@gettext_untranslate[self] 135: end