public
Description: Store translation strings in the database allowing you to update text without requiring a code deploy.
Clone URL: git://github.com/caring/gibberish_db.git
When we find a broken gibberish interpolation, log it and don't break. 
#1152
dustin (author)
Mon Apr 07 10:40:06 -0700 2008
dustin (committer)
Mon Apr 21 16:17:11 -0700 2008
commit  b9400064e3e6ad0b71c65e61888a5bf3525d1fd1
tree    3d75ef54d6f7742e67e7b0672d8e26d9dd191804
parent  3daf35a153c5937946febdde8f6894f9bd30962d
...
77
78
79
80
 
 
 
 
 
 
81
82
83
...
77
78
79
 
80
81
82
83
84
85
86
87
88
0
@@ -77,7 +77,12 @@ module Gibberish
0
 
0
     def interpolate_with_hash(string, hash)
0
       hash.inject(string) do |target, (search, replace)|
0
- target.gsub("{#{search}}", replace) if search and replace
0
+ if search and replace
0
+ target.gsub("{#{search}}", replace)
0
+ else
0
+ RAILS_DEFAULT_LOGGER.warn "Problem interpolating #{string} with #{hash.inspect}"
0
+ target
0
+ end
0
       end
0
     end
0
 

Comments

    No one has commented yet.