lib/papla/backend.rb in papla-0.0.3 vs lib/papla/backend.rb in papla-0.0.4
- old
+ new
@@ -1,16 +1,11 @@
require 'i18n'
-I18n.load_path << File.expand_path('../locale/pl.yml', __FILE__)
-I18n.load_path << File.expand_path('../locale/pl.rb', __FILE__)
+I18n.load_path += Dir[File.expand_path('../locale/*', __FILE__)]
module Papla
class Backend
- def initialize(locale)
- @locale = locale
- end
-
def zero
translate(:zero)
end
def ones(index)
@@ -37,15 +32,14 @@
end
private
def translate(message, options = {})
- options[:locale] = @locale
options[:scope] = :papla
I18n.translate(message, options)
end
def pluralization_rule(number)
- I18n.translate(:papla, locale: @locale)[:pluralization][number]
+ I18n.translate(:papla)[:pluralization][number]
end
end
end