What's new? | Help | Directory | Sign in
Google
                

ErrorMessagesLocalizedFor

=========================

This is a plugin for localizing your fieldnames, you will need the localization plugin, this can be found at http://wiki.rubyonrails.org/rails/pages/Localization+Plugin.` You can easily install localization by executing: "script/plugin install localization" from your project root.

Just type in the translation of your fieldnames and modelnames in /lang/translation.rb(or your custom file), the reference in translation.rb must all be downcase. Example:

model:

		l.store 'user','Person'
fieldnames:
		l.store 'email','E-mail'
		l.store 'password','Password'

also translate:

l.store 'error','error'
l.store 'prohibitedthis',prohibited this'
l.store 'fromsaving','from being saved'
l.store 'fieldproblems','There were problems with the following fields:'

you can use inflector in /config/environment.rb to pluralize the name 'error' in the language requested by you, if "l.store 'error','fout'" :

Inflector.inflections do |inflect|
  inflect.plural /fout/, 'fouten'
end

then use the error_messages_localized_for 'model' instead of error_messages_for 'model' in your views.