Joined January 2013
·

Gleb Mazovetskiy

London
·
·
·

Posted to My tricks for i18n in Rails over 1 year ago

Great tips! I love that you're using the commands in a way I never imagined they could be used (especially the Create a new tree branch example!).

I've just released v0.9.8 that adds 3 new tasks: mv, rm, and tree-mv.
They make mass-renaming much simpler and also allow for moving and merging the keys.
The first example in the article is now just:

i18n-tasks mv articles.filters articles.filter_data

This only finds the translations that are requested during the test run. To find missing keys pre-emptively with static analysis you can use i18n-tasks gem:

i18n-screenshot

i18n-screenshot

Posted to Rails Email Protips over 1 year ago

Thanks Steve! I found MailCatcher useful but having to trigger the email delivery inconvenient. REP instead provides a UI for previewing all the emails that the application can send:

rep

Saves the time to figure out where and how the email is sent whenever something needs changing.

Posted to Must have development Rails gems over 1 year ago

If you are dealing with i18n: https://github.com/glebm/i18n-tasks

Posted to The need for simple exercises over 1 year ago

This would make a good code golf:

(s) -> ((if s[i-1]==c then n++;'' else "#{x=n;n=1;x>1&&x||''}#{c}") for c,i in s+"$").join("")[..-2]

In ruby:

s.chars.inject(Hash.new 0){ |r,c| r[c] += 1; r }.map { |k,v| k + "#{v if v>1}" } * ''
Achievements
436 Karma
30,792 Total ProTip Views
Interests & Skills