# Someone explain this output? \<%= 'Last Post'\[:last\_post\] %\>

**URL:** <https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677>\
**Category:** Rails\
**Created:** [November 29, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677 "2007-11-29T21:47:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [November 29, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677/1 "2007-11-29T21:47:23Z")

</div>

I am looking at the source of the forum software, Beast.

For most of the labels within the system, they structure their output  
like this :

\<%= ‘Last Post’[:last\_post] %\>

From observing the system running, it obviously outputs ‘Last Post’.

I see that there is a .yml file called en.yml that contains the  
following:

last\_post: Last Post

Can someone please explain the output statement above?

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [November 29, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677/2 "2007-11-29T22:09:47Z")

</div>

On Nov 29, 2007 3:47 PM, Jim J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> >

i18n  
([Internationalization and localization - Wikipedia](http://en.wikipedia.org/wiki/Internationalization_and_localization))

They’ve monkey-patched String to make the [] method do a string lookup  
for  
what text should go there. If nothing’s found, then nothing happens,  
otherwise the string gets replaced.

Jason

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [November 29, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677/3 "2007-11-29T22:14:28Z")

</div>

Yes, and Beast uses a plugin called Gibberish by Christ Wanstrath.  
What the plugin does is allow you to add several localizations so that  
you can offer your application in different languages.

On Nov 29, 3:47 pm, Jim J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [November 29, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677/4 "2007-11-29T22:15:03Z")

</div>

Yes, and Beast uses a plugin called Gibberish by Christ Wanstrath.  
What the plugin does is allow you to add several localizations so that  
you can offer your application in different languages.

On Nov 29, 3:47 pm, Jim J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [November 29, 2007, 10:20pm UTC](https://www.ruby-forum.com/t/someone-explain-this-output-last-post-last-post/121677/5 "2007-11-29T22:20:26Z")

</div>

Thanks guys. I appreciate the explanations.
