diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-06-17 00:56:48 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-06-17 00:56:48 +0000 |
commit | 67fcd6eea7c4827d33e2ddbd0519b2120097c3b3 (patch) | |
tree | 6151cb6b91455d35642c6e6a0dbd1dfcf53e3144 /lib/redmine/i18n.rb | |
parent | d893bdcd768e22f203a7212fcb8a8400eb044c3f (diff) | |
download | redmine-67fcd6eea7c4827d33e2ddbd0519b2120097c3b3.tar.gz redmine-67fcd6eea7c4827d33e2ddbd0519b2120097c3b3.zip |
replace RAILS_ROOT to Rails.root at lib/redmine/i18n.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6082 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/i18n.rb')
-rw-r--r-- | lib/redmine/i18n.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb index f0cc529b0..29ff3281b 100644 --- a/lib/redmine/i18n.rb +++ b/lib/redmine/i18n.rb @@ -56,11 +56,11 @@ module Redmine def month_name(month) ::I18n.t('date.month_names')[month] end - + def valid_languages - @@valid_languages ||= Dir.glob(File.join(RAILS_ROOT, 'config', 'locales', '*.yml')).collect {|f| File.basename(f).split('.').first}.collect(&:to_sym) + @@valid_languages ||= Dir.glob(File.join(Rails.root, 'config', 'locales', '*.yml')).collect {|f| File.basename(f).split('.').first}.collect(&:to_sym) end - + def find_language(lang) @@languages_lookup = valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k } @@languages_lookup[lang.to_s.downcase] |