Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Extended by:
- GetText::Rails
- Includes:
- GetText::Rails
- Defined in:
- lib/gettext/rails.rb
Constant Summary collapse
- @@error_message_title =
nil
- @@error_message_explanation =
nil
Constants included from GetText::Rails
Constants included from GetText
Class Method Summary collapse
- .columns ⇒ Object
-
.set_error_message_explanation(msg, plural_msg = nil) ⇒ Object
call-seq: set_error_message_explanation(msg).
-
.set_error_message_title(msg, plural_msg = nil) ⇒ Object
call-seq: set_error_message_title(msg).
Instance Method Summary collapse
-
#error_message_explanation ⇒ Object
:nodoc:.
-
#error_message_title ⇒ Object
:nodoc:.
-
#gettext(str) ⇒ Object
:nodoc:.
Methods included from GetText::Rails
_bindtextdomain, bindtextdomain, bindtextdomain_to, callersrc, use_localized_templates, use_localized_templates?
Methods included from GetText
N_, #Nn_, _, #add_default_locale_path, bindtextdomain, callersrc, cgi, cgi=, charset=, create_mofiles, gettext, locale, locale=, msgmerge, msgmerge_all, n_, ngettext, output_charset, output_charset=, rgettext, rmsgfmt, rmsgmerge, s_, set_cgi, set_charset, set_locale, set_output_charset, setlocale, sgettext, textdomain, update_pofiles
Class Method Details
.columns ⇒ Object
208 209 210 211 212 213 214 215 216 217 |
# File 'lib/gettext/rails.rb', line 208 def self.columns unless @columns @columns = connection.columns(table_name, "#{name} Columns") @columns.each {|column| column.table_class = self column.primary = column.name == primary_key } end @columns end |
.set_error_message_explanation(msg, plural_msg = nil) ⇒ Object
call-seq: set_error_message_explanation(msg)
Sets a your own explanation of the error message dialog.
-
msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
-
Returns: [single_msg, plural_msg]
225 226 227 228 229 230 231 232 233 |
# File 'lib/gettext/rails.rb', line 225 def self.(msg, plural_msg = nil) if msg.kind_of? Array single_msg = msg[0] plural_msg = msg[1] else single_msg = msg end @@error_message_explanation = [single_msg, plural_msg] end |
.set_error_message_title(msg, plural_msg = nil) ⇒ Object
call-seq: set_error_message_title(msg)
Sets a your own title of error message dialog.
-
msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
-
Returns: [single_msg, plural_msg]
198 199 200 201 202 203 204 205 206 |
# File 'lib/gettext/rails.rb', line 198 def self.(msg, plural_msg = nil) if msg.kind_of? Array single_msg = msg[0] plural_msg = msg[1] else single_msg = msg end @@error_message_title = [single_msg, plural_msg] end |
Instance Method Details
#error_message_explanation ⇒ Object
:nodoc:
242 243 244 245 246 247 248 |
# File 'lib/gettext/rails.rb', line 242 def #:nodoc: if @@error_message_explanation [_(@@error_message_explanation[0]), _(@@error_message_explanation[1])] else nil end end |