title: How can I make the Rails 3 router localize URLs using localization files?
body: <p>What I'd like to be able to do is:</p>
  
  <p>in config/routes.rb</p>
  
  <pre><code>resources :posts
  </code></pre>
  
  <p>in config/locale/en.yml</p>
  
  <pre><code>en:
    resources:
      posts: "posts"
      new: "new"
      edit: "edit"
  </code></pre>
  
  <p>in config/locale/tr.yml</p>
  
  <pre><code>tr:
    resources:
      posts: "yazilar"
      new: "yeni"
      edit: "duzenle"
  </code></pre>
  
  <p>and get</p>
  
  <pre><code>I18n.locale = :en
  edit_post_path(3) #=&gt; /posts/3/edit
  
  I18n.locale = :tr
  edit_post_path(3) #=&gt; /yazilar/3/duzenle
  </code></pre>
  
  <p>I'd also like Rails to match any of these routes anytime and pass the associated locale in the params hash such that when I navigate to <code>/yazilar</code> , the request should be routed to the <code>posts#index</code> action with the <code>:tr</code> locale in the params hash.</p>
  
  <p>Any simple or complex way of doing that?</p>