public
Rubygem
Fork of mattetti/globalite
Description: Globalite is meant to be a breed of the best i18n /l10n plugins available for Rails.
Homepage: http://code.google.com/p/globalite/
Clone URL: git://github.com/pnowak2/globalite.git
Search Repo:
fix: there were problem with error_messages_for helper and its message and 
message_header parameters. when tried to provide any of them, globalite 
ignored them. now it works as expected

enhancement: there was not any support to localize field names in 
validator messages. it couldn't work for anybody because you always got 
something like this:

Name cannot be empty (en)
Name nie może być puste (pl)

well, Name should be replaced with 'Nazwa' in polish.

it works by convention now. when you have validator:

validates_presence_of :name, :email, :age

its by convention that you have in your yml language files entries with 
the same keys: name:, email:, age:.
when you dont provide such a key, the behaviour is without any changes, 
just like without i18n plugin.
ive also added possibility to get rid of field name in custom validation 
message with :message attribute.

validates_uniqueness_of :name, :message => 'my message'

so from now you can have:

my message
instead of
Name my message
Piotr Nowak (author)
Fri Apr 25 14:17:52 -0700 2008
commit  2cb9691cdd7cb31f93f3686f0d56d202782165b2
tree    bffe8dfc19ea7424835e7b57f000713e492a59ed
parent  ec6a976ce56a74f0eaf5b1aa20c3db25699c4cea
...
187
188
189
 
190
191
192
...
187
188
189
190
191
192
193
0
@@ -187,6 +187,7 @@
0
           message = :active_record_helper_error_description.l('There were problems with the following fields:')
0
                             
0
           # Fix for :header_message and :message values if present
0
+ # It works just like regular rails functionality
0
           options[:header_message] = header_message unless options.include?(:header_message)
0
           options[:message] = message unless options.include?(:message)
0
           error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }

Comments

    No one has commented yet.