Replaced Gibberish by Rails 2.2+ I18n

This commit is contained in:
2013-07-12 14:14:54 -04:00
parent c3110dcb93
commit 7a8e3ec065
53 changed files with 169 additions and 492 deletions

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#
@@ -27,7 +28,6 @@ class Attachment < ActiveRecord::Base
# Validacao
validates_presence_of :file_name
validates_numericality_of :size, :allow_nil => true, :only_integer => true
validates_inclusion_of :front_page, :in => [true, false], :allow_nil => false, :message => ActiveRecord::Errors.default_error_messages[:blank]
def self.find_front_page
Attachment.find(:all, :conditions => [ "front_page = ?", true ])
@@ -49,12 +49,12 @@ class Attachment < ActiveRecord::Base
def validate
if @tmp_file
errors.add("file") if @tmp_file.size == 0
errors.add("file", "is too large"[]) if @tmp_file.size > App.max_upload_file_size
errors.add("file", I18n.t(:is_too_large)) if @tmp_file.size > App.max_upload_file_size
else
# Caso o objeto possua id, significa que ele já está no banco de dados.
# Um arquivo em branco, entao, não é inválido: significa que a pessoa só quer
# modificar a descrição, ou algo assim..
errors.add("file", "is needed"[]) if not self.id
errors.add("file", I18n.t(:is_needed)) if not self.id
end
errors.add("path", "muito longo") if !@path.nil? and @path.split('/').size > 10

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#