Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix time ago locales error.

  • Loading branch information...
commit 5ad6259240aa2a8c656f617ce4f9401b0133eaf7 1 parent 75916ca
@chloerei authored
View
2  Gemfile
@@ -20,7 +20,7 @@ gem 'http_accept_language'
gem 'rails-i18n'
gem 'jquery-rails'
gem 'highlight_js-rails'
-gem 'rails-timeago', :git => 'git://github.com/jgraichen/rails-timeago.git'
+gem 'rails-timeago'
# Gems used only for assets and not required
# in production environments by default.
View
13 Gemfile.lock
@@ -4,14 +4,6 @@ GIT
specs:
client_side_validations (3.2.0.beta.3)
-GIT
- remote: git://github.com/jgraichen/rails-timeago.git
- revision: e1b3c142e54b1ed3c5dbf390a713477c1ce79a00
- specs:
- rails-timeago (1.4.0)
- actionpack (>= 3.1)
- activesupport (>= 3.1)
-
GEM
remote: http://rubygems.org/
specs:
@@ -134,6 +126,9 @@ GEM
railties (= 3.2.6)
rails-i18n (0.6.4)
i18n (~> 0.5)
+ rails-timeago (1.4.0)
+ actionpack (>= 3.1)
+ activesupport (>= 3.1)
railties (3.2.6)
actionpack (= 3.2.6)
activesupport (= 3.2.6)
@@ -198,7 +193,7 @@ DEPENDENCIES
mongoid
rails (= 3.2.6)
rails-i18n
- rails-timeago!
+ rails-timeago
redcarpet
rvm-capistrano
sass-rails
View
4 config/application.rb
@@ -55,7 +55,7 @@ class Application < Rails::Application
config.assets.precompile += %w(editor.js topics/show.js)
config.assets.precompile += %w(editor.css search.css)
- config.generators do |g|
+ config.generators do |g|
g.test_framework :test_unit, :fixture_replacement => :factory_girl
g.assets false
g.helper false
@@ -63,5 +63,5 @@ class Application < Rails::Application
end
end
-AllowLocale = %w(zh-CN en)
+AllowLocale = Dir["#{Rails.root}/config/locales/*.yml"].map {|f| File.basename(f).split('.').first}
APP_CONFIG = YAML.load_file("#{Rails.root}/config/app_config.yml")[Rails.env]
View
1  config/initializers/time_ago.rb
@@ -0,0 +1 @@
+Rails::Timeago.locales = AllowLocale
Please sign in to comment.
Something went wrong with that request. Please try again.