Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Lil chain backend fix #85

Closed
wants to merge 2 commits into from

5 participants

@pyromaniac

No description provided.

@bastien

+1 Was wondering why my keys were always escaped despite the escape options set to false.

@knapo
Collaborator

Can you please add a test as well ? :)

@pyromaniac

I can, but what should i test? Or it was a joke?

@knapo
Collaborator

Not joking this time :) Just add a simple test for your fix, which ensure that "options are not dropped while transfering to backend". Thx!

@nhocki

+1 Please merge this :-)

@knapo knapo closed this
@knapo
Collaborator

Sorry for the dealy. Pushed. Thanks for fix!

@tmaximini

what do i need to do in order to get it working? my backendchain (redis, simple) is still not accepting any escape option and still escaping the "." dots in my key string...

@nhocki

This was pushed but a new gem version (0.5.1) was never released so the patch is not working for rails.

I did the most horrible thing though... created an initializer with this:

module I18n
  module Backend
    class Chain
      module Implementation
        def store_translations(locale, data, options = {})
          backends.first.store_translations(locale, data, options)
        end
      end
    end
  end
end

That fixes the problem =/

@pyromaniac

Holy crap. This is really sad. I'll try to patch it arain soon ) They just forgot about chis patch (

@nhocki

Yeah, I reported this on #100 ... there's a bundler fix posted by @knapo

@tmaximini

ah ok, thanks for the heads up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +1 −1  lib/i18n/backend/chain.rb
  2. +5 −0 test/backend/chain_test.rb
View
2  lib/i18n/backend/chain.rb
@@ -29,7 +29,7 @@ def reload!
end
def store_translations(locale, data, options = {})
- backends.first.store_translations(locale, data, options = {})
+ backends.first.store_translations(locale, data, options)
end
def available_locales
View
5 test/backend/chain_test.rb
@@ -57,6 +57,11 @@ def setup
assert_equal [{ :short => 'short', :long => 'long' }, { :one => 'one' }, 'Bah'], I18n.t([:formats, :plural_2, :bah], :default => 'Bah')
end
+ test "store_translations options are not dropped while transfering to backend" do
+ @first.expects(:store_translations).with(:foo, {:bar => :baz}, {:option => 'persists'})
+ I18n.backend.store_translations :foo, {:bar => :baz}, {:option => 'persists'}
+ end
+
protected
def backend(translations)
Something went wrong with that request. Please try again.