Coding for Fun

passionate hackers in Hong Kong. Agile, Ruby On Rails, Scala and Pen Test

Showing posts with label interpolation. Show all posts
Showing posts with label interpolation. Show all posts

Sunday, February 27, 2011

String interpolation in en.yml

suppose we need to create a copyright statement which shows current year dynamically.

in the language text file (en.yml), we expect a variable current_year:

in the layout view, we provide this current_year as hash:

張貼者: Unknown 於 11:24 PM 0 意見
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
標籤: i18n, interpolation, rails, ruby
Older Posts Home
Subscribe to: Posts (Atom)
  • Meetups
  • Projects
  • Coders

Hong Kong Meetups

  • Agile
  • Codeaholics
  • Ruby On Rails
  • Startups

Ru05 Projects

  • Web Services for HK Public Holidays
  • Comics Suggestion
  • Online Restaurant Menu
  • Green HK
  • 3dd13 Open Source Repository

Ru05 Coders

  • B
  • Hin
  • Unknown
  • Unknown

Blog Archive

  • ▼  2013 (10)
    • ▼  July (2)
      • Error: no candidate version available for postgres...
      • Ways to define a class in Javascript
    • ►  June (1)
    • ►  May (2)
    • ►  April (1)
    • ►  March (3)
    • ►  January (1)
  • ►  2012 (8)
    • ►  December (1)
    • ►  November (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
  • ►  2011 (77)
    • ►  November (1)
    • ►  October (1)
    • ►  September (4)
    • ►  August (5)
    • ►  July (8)
    • ►  June (8)
    • ►  May (11)
    • ►  April (13)
    • ►  March (4)
    • ►  February (13)
    • ►  January (9)
  • ►  2010 (6)
    • ►  December (1)
    • ►  September (3)
    • ►  May (1)
    • ►  April (1)