ACK with one note inline.
On 08/24/2010 05:00 PM, jzigmund(a)redhat.com wrote:
From: Jozef Zigmund<jzigmund(a)redhat.com>
---
deltacloud-aggregator.spec.in | 1 -
src/Rakefile | 18 ------------------
src/app/controllers/application_controller.rb | 3 +--
src/app/models/user_session.rb | 7 +------
src/config/environment.rb | 2 --
5 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/deltacloud-aggregator.spec.in b/deltacloud-aggregator.spec.in
index 6baf65e..38df894 100644
--- a/deltacloud-aggregator.spec.in
+++ b/deltacloud-aggregator.spec.in
@@ -21,7 +21,6 @@ Requires: ruby>= 1.8.1
Requires: ruby(abi) = 1.8
Requires: rubygem(rails)>= 2.1.1
Requires: rubygem(daemons)
-Requires: rubygem(gettext_rails)
Requires: rubygem(haml)
Requires: rubygem(nokogiri)>= 1.4.0
Requires: rubygem(will_paginate)
diff --git a/src/Rakefile b/src/Rakefile
index eebf798..37c683b 100644
--- a/src/Rakefile
+++ b/src/Rakefile
@@ -9,21 +9,3 @@ require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
-# Do not require 'gettext/utils' here, it breaks rdoc,
-# require it in tasks that actually need it instead
-
-desc "Create mo-files for L10n"
-task :makemo do
- require 'gettext/utils'
- GetText.create_mofiles(true, "po", "locale")
-end
-
-desc "Update pot/po files to match new version."
-task :updatepo do
- require 'gettext/utils'
- MY_APP_TEXT_DOMAIN = "ovirt"
- MY_APP_VERSION = "ovirt 0.0.1"
- GetText.update_pofiles(MY_APP_TEXT_DOMAIN,
- Dir.glob("{app,lib}/**/*.{rb,rhtml}"),
- MY_APP_VERSION)
-end
diff --git a/src/app/controllers/application_controller.rb
b/src/app/controllers/application_controller.rb
index 297654c..4ac3605 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -27,7 +27,6 @@ class ApplicationController< ActionController::Base
filter_parameter_logging :password, :password_confirmation
helper_method :current_user_session, :current_user
- init_gettext "ovirt"
layout :choose_layout
# General error handlers, must be in order from least specific
@@ -183,7 +182,7 @@ class ApplicationController< ActionController::Base
hash[:object] = ivar[1, ivar.size]
hash[:errors] ||= []
val.errors.each {|key,msg|
- arr.push([key, val.errors.on_with_gettext_activerecord(key).to_a].to_a)
+ arr.push([key, msg.to_a].to_a)
on_with_gettext_activerecord returns "full" messages (message includes
humanized attribute name), msg not. But it neverminds because I see
another 2 errors in instance_errors method (not relevant to this patch):
- won't work when there are errors on more than 1 instance variable
- on_with_gettext_activerecord returns array of all errors for
particular field, but val.errors.each loop adds these errors multiple times
so it's not usable (and it's not used) for now. But fixing this deserves
separate patch.
}
hash[:errors] += arr
end
diff --git a/src/app/models/user_session.rb b/src/app/models/user_session.rb
index b01cd33..b9b2224 100644
--- a/src/app/models/user_session.rb
+++ b/src/app/models/user_session.rb
@@ -20,10 +20,5 @@
# Likewise, all the methods added will be available for all controllers.
class UserSession< Authlogic::Session::Base
- # gettext_activerecord defines a gettext method for the activerecord
- # Validations module. Authlogic uses these Validations also but does
- # not define the gettext method. We define it here instead.
- def gettext(str)
- GetText._(str)
- end
+
end
diff --git a/src/config/environment.rb b/src/config/environment.rb
index 7863031..b10031d 100644
--- a/src/config/environment.rb
+++ b/src/config/environment.rb
@@ -41,8 +41,6 @@ Rails::Initializer.run do |config|
# config.gem "bj"
# config.gem "hpricot", :version => '0.6', :source =>
"http://code.whytheluckystiff.net"
# config.gem "aws-s3", :lib => "aws/s3"
- config.gem "gettext", :lib => "gettext_rails"
- config.gem "gettext", :lib => "gettext_activerecord"
config.gem "authlogic"
config.gem "deltacloud-client", :lib => "deltacloud"
config.gem "haml"