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
#
@@ -23,7 +24,7 @@ class ApplicationController < ActionController::Base
helper :all
before_filter :startup
before_filter :set_timezone
#before_filter :set_timezone
# Força o login para algumas áreas do sistema
before_filter :require_login, :only => [ :edit, :new, :create, :update, :delete, :destroy ]
@@ -63,10 +64,10 @@ class ApplicationController < ActionController::Base
end
end
def set_timezone
#Time.zone = session[:user].tz
Time.zone = "America/Fortaleza"
end
#def set_timezone
# #Time.zone = session[:user].tz
# Time.zone = "America/Fortaleza"
#end
def startup
if session[:user_id]

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#
@@ -47,7 +48,7 @@ class AttachmentsController < ApplicationController
@attachment.save!
AttachmentCreateLogEntry.create!(:target_id => @attachment.id, :user => @current_user, :course => @course)
flash[:notice] = 'Attachment created'[]
flash[:notice] = t(:attachment_created)
respond_to do |format|
format.html { redirect_to course_attachment_url(@course, @attachment) }
@@ -73,7 +74,7 @@ class AttachmentsController < ApplicationController
@attachment.last_modified = Time.now.utc
@attachment.save!
AttachmentEditLogEntry.create!(:target_id => @attachment.id, :user => @current_user, :course => @course)
flash[:notice] = 'Attachment updated'[]
flash[:notice] = t(:attachment_updated)
end
respond_to do |format|
@@ -84,7 +85,7 @@ class AttachmentsController < ApplicationController
def destroy
@attachment.destroy
flash[:notice] = 'Attachment removed'[]
flash[:notice] = t(:attachment_removed)
log = AttachmentDeleteLogEntry.create!(:target_id => @attachment.id, :user => @current_user, :course => @course)
flash[:undo] = undo_course_log_url(@course, log)

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#
@@ -49,7 +50,7 @@ class CoursesController < ApplicationController
def create
@course.save!
flash[:notice] = 'Course created'[]
flash[:notice] = t(:course_created)
respond_to do |format|
format.html { redirect_to course_path(@course) }
@@ -64,7 +65,7 @@ class CoursesController < ApplicationController
@course.attributes = params[:course]
@course.save!
flash[:notice] = 'Course updated'[]
flash[:notice] = t(:course_updated)
respond_to do |format|
format.html { redirect_to course_path(@course) }
format.xml { head :ok }
@@ -73,7 +74,7 @@ class CoursesController < ApplicationController
def destroy
@course.destroy
flash[:notice] = 'Course removed'[]
flash[:notice] = t(:course_removed)
respond_to do |format|
format.html { redirect_to courses_path }

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#
@@ -45,7 +46,7 @@ class EventsController < ApplicationController
@event.course_id = @course.id
@event.created_by = session[:user_id]
@event.save!
flash[:notice] = 'Event created'[]
flash[:notice] = t(:event_created)
EventCreateLogEntry.create!(:target_id => @event.id, :user => @current_user, :course => @course, :version => @event.version)
@@ -63,7 +64,7 @@ class EventsController < ApplicationController
@event.attributes = params[:event]
dirty = @event.changed?
@event.save!
flash[:notice] = 'Event updated'[]
flash[:notice] = t(:event_updated)
EventEditLogEntry.create!(:target_id => @event.id, :user => @current_user, :course => @course, :version => @event.version) if dirty
@@ -75,7 +76,7 @@ class EventsController < ApplicationController
def destroy
@event.destroy
flash[:notice] = 'Event removed'[]
flash[:notice] = t(:event_removed)
log = EventDeleteLogEntry.create!(:target_id => @event.id, :user => @current_user, :course => @course, :version => @event.version)
flash[:undo] = undo_course_log_url(@course, log)

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
#
@@ -47,7 +48,7 @@ class NewsController < ApplicationController
@news.sender_id = session[:user_id]
@news.timestamp = Time.now.utc
@news.save!
flash[:notice] = 'News created'[]
flash[:notice] = t(:news_created)
NewsCreateLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version)
@@ -66,7 +67,7 @@ class NewsController < ApplicationController
@news.timestamp = Time.now.utc
dirty = @news.changed?
@news.save!
flash[:notice] = 'News updated'[]
flash[:notice] = t(:news_updated)
NewsEditLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version) if dirty
@@ -78,7 +79,7 @@ class NewsController < ApplicationController
def destroy
@news.destroy
flash[:notice] = 'News removed'[]
flash[:notice] = t(:news_removed)
log = NewsDeleteLogEntry.create!(:target_id => @news.id, :user => @current_user, :course => @course, :version => @news.version)
flash[:undo] = undo_course_log_url(@course, log)

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
#
@@ -46,7 +47,7 @@ class UsersController < ApplicationController
@user.attributes = params[:user]
@user.save!
flash[:notice] = 'User account updated'[]
flash[:notice] = t(:user_account_updated)
respond_to do |format|
format.html { redirect_to user_path(@user) }
@@ -56,7 +57,7 @@ class UsersController < ApplicationController
def destroy
@user.destroy
flash[:notice] = 'User account removed'[]
flash[:notice] = t(:user_account_removed)
respond_to do |format|
format.html { redirect_to users_path }
@@ -71,7 +72,7 @@ class UsersController < ApplicationController
@user.last_seen = Time.now.utc
@user.save!
setup_session(@user)
flash[:message] = 'User account created'[]
flash[:message] = t(:user_account_created)
redirect_to dashboard_url
rescue ActiveRecord::RecordInvalid
flash[:warning] = 'Não foi possível cadastrar a conta.'
@@ -86,7 +87,7 @@ class UsersController < ApplicationController
@user.attributes = params[:user]
@user.save!
@color = @user.pref_color
flash[:message] = 'Settings updated'[]
flash[:message] = t(:settings_updated)
redirect_to dashboard_url
end
end
@@ -98,17 +99,17 @@ class UsersController < ApplicationController
if !@user.nil?
setup_session(@user, (params[:remember_me] == "1"))
@user.update_attribute(:last_seen, Time.now.utc)
flash[:message] = 'Welcome back, {u}'[:login_success, @user.login]
flash[:message] = t(:welcome_back, :u => @user.login)
redirect_to_stored
else
flash[:warning] = 'Login failed'[]
flash[:warning] = t(:login_failed)
end
end
end
def logout
destroy_session
flash[:message] = 'You have logged out'[:logout_success]
flash[:message] = t(:logout_success)
redirect_to index_path
end

View File

@@ -1,3 +1,4 @@
# -*- encoding : utf-8 -*-
# Wiki UFC
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
#
@@ -43,7 +44,7 @@ class WikiController < ApplicationController
@wiki_page.course_id = @course.id
@wiki_page.description = "Nova página"
@wiki_page.save!
flash[:notice] = "Wiki page created"[]
flash[:notice] = t(:wiki_page_created)
WikiCreateLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course)
@@ -77,7 +78,7 @@ class WikiController < ApplicationController
if changed
@wiki_page.save!
WikiEditLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course, :version => @wiki_page.version)
flash[:notice] = "Wiki page updated"[]
flash[:notice] = t(:wiki_page_updated)
end
respond_to do |format|
@@ -89,7 +90,7 @@ class WikiController < ApplicationController
def destroy
@wiki_page.remove_from_list
@wiki_page.destroy
flash[:notice] = "Wiki page removed"[]
flash[:notice] = t(:wiki_page_removed)
log = WikiDeleteLogEntry.create!(:target_id => @wiki_page.id, :user => @current_user, :course => @course)
flash[:undo] = undo_course_log_url(@course, log)