projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab3e5e6
)
Add custom pluralizer for Slovenian. Fixes #2049.
author
Tom Hughes
<tom@compton.nu>
Mon, 13 Jul 2009 08:47:59 +0000
(08:47 +0000)
committer
Tom Hughes
<tom@compton.nu>
Mon, 13 Jul 2009 08:47:59 +0000
(08:47 +0000)
config/initializers/i18n.rb
patch
|
blob
|
history
diff --git
a/config/initializers/i18n.rb
b/config/initializers/i18n.rb
index 54a925e3cd6ee85deab7f85cba7968be03168ce4..a061d873a2eab5e9b03cc079944bb1794ed978cc 100644
(file)
--- a/
config/initializers/i18n.rb
+++ b/
config/initializers/i18n.rb
@@
-2,3
+2,5
@@
require 'globalize/i18n/missing_translations_log_handler'
I18n.missing_translations_logger = Logger.new("#{RAILS_ROOT}/log/missing_translations.log")
I18n.exception_handler = :missing_translations_log_handler
+
+I18n.backend.add_pluralizer :sl, lambda { |c| c%100 == 1 ? :one : c%100 == 2 ? :two : (3..4).include?(c%100) ? :few : :other }