Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Welcome Rails Developers
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pietro  
View profile  
 More options Aug 7 2008, 5:52 pm
From: pietro <pietro.ferr...@gmail.com>
Date: Thu, 7 Aug 2008 14:52:35 -0700 (PDT)
Local: Thurs, Aug 7 2008 5:52 pm
Subject: Re: Welcome Rails Developers
i adapted some code from gibberish and added it to my environment.rb.
so "Foo"[:foo] will return I18n.t(:foo, :default => "Foo").

module StringExt
  def brackets_with_translation(*args)
    args = [underscore.tr(' ', '_').to_sym] if args.empty?
    return brackets_without_translation(*args) unless args.first.is_a?
Symbol
    I18n.translate(args.first, :default => self)
  end

  def self.included(base)
    base.class_eval do
      alias :brackets :[]
      alias_method_chain :brackets, :translation
      alias :[] :brackets
    end
  end
end

String.send :include, StringExt


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google