What's new? | Help | Directory | Sign in
Google
xres
Some Rails plugins.
  
  
  
  
    
Search
for
Updated Dec 28, 2007 by tekmon
Labels: ActiveCulture
InvariantRendering  
Invariant rendering.

Despite the type of your entry, be it plain string, textile formatted string, html escaped string, proc or theoretically any other user defined type, you'll use the same syntax for rendering it in your application. Rendering is chosen as a neutral term that can actually imply calling sprintf, calling html_escape, calling RedCloth, calling your proc, etc...

This allows for quite sensible flexibility especially considering that the entry type is defined on the per-culture basis so where, say, in English you'll have a plain string there in, say, Zulu you may have, say, a proc.

Basic syntax for rendering is as follows:

bundle.render(key, args...)

For your convenience a few synonymic ways are defined:

bundle.get(key, args...)
bundle.format(key, args...)
bundle.call(key, args...)

bundle[key].render(args...)
bundle[key].get(args...)
bundle[key].format(args...)
bundle[key].call(args...)
bundle[key][args...]
bundle[key] % arg
bundle[key] % [args...]

Parameterless rendering:

bundle.render(key)
bundle.get(key)
bundle.call(key)

bundle[key].value
bundle[key].v
bundle[key].render
bundle[key].get
bundle[key].call
bundle[key][]

Sign in to add a comment