diff --git a/app/models/article.rb b/app/models/article.rb index 21e2fb0..46c8093 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -7,7 +7,7 @@ class Article < ActiveRecord::Base validates_presence_of :profile_id, :name validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? } - validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => _('%{fn} (the code generated from the article name) is already being used by another article.'), :if => lambda { |article| !article.slug.blank? } + validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('%{fn} (the code generated from the article name) is already being used by another article.'), :if => lambda { |article| !article.slug.blank? } belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' diff --git a/app/models/domain.rb b/app/models/domain.rb index 8c257f2..93d0615 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -10,7 +10,7 @@ class Domain < ActiveRecord::Base # name must be a sequence of word characters (a to z, plus 0 to 9, # plus '_'). Letters must be lowercase - validates_format_of :name, :with => /^([a-z0-9_]+\.)+[a-z0-9_]+$/, :message => _('%{fn} must be composed only of lowercase latters (a to z), numbers (0 to 9) and "_"') + validates_format_of :name, :with => /^([a-z0-9_]+\.)+[a-z0-9_]+$/, :message => N_('%{fn} must be composed only of lowercase latters (a to z), numbers (0 to 9) and "_"') # checks validations that could not be expressed using Rails' predefined # validations. In particular: diff --git a/app/models/environment.rb b/app/models/environment.rb index 2d5d6d4..d59db80 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -381,7 +381,7 @@ class Environment < ActiveRecord::Base validates_presence_of :name # only one environment can be the default one - validates_uniqueness_of :is_default, :if => (lambda do |environment| environment.is_default? end), :message => _('Only one Virtual Community can be the default one') + validates_uniqueness_of :is_default, :if => (lambda do |environment| environment.is_default? end), :message => N_('Only one Virtual Community can be the default one') validates_format_of :contact_email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda { |record| ! record.contact_email.blank? }) diff --git a/app/models/uploaded_file.rb b/app/models/uploaded_file.rb index bf8ad5f..beda221 100644 --- a/app/models/uploaded_file.rb +++ b/app/models/uploaded_file.rb @@ -19,7 +19,7 @@ class UploadedFile < Article UploadedFile.attachment_options[:max_size] end - validates_attachment :size => _("The file you uploaded was larger than the maximum size of %s") % UploadedFile.max_size.to_humanreadable + validates_attachment :size => N_("The file you uploaded was larger than the maximum size of %s") % UploadedFile.max_size.to_humanreadable def icon_name self.image? ? public_filename(:icon) : self.content_type.gsub('/', '-') -- libgit2 0.21.2