<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -44,6 +44,11 @@ Notice we don't use hashes (#) like normal Ruby interpolation.  Also, the names
 in the brackets don't really mean much.  Interpolation is done in order -- the first argument replaces
 the first variable in brackets, the second the second, etc.
 
+Interpolation can also be done via hash:
+
+  &gt;&gt; &quot;{name} is from {place}&quot;[:hey_place, { :place =&gt; 'Gotham City', :name =&gt; 'Batman' }]
+  =&gt; &quot;Batman is from Gotham City&quot;
+
 This of course works with your translations:
 
   $ cat lang/es.yml</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -59,7 +59,21 @@ module Gibberish
 
   private
     def interpolate_string(string, *args)
-      string.gsub(/\{\w+\}/) { args.shift }
+      if args.last.is_a? Hash
+        interpolate_with_hash(string, args.last)
+      else
+        interpolate_with_strings(string, args)
+      end
+    end
+
+    def interpolate_with_hash(string, hash)
+      hash.inject(string) do |target, (search, replace)|
+        target.sub(&quot;{#{search}}&quot;, replace)
+      end 
+    end
+
+    def interpolate_with_strings(string, strings)
+      string.gsub(/\{\w+\}/) { strings.shift }
     end
 
     def language_files</diff>
      <filename>lib/gibberish/localize.rb</filename>
    </modified>
    <modified>
      <diff>@@ -134,6 +134,14 @@ context &quot;A gibberish string (in general)&quot; do
     '{computer} omg?'[:puter, 'mac'].should.equal &quot;mac omg?&quot;
   end
 
+  specify &quot;should interpolate based on key if passed a hash&quot; do
+    'Hi, {user} of {place}'[:hi_there, { :place =&gt; 'france', :user =&gt; 'chris' }].should.equal &quot;Hi, chris of france&quot;
+
+    bands  = { 'other_bad_band' =&gt; 'Deputy', :good_band =&gt; 'Word Picture', 'bad_band' =&gt; 'Dagger' }
+    answer = 'Well, Dagger sucks and so does Deputy, but Word Picture is pretty rad.'
+    'Well, {bad_band} sucks and so does {other_bad_band}, but {good_band} is pretty rad.'[:snobbish, bands].should.equal answer
+  end
+
   specify &quot;should not affect existing string methods&quot; do
     string = &quot;chris&quot;
     answer = 'ch'</diff>
      <filename>test/gibberish_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9ea0649bc1e051f7e52e122ced35ad52d76ac13e</id>
    </parent>
  </parents>
  <author>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </author>
  <url>http://github.com/defunkt/gibberish/commit/94d37d0946e4ddea52bae67a12e2486796b5ced2</url>
  <id>94d37d0946e4ddea52bae67a12e2486796b5ced2</id>
  <committed-date>2007-05-08T23:48:41-07:00</committed-date>
  <authored-date>2007-05-08T23:48:41-07:00</authored-date>
  <message>add hash interpolation to gibberish</message>
  <tree>d1d43709f8bf9a9b2f96fa04d2e38e6cdfcf44e4</tree>
  <committer>
    <name>Chris Wanstrath</name>
    <email>chris@ozmm.org</email>
  </committer>
</commit>
