Skip to content
This repository

Lil chain backend fix #85

Closed
wants to merge 2 commits into from

5 participants

Arkadiy Zabazhanov Bastien Vaucher Krzysztof Knapik Nicolás Hock Isaza Thomas Maximini
Arkadiy Zabazhanov

No description provided.

Bastien Vaucher

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

Krzysztof Knapik
Collaborator
knapo commented March 14, 2011

Can you please add a test as well ? :)

Arkadiy Zabazhanov

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

Krzysztof Knapik
Collaborator
knapo commented March 16, 2011

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

Nicolás Hock Isaza

+1 Please merge this :-)

Krzysztof Knapik knapo closed this March 24, 2011
Krzysztof Knapik
Collaborator
knapo commented March 24, 2011

Sorry for the dealy. Pushed. Thanks for fix!

Thomas Maximini

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...

Nicolás Hock Isaza
nhocki commented July 01, 2011

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 =/

Arkadiy Zabazhanov

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

Nicolás Hock Isaza
nhocki commented July 01, 2011

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

Thomas Maximini

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.
2  lib/i18n/backend/chain.rb
@@ -29,7 +29,7 @@ def reload!
29 29
         end
30 30
 
31 31
         def store_translations(locale, data, options = {})
32  
-          backends.first.store_translations(locale, data, options = {})
  32
+          backends.first.store_translations(locale, data, options)
33 33
         end
34 34
 
35 35
         def available_locales
5  test/backend/chain_test.rb
@@ -57,6 +57,11 @@ def setup
57 57
     assert_equal [{ :short => 'short', :long => 'long' }, { :one => 'one' }, 'Bah'], I18n.t([:formats, :plural_2, :bah], :default => 'Bah')
58 58
   end
59 59
 
  60
+  test "store_translations options are not dropped while transfering to backend" do
  61
+    @first.expects(:store_translations).with(:foo, {:bar => :baz}, {:option => 'persists'})
  62
+    I18n.backend.store_translations :foo, {:bar => :baz}, {:option => 'persists'}
  63
+  end
  64
+
60 65
   protected
61 66
 
62 67
     def backend(translations)
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.