Someone explain this output? <%= 'Last Post'[:last_post] %>

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?

On Nov 29, 2007 3:47 PM, Jim J. [email protected]
wrote:

i18n
(Internationalization and localization - Wikipedia)

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

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. [email protected]

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. [email protected]

Thanks guys. I appreciate the explanations.