remove trailing white-spaces from lib/redmine/i18n.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-09-01 00:45:09 +00:00
parent 9957c3c98a
commit 87faf96f6a
1 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ module Redmine
def self.included(base) def self.included(base)
base.extend Redmine::I18n base.extend Redmine::I18n
end end
def l(*args) def l(*args)
case args.size case args.size
when 1 when 1
@ -25,12 +25,12 @@ module Redmine
k = "#{options[:prefix]}#{s}".to_sym k = "#{options[:prefix]}#{s}".to_sym
::I18n.t(k, :default => s.to_s.humanize) ::I18n.t(k, :default => s.to_s.humanize)
end end
def l_hours(hours) def l_hours(hours)
hours = hours.to_f hours = hours.to_f
l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => ("%.2f" % hours.to_f)) l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => ("%.2f" % hours.to_f))
end end
def ll(lang, str, value=nil) def ll(lang, str, value=nil)
::I18n.t(str.to_s, :value => value, :locale => lang.to_s.gsub(%r{(.+)\-(.+)$}) { "#{$1}-#{$2.upcase}" }) ::I18n.t(str.to_s, :value => value, :locale => lang.to_s.gsub(%r{(.+)\-(.+)$}) { "#{$1}-#{$2.upcase}" })
end end
@ -39,7 +39,7 @@ module Redmine
return nil unless date return nil unless date
Setting.date_format.blank? ? ::I18n.l(date.to_date) : date.strftime(Setting.date_format) Setting.date_format.blank? ? ::I18n.l(date.to_date) : date.strftime(Setting.date_format)
end end
def format_time(time, include_date = true) def format_time(time, include_date = true)
return nil unless time return nil unless time
time = time.to_time if time.is_a?(String) time = time.to_time if time.is_a?(String)
@ -52,7 +52,7 @@ module Redmine
def day_name(day) def day_name(day)
::I18n.t('date.day_names')[day % 7] ::I18n.t('date.day_names')[day % 7]
end end
def month_name(month) def month_name(month)
::I18n.t('date.month_names')[month] ::I18n.t('date.month_names')[month]
end end
@ -65,13 +65,13 @@ module Redmine
@@languages_lookup = valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k } @@languages_lookup = valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k }
@@languages_lookup[lang.to_s.downcase] @@languages_lookup[lang.to_s.downcase]
end end
def set_language_if_valid(lang) def set_language_if_valid(lang)
if l = find_language(lang) if l = find_language(lang)
::I18n.locale = l ::I18n.locale = l
end end
end end
def current_language def current_language
::I18n.locale ::I18n.locale
end end