From 7a8e3ec065b266a6c29d96807561ba932de7de89 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Fri, 12 Jul 2013 14:14:54 -0400 Subject: [PATCH] Replaced Gibberish by Rails 2.2+ I18n --- app/controllers/application_controller.rb | 11 +- app/controllers/attachments_controller.rb | 7 +- app/controllers/courses_controller.rb | 7 +- app/controllers/events_controller.rb | 7 +- app/controllers/log_controller.rb | 1 + app/controllers/news_controller.rb | 7 +- app/controllers/stylesheets_controller.rb | 1 + app/controllers/users_controller.rb | 15 +- app/controllers/wiki_controller.rb | 7 +- app/helpers/application_helper.rb | 3 +- app/helpers/attachments_helper.rb | 1 + app/helpers/courses_helper.rb | 1 + app/helpers/events_helper.rb | 1 + app/helpers/log_helper.rb | 1 + app/helpers/news_helper.rb | 1 + app/helpers/stylesheets_helper.rb | 1 + app/helpers/user_helper.rb | 1 + app/helpers/wiki_helper.rb | 1 + app/models/attachment.rb | 6 +- app/models/course.rb | 1 + app/models/event.rb | 1 + app/models/log_entry.rb | 1 + app/models/log_entry/attachment_log_entry.rb | 1 + app/models/log_entry/event_log_entry.rb | 1 + app/models/log_entry/news_log_entry.rb | 1 + app/models/log_entry/wiki_log_entry.rb | 1 + app/models/message.rb | 1 + app/models/notifications.rb | 1 + app/models/user.rb | 1 + app/models/wiki_page.rb | 1 + app/views/layouts/_base.html.haml | 2 +- app/views/log/index.rss.builder | 2 +- app/views/news/index.rss.builder | 2 +- app/views/users/dashboard.rss.builder | 2 +- app/views/users/show.html.haml | 4 +- app/views/widgets/_menu_navigation.html.haml | 4 +- app/views/widgets/_menu_user.html.haml | 8 +- config/environment.rb | 19 +- config/environments/development.rb | 2 + config/environments/production.rb | 2 + config/initializers/load_app_config.rb | 2 +- config/locales/pt-BR.yml | 78 ++++++++ test/test_helper.rb | 4 + vendor/plugins/gibberish/LICENSE | 18 -- vendor/plugins/gibberish/README | 113 ----------- vendor/plugins/gibberish/init.rb | 3 - vendor/plugins/gibberish/lang/es.yml | 3 - vendor/plugins/gibberish/lang/fr.yml | 3 - vendor/plugins/gibberish/lib/gibberish.rb | 10 - .../lib/gibberish/activerecord_ext.rb | 20 -- .../gibberish/lib/gibberish/localize.rb | 70 ------- .../gibberish/lib/gibberish/string_ext.rb | 17 -- .../plugins/gibberish/test/gibberish_test.rb | 182 ------------------ 53 files changed, 169 insertions(+), 492 deletions(-) delete mode 100644 vendor/plugins/gibberish/LICENSE delete mode 100644 vendor/plugins/gibberish/README delete mode 100644 vendor/plugins/gibberish/init.rb delete mode 100644 vendor/plugins/gibberish/lang/es.yml delete mode 100644 vendor/plugins/gibberish/lang/fr.yml delete mode 100644 vendor/plugins/gibberish/lib/gibberish.rb delete mode 100644 vendor/plugins/gibberish/lib/gibberish/activerecord_ext.rb delete mode 100644 vendor/plugins/gibberish/lib/gibberish/localize.rb delete mode 100644 vendor/plugins/gibberish/lib/gibberish/string_ext.rb delete mode 100644 vendor/plugins/gibberish/test/gibberish_test.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1e9f009..e6bdaa5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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] diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5f028d9..248f517 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 63187dc..2f303b9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -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 } diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 1f69260..41fc2da 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -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) diff --git a/app/controllers/log_controller.rb b/app/controllers/log_controller.rb index afa3de2..d54386c 100644 --- a/app/controllers/log_controller.rb +++ b/app/controllers/log_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index d98ef3f..beeb686 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -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) diff --git a/app/controllers/stylesheets_controller.rb b/app/controllers/stylesheets_controller.rb index e1e41fc..5654924 100644 --- a/app/controllers/stylesheets_controller.rb +++ b/app/controllers/stylesheets_controller.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1e55a34..02e68d6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 425e900..6eb8b21 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -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) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7fac45c..832c45b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # @@ -32,7 +33,7 @@ module ApplicationHelper for name in FLASH_NAMES if flash[name] output << "" end end diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index d0c2fe9..fdd2e44 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 8466d97..b55ec15 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 75a4596..bf0ea7b 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/log_helper.rb b/app/helpers/log_helper.rb index 9fb041a..ed36ad3 100644 --- a/app/helpers/log_helper.rb +++ b/app/helpers/log_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/news_helper.rb b/app/helpers/news_helper.rb index e778b83..59a3b0d 100644 --- a/app/helpers/news_helper.rb +++ b/app/helpers/news_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/stylesheets_helper.rb b/app/helpers/stylesheets_helper.rb index 2b471c2..8df713b 100644 --- a/app/helpers/stylesheets_helper.rb +++ b/app/helpers/stylesheets_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/user_helper.rb b/app/helpers/user_helper.rb index 16eb418..a77ec1e 100644 --- a/app/helpers/user_helper.rb +++ b/app/helpers/user_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index da8e13d..8ff7c45 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 6464745..ef04f15 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 diff --git a/app/models/course.rb b/app/models/course.rb index f19fd18..1b1e94e 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/event.rb b/app/models/event.rb index 4e20a75..9a1f41d 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/log_entry.rb b/app/models/log_entry.rb index 3baac3c..b002951 100644 --- a/app/models/log_entry.rb +++ b/app/models/log_entry.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/log_entry/attachment_log_entry.rb b/app/models/log_entry/attachment_log_entry.rb index f38429d..64d9007 100644 --- a/app/models/log_entry/attachment_log_entry.rb +++ b/app/models/log_entry/attachment_log_entry.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/log_entry/event_log_entry.rb b/app/models/log_entry/event_log_entry.rb index 23cd8ef..5efe863 100644 --- a/app/models/log_entry/event_log_entry.rb +++ b/app/models/log_entry/event_log_entry.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/log_entry/news_log_entry.rb b/app/models/log_entry/news_log_entry.rb index dfedcea..0a984ce 100644 --- a/app/models/log_entry/news_log_entry.rb +++ b/app/models/log_entry/news_log_entry.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/log_entry/wiki_log_entry.rb b/app/models/log_entry/wiki_log_entry.rb index 021540a..eada04c 100644 --- a/app/models/log_entry/wiki_log_entry.rb +++ b/app/models/log_entry/wiki_log_entry.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/message.rb b/app/models/message.rb index a2669d1..995dd61 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/notifications.rb b/app/models/notifications.rb index 985c7e0..26b5fd1 100644 --- a/app/models/notifications.rb +++ b/app/models/notifications.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/user.rb b/app/models/user.rb index ed288db..3886ef5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 7ab3ba6..4c9711f 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -1,3 +1,4 @@ +# -*- encoding : utf-8 -*- # Wiki UFC # Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante # diff --git a/app/views/layouts/_base.html.haml b/app/views/layouts/_base.html.haml index d1418c6..e407be6 100644 --- a/app/views/layouts/_base.html.haml +++ b/app/views/layouts/_base.html.haml @@ -29,7 +29,7 @@ #header_menu %ul - if logged_in? - %li.grey= "Logged in as {u}"[:logged_in_as, h(@current_user.display_name)] + %li.grey= t(:logged_in_as, :u => h(@current_user.display_name)) %li.last= link_to 'Logout', logout_path, :accesskey => 'l' - else %li= link_to 'Cadastrar', signup_path diff --git a/app/views/log/index.rss.builder b/app/views/log/index.rss.builder index 3a0c0b8..4925db2 100644 --- a/app/views/log/index.rss.builder +++ b/app/views/log/index.rss.builder @@ -1,7 +1,7 @@ xml.instruct! :xml, :version=>"1.0" xml.rss(:version=>"2.0") do xml.channel do - xml.title("#{App.title} - #{@course.full_name} - " + "Recent changes"[].titleize) + xml.title("#{App.title} - #{@course.full_name} - " + I18n.t(:recent_changes).titleize) xml.link(course_log_url(@course)) xml.language(App.language) xml.description("{course} recent changes"[:log_about, @course.full_name]) diff --git a/app/views/news/index.rss.builder b/app/views/news/index.rss.builder index fd562ff..528d4d0 100644 --- a/app/views/news/index.rss.builder +++ b/app/views/news/index.rss.builder @@ -1,7 +1,7 @@ xml.instruct! :xml, :version=>"1.0" xml.rss(:version=>"2.0") do xml.channel do - xml.title("#{App.title} - #{@course.full_name} - " + "News"[].titleize) + xml.title("#{App.title} - #{@course.full_name} - " + I18n.t(:news).titleize) xml.link(course_news_url(@course)) xml.language(App.language) xml.description("{course} news"[:news_about, @course.full_name]) diff --git a/app/views/users/dashboard.rss.builder b/app/views/users/dashboard.rss.builder index 6b4682d..b47ef36 100644 --- a/app/views/users/dashboard.rss.builder +++ b/app/views/users/dashboard.rss.builder @@ -1,7 +1,7 @@ xml.instruct! :xml, :version=>"1.0" xml.rss(:version=>"2.0") do xml.channel do - xml.title("#{App.title} - " + "News"[].titleize) + xml.title("#{App.title} - " + I18n.t(:news).titleize) xml.link(dashboard_url) xml.language(App.language) xml.description("{app} news"[:news_about, App.title]) diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index c9e219d..8fd3022 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -7,8 +7,8 @@ %img.avatar{:src => gravatar_url_for(@user.email)} %h1.title= h(@user.display_name) %p= h(@user.name) - %p= "Membro desde {c}"[:member_since, @user.created_at.strftime("%d de %B de %Y")] - %p= "Última visita há {c}"[:last_seen, distance_of_time_in_words(Time.now, @user.last_seen)] + %p= t(:member_since, :c => @user.created_at.strftime("%d de %B de %Y")) + %p= t(:last_seen, :c => distance_of_time_in_words(Time.now, @user.last_seen)) -# cache(user_path(@user.id)) do = @user.description.format_wiki if !@user.description.blank? diff --git a/app/views/widgets/_menu_navigation.html.haml b/app/views/widgets/_menu_navigation.html.haml index a71120e..2ea90c6 100644 --- a/app/views/widgets/_menu_navigation.html.haml +++ b/app/views/widgets/_menu_navigation.html.haml @@ -1,6 +1,6 @@ .menu %h1= App.title %ul - %li= link_to "Courses"[].titleize, courses_url, :accesskey => 'd' - %li= link_to "Users"[].titleize, users_url, :accesskey => 'p' + %li= link_to t(:courses).titleize, courses_url, :accesskey => 'd' + %li= link_to t(:users).titleize, users_url, :accesskey => 'p' %li= link_to "Mudanças recentes", log_url, :accesskey => 'r' diff --git a/app/views/widgets/_menu_user.html.haml b/app/views/widgets/_menu_user.html.haml index 5a014db..34c8c33 100644 --- a/app/views/widgets/_menu_user.html.haml +++ b/app/views/widgets/_menu_user.html.haml @@ -1,7 +1,7 @@ - if session[:user_id] .menu - %h1= "User"[].titleize + %h1= t(:user).titleize %ul - %li= link_to("Dashboard"[].titleize, dashboard_path, :accesskey => '.') - %li= link_to("User profile"[].titleize, user_url(@current_user), :accesskey => ',') - %li= link_to("Edit settings"[].titleize, settings_url, :accesskey => 's') + %li= link_to(t(:dashboard).titleize, dashboard_path, :accesskey => '.') + %li= link_to(t(:user_profile).titleize, user_url(@current_user), :accesskey => ',') + %li= link_to(t(:edit_settings).titleize, settings_url, :accesskey => 's') diff --git a/config/environment.rb b/config/environment.rb index b7e1c96..205824a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -43,8 +43,8 @@ Rails::Initializer.run do |config| # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. config.action_controller.session = { - :session_key => '_wikiufc_session_id', - :secret => '9194c999d4c15148e1fe79e5afe2b77f9f0878f8f8391b72ff62d2ee7243d21d809096b5171be863f56701aa21efbc487d725b3660e86d0022968c19797f6f75' + :key => '_wikiufc_session_id', + :secret => '9194c999d4c15148e1fe79e5afe2b77f9f0878f8f8391b72ff62d2ee7243d21d809096b5171be863f56701aa21efbc487d725b3660e86d0022968c19797f6f75' } # Use the database for sessions instead of the cookie-based default, @@ -64,19 +64,20 @@ Rails::Initializer.run do |config| config.active_record.default_timezone = :utc config.action_view.sanitized_allowed_tags = %W(p h1 h2 h3 h4 h5 h6 dl dt ol - ul li address blockquote del div hr ins pre a abbr acronym dfn em strong - code samp kbd var b i big small tt span br bdo cite del ins q sub sup - img map table tr td th colgroup col caption thead tbody tfoot) + ul li address blockquote del div hr ins pre a abbr acronym dfn em strong + code samp kbd var b i big small tt span br bdo cite del ins q sub sup + img map table tr td th colgroup col caption thead tbody tfoot) config.action_view.sanitized_allowed_attributes = %W(align alt border - cellpadding cellspacing cols colspan coords height href longdesc name - noresize nowrap rel rows rowspan rules scope shape size span src start - style summary title type usemap valign width) + cellpadding cellspacing cols colspan coords height href longdesc name + noresize nowrap rel rows rowspan rules scope shape size span src start + style summary title type usemap valign width) + + config.time_zone = 'America/Fortaleza' config.gem "bluecloth" config.gem "haml" config.gem "hpricot" config.gem "icalendar" - config.gem "brI18n" config.gem 'thoughtbot-shoulda', :lib => 'shoulda/rails', :source => "http://gems.github.com" end diff --git a/config/environments/development.rb b/config/environments/development.rb index 7988c03..53ffc28 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -19,3 +19,5 @@ config.action_view.debug_rjs = true # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false + +config.gem "brI18n" diff --git a/config/environments/production.rb b/config/environments/production.rb index 5a4e2b1..59ff2b1 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -16,3 +16,5 @@ config.action_controller.perform_caching = true # Disable delivery errors if you bad email addresses should just be ignored # config.action_mailer.raise_delivery_errors = false + +config.gem "brI18n" diff --git a/config/initializers/load_app_config.rb b/config/initializers/load_app_config.rb index aae4598..ea22d0b 100644 --- a/config/initializers/load_app_config.rb +++ b/config/initializers/load_app_config.rb @@ -18,4 +18,4 @@ required_fields.each do |field| end # Internacionalizacao -Gibberish.current_language = App.language if RAILS_ENV != 'test' +#Gibberish.current_language = App.language if RAILS_ENV != 'test' diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 8c651b3..aae2016 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,4 +1,82 @@ pt-BR: + course: disciplina + courses: disciplinas + course_created: Disciplina cadastrada + course_updated: Disciplina editada + course_removed: Disciplina excluída + + event: evento + events: eventos + event_created: Evento cadastrado + event_updated: Evento editado + event_removed: Evento excluído + event_restored: Evento restaurado + + news: notícias + news_created: Notícia cadastrada + news_updated: Notícia editada + news_removed: Notícia excluída + news_restored: Notícia restaurada + news_about: Notícias de {disciplina} + + user: usuário + users: usuários + user_account_updated: Perfil editado + user_account_removed: Conta removida + user_account_created: Conta cadastrada + + attachment_created: Arquivo criado + attachment_updated: Arquivo editado + attachment_removed: Arquivo excluído + attachment_restored: Arquivo restaurado + + wiki_page: Página wiki + wiki_page_created: Página wiki criada + wiki_page_removed: Página wiki removida + wiki_page_updated: Página wiki atualizada + wiki_page_restored: Página wiki restaurada + + recent_changes: Mudanças recentes + log_about: Mudanças recentes em {disciplina} + + undo: Desfazer + login_failed: Não foi possível fazer login + login_required: É necessário fazer login para acessar esta área do site + login_success: Olá, {u}! + logout_success: Você fez logout + + navigation: navegação + forums: fórums + + user_profile: perfil público + edit_settings: editar configurações + settings_updated: Configurações editadas + + is_too_large: é grande demais + is_needed: é requerido + + body: conteúdo + code: código + content: conteúdo + date: data + description: descrição + file: arquivo + file_name: nome do arquivo + full_name: nome completo + name: nome + password_confirmation: confirmação de senha + password: senha + period: semestre + short_name: nome abreviado + time: horário + title: título + + logged_in_as: Identificado como %{u} + member_since: Membro desde %{c} + last_seen: Última visita há %{c} + welcome_back: Bem vindo %{u} + dashboard: Dashboard + number: human: storage_units: diff --git a/test/test_helper.rb b/test/test_helper.rb index dec3b70..11032ef 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,6 +6,10 @@ require 'quietbacktrace' class ActiveSupport::TestCase + setup do + I18n.default_locale = :en + end + self.new_backtrace_silencer :shoulda do |line| line.include? 'vendor/plugins/shoulda' end diff --git a/vendor/plugins/gibberish/LICENSE b/vendor/plugins/gibberish/LICENSE deleted file mode 100644 index 03b4b0f..0000000 --- a/vendor/plugins/gibberish/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2007 Chris Wanstrath - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/plugins/gibberish/README b/vendor/plugins/gibberish/README deleted file mode 100644 index dd79c69..0000000 --- a/vendor/plugins/gibberish/README +++ /dev/null @@ -1,113 +0,0 @@ -= Gibberish - -Yet another localization library. Maybe with the most agreeable API? - -= Usage - -It's simple. Your default language, by default, is English (:en). - - >> "Hey there!"[:hey] - => "Hey there!" - -Gibberish looks in RAILS_ROOT/lang/*.yml for translation files. Say you have RAILS_ROOT/lang/es.yml, -right? Gibberish will detect that you know about the :es language and will serve up translations -defined in that file if requested to do so. - -Here's a real simple example file (it's just "key: translation"): - - $ cat lang/es.yml - hey: ¡Hey allí! - -And, as follows, a real simple example session: - - >> "Hey there!"[:hey] - => "Hey there!" - >> Gibberish.current_language - => :en - >> Gibberish.current_language = :es - => :es - >> "Hey there!"[:hey] - => "¡Hey allí!" - >> Gibberish.current_language = nil - => nil - >> "Hey there!"[:hey] - => "Hey there!" - -It even works with simple interpolation: - - >> "Hey, {name}!"[:hey_name, 'Chris'] - => "Hey, Chris!" - >> "{name} is from {place}"[:hey_place, 'Chris', 'the Dreamworld'] - => "Chris is from the Dreamworld" - -Notice we don't use hashes (#) like normal Ruby interpolation. Also, the names of the variables -in the brackets don't really mean much. Interpolation is done in order -- the first argument replaces -the first variable in brackets, the second the second, etc. - -This of course works with your translations: - - $ cat lang/es.yml - hey: ¡Hey allí! - hey_name: ¡Hola {name}! - - >> "Hey, {name}!"[:hey_name, 'Chris'] - => "Hey, Chris!" - >> Gibberish.current_language = :es - => :es - >> "Hey, {name}!"[:hey_name, 'Cristóbal'] - => ¡Hola Cristóbal! - -Neat. What other methods do we get? - -The classic around_filter: - - class ApplicationController < ActionController::Base - around_filter :set_language - - private - def set_language - Gibberish.use_language(session[:language]) { yield } - end - end - -For the duration of the block, :es is set as the language of choice. After the block is run everything -returns to normal. Rad. - -Finally, some checking methods, if you need them: - - >> Gibberish.default_language? - => true - >> Gibberish.current_language = :es - => :es - >> Gibberish.current_language - => :es - >> Gibberish.default_language? - => false - -Languages are loaded by default at Rails startup. In dev mode, language YAML files are reloaded when -modified. No need to reboot the server. - - >> Gibberish.load_languages! - => [:es, :fr, :de, :kl] - >> Gibberish.languages - => [:es, :fr, :de, :kl] - -More as it's needed. - -= Warning - -By default, Ruby returns nil when a symbol is passed to String's [] method. Some of Rails, it seems, depends -on this behavior. Yes, I am changing !!core Ruby behavior!! The humanity! - -To deal with this assumption, Gibberish has a reserved_keys array. It, by default, contains :limit (so Rails -migrations don't explode on you.) To add to this array, just pass it more keys: - - >> Gibberish.add_reserved_key :another_key - => [:limit, :another_key] - >> Gibberish.add_reserved_keys :more, :keys - => [:limit, :another_key, :more, :keys] - -You've been warned. It really shouldn't affect you, though. - ->> Chris Wanstrath -=> chris[at]ozmm[dot]org diff --git a/vendor/plugins/gibberish/init.rb b/vendor/plugins/gibberish/init.rb deleted file mode 100644 index 02586b3..0000000 --- a/vendor/plugins/gibberish/init.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'gibberish' - -Gibberish.load_languages! diff --git a/vendor/plugins/gibberish/lang/es.yml b/vendor/plugins/gibberish/lang/es.yml deleted file mode 100644 index de6be6b..0000000 --- a/vendor/plugins/gibberish/lang/es.yml +++ /dev/null @@ -1,3 +0,0 @@ -welcome_friend: ¡Recepción, amigo! -welcome_user: ¡Recepción, {user}! -love_rails: Amo los carriles. diff --git a/vendor/plugins/gibberish/lang/fr.yml b/vendor/plugins/gibberish/lang/fr.yml deleted file mode 100644 index f7c30c7..0000000 --- a/vendor/plugins/gibberish/lang/fr.yml +++ /dev/null @@ -1,3 +0,0 @@ -welcome_friend: Bienvenue, ami! -welcome_user: Bienvenue, {user}! -love_rails: J'aime des rails. diff --git a/vendor/plugins/gibberish/lib/gibberish.rb b/vendor/plugins/gibberish/lib/gibberish.rb deleted file mode 100644 index 0f03a4d..0000000 --- a/vendor/plugins/gibberish/lib/gibberish.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'gibberish/localize' -require 'gibberish/string_ext' -require 'gibberish/activerecord_ext' - -String.send :include, Gibberish::StringExt - -module Gibberish - extend Localize -end - diff --git a/vendor/plugins/gibberish/lib/gibberish/activerecord_ext.rb b/vendor/plugins/gibberish/lib/gibberish/activerecord_ext.rb deleted file mode 100644 index d9b341e..0000000 --- a/vendor/plugins/gibberish/lib/gibberish/activerecord_ext.rb +++ /dev/null @@ -1,20 +0,0 @@ -#module ActiveRecord -# class Errors -# def full_messages -# full_messages = [] -# -# @errors.each_key do |attr| -# @errors[attr].each do |msg| -# next if msg.nil? -# -# if attr == "base" -# full_messages << msg -# else -# full_messages << @base.class.human_attribute_name(attr.send("[]")) + " " + msg -# end -# end -# end -# full_messages -# end -# end -#end diff --git a/vendor/plugins/gibberish/lib/gibberish/localize.rb b/vendor/plugins/gibberish/lib/gibberish/localize.rb deleted file mode 100644 index 09ea6ac..0000000 --- a/vendor/plugins/gibberish/lib/gibberish/localize.rb +++ /dev/null @@ -1,70 +0,0 @@ -module Gibberish - module Localize - @@default_language = :en - mattr_reader :default_language - - @@reserved_keys = [ :limit ] - mattr_reader :reserved_keys - - def add_reserved_key(*key) - (@@reserved_keys += key.flatten).uniq! - end - alias :add_reserved_keys :add_reserved_key - - @@languages = {} - def languages - @@languages.keys - end - - @@current_language = nil - def current_language - @@current_language || default_language - end - - def current_language=(language) - load_languages! if defined? RAILS_ENV && RAILS_ENV == 'development' - - language = language.to_sym if language.respond_to? :to_sym - @@current_language = @@languages[language] ? language : nil - end - - def use_language(language) - start_language = current_language - self.current_language = language - yield - self.current_language = start_language - end - - def default_language? - current_language == default_language - end - - def translations - @@languages[current_language] || {} - end - - def translate(string, key, *args) - return if reserved_keys.include? key - File.open("#{RAILS_ROOT}/lang/tmp_keys", "a").puts key if ENV['GIBBERISH_EXPORT'] - target = translations[key] || string - interpolate_string(target.dup, *args.dup) - end - - def load_languages! - language_files.each do |file| - key = File.basename(file, '.*').to_sym - @@languages[key] = YAML.load_file(file).symbolize_keys - end - languages - end - - private - def interpolate_string(string, *args) - string.gsub(/\{\w+\}/) { args.shift } - end - - def language_files - Dir[File.join(RAILS_ROOT, 'lang', '*.{yml,yaml}')] - end - end -end diff --git a/vendor/plugins/gibberish/lib/gibberish/string_ext.rb b/vendor/plugins/gibberish/lib/gibberish/string_ext.rb deleted file mode 100644 index b498d56..0000000 --- a/vendor/plugins/gibberish/lib/gibberish/string_ext.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Gibberish - module StringExt - def brackets_with_translation(*args) - args = [underscore.tr(' ', '_').to_sym] if args.empty? - return brackets_without_translation(*args) unless args.first.is_a? Symbol - Gibberish.translate(self, args.shift, *args) - end - - def self.included(base) - base.class_eval do - alias :brackets :[] - alias_method_chain :brackets, :translation - alias :[] :brackets - end - end - end -end diff --git a/vendor/plugins/gibberish/test/gibberish_test.rb b/vendor/plugins/gibberish/test/gibberish_test.rb deleted file mode 100644 index 17bd14f..0000000 --- a/vendor/plugins/gibberish/test/gibberish_test.rb +++ /dev/null @@ -1,182 +0,0 @@ -begin - require 'rubygems' - require 'test/spec' -rescue LoadError - puts "==> The test/spec library (gem) is required to run the Gibberish tests." - exit -end - -$:.unshift File.dirname(__FILE__) + '/../lib' -require 'active_support' -require 'gibberish' - -RAILS_ROOT = '.' -Gibberish.load_languages! - -context "After loading languages, Gibberish" do - teardown do - Gibberish.current_language = nil - end - - specify "should know what languages it has translations for" do - Gibberish.languages.should.include :es - end - - specify "should know if it is using the default language" do - Gibberish.should.be.default_language - end - - specify "should be able to switch between existing languages" do - Gibberish.current_language = :es - string = "Welcome, friend!" - string[:welcome_friend].should.not.equal string - - Gibberish.current_language = :fr - string[:welcome_friend].should.not.equal string - - Gibberish.current_language = nil - string[:welcome_friend].should.equal string - end - - specify "should be able to switch languages using strings" do - Gibberish.current_language = 'es' - Gibberish.current_language.should.equal :es - end - - specify "should be able to switch to the default language at any time" do - Gibberish.current_language = :fr - Gibberish.should.not.be.default_language - - Gibberish.current_language = nil - Gibberish.should.be.default_language - end - - specify "should be able to switch to a certain language for the duration of a block" do - Gibberish.should.be.default_language - - string = "Welcome, friend!" - string[:welcome_friend].should.equal string - - Gibberish.use_language :es do - string[:welcome_friend].should.not.equal string - Gibberish.should.not.be.default_language - end - - Gibberish.should.be.default_language - string[:welcome_friend].should.equal string - end - - specify "should return an array of the languages it loaded" do - languages = Gibberish.load_languages! - languages.should.be.an.instance_of Array - languages.should.include :es - languages.should.include :fr - end - - specify "should know what languages it has loaded" do - languages = Gibberish.languages - languages.should.be.an.instance_of Array - languages.should.include :es - languages.should.include :fr - end - - specify "should be able to accept new, unique reserved keys" do - key = :something_evil - Gibberish.add_reserved_key key - Gibberish.reserved_keys.should.include key - Gibberish.reserved_keys.size.should.equal 2 - Gibberish.add_reserved_key key - Gibberish.add_reserved_key key - Gibberish.reserved_keys.size.should.equal 2 - end -end - -context "When no language is set" do - setup do - Gibberish.current_language = nil - end - - specify "the default language should be used" do - Gibberish.current_language.should.equal Gibberish.default_language - end - - specify "a gibberish string should return itself" do - string = "Welcome, friend!" - Gibberish.translate(string, :welcome_friend).should.equal string - - string[:welcome_friend].should.equal string - end -end - -context "When a non-existent language is set" do - setup do - Gibberish.current_language = :klingon - end - - specify "the default language should be used" do - Gibberish.current_language.should.equal Gibberish.default_language - end - - specify "gibberish strings should return themselves" do - string = "something gibberishy" - string[:welcome_friend].should.equal string - end -end - -context "A gibberish string (in general)" do - specify "should be a string" do - "gibberish"[:just_a_string].should.be.an.instance_of String - "non-gibberish".should.be.an.instance_of String - end - - specify "should interpolate if passed arguments and replaces are present" do - 'Hi, {user} of {place}'[:hi_there, 'chris', 'france'].should.equal "Hi, chris of france" - '{computer} omg?'[:puter, 'mac'].should.equal "mac omg?" - end - - specify "should not affect existing string methods" do - string = "chris" - answer = 'ch' - string[0..1].should.equal answer - string[0, 2].should.equal answer - string[0].should.equal 99 - string[/ch/].should.equal answer - string['ch'].should.equal answer - string['bc'].should.be.nil - string[/dog/].should.be.nil - end - - specify "should return nil if a reserved key is used" do - "string"[:limit].should.be.nil - end - - specify "should set default key to underscored string" do - Gibberish.current_language = :es - 'welcome friend'[].should == '¡Recepción, amigo!' - end -end - -context "When a non-default language is set" do - setup do - Gibberish.current_language = :es - end - - specify "that language should be used" do - Gibberish.current_language.should.equal :es - end - - specify "the default language should not be used" do - Gibberish.should.not.be.default_language - end - - specify "a gibberish string should return itself if a corresponding key is not found" do - string = "The internet!" - string[:the_internet].should.equal string - end - - specify "a gibberish string should return a translated version of itself if a corresponding key is found" do - "Welcome, friend!"[:welcome_friend].should.equal "¡Recepción, amigo!" - "I love Rails."[:love_rails].should.equal "Amo los carriles." - 'Welcome, {user}!'[:welcome_user, 'Marvin'].should.equal "¡Recepción, Marvin!" - end -end