mynewsdesk / deprecated-translate

A Ruby on Rails plugin with a web interface for translating I18n texts
http://developer.newsdesk.se/2009/01/21/translate-new-rails-i18n-plugin-with-a-nice-web-ui
MIT License
346 stars 87 forks source link

Issue when people use double quotes for key #13

Open rapidos opened 13 years ago

rapidos commented 13 years ago

Hi guys, I'd love to make a pull request but I have really no idea on how I am supposed to do that (I believe I should add some tests)

Anyway, I guess it would be faster to just leave my thoughts here.

I am working on a project where the developers use to write <%=t ("home.login") %> wich isn't detected by your regexp.

Here is the new one:

def i18n_lookup_pattern
  /\b(?:I18n\.t|I18n\.translate|t)(?:\s|\():?["|']([a-z0-9_]+.[a-z0-9_.]+)["|']\)?/
end

I just replaced the single quotes by ["|']

Hope this helps!

PS: If you are down to explain me the process to make a proper pull request I'd love to hear from you.

Julien