# Newbie question

**URL:** <https://www.ruby-forum.com/t/newbie-question/115849>\
**Category:** Rails\
**Created:** [September 29, 2007, 4:59am UTC](https://www.ruby-forum.com/t/newbie-question/115849 "2007-09-29T04:59:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 4:59am UTC](https://www.ruby-forum.com/t/newbie-question/115849/1 "2007-09-29T04:59:52Z")

</div>

Can any tell me what this should be doing? What does [:sidebar\_title]  
do?

\<%= ‘here is a title’[:sidebar\_title] %\>

Thanks!  
JB

---

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 6:39am UTC](https://www.ruby-forum.com/t/newbie-question/115849/2 "2007-09-29T06:39:13Z")

</div>

That is not correct syntax. It looks like you are missing the name of  
the hash. I should look something like:

\<%= 'here is a title ’ + some\_hash[:sidebar\_title] %\>

Where some\_hash is a hash defined in your controller. If you pasted the  
code from your controller, I could help you further.

---

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 7:45am UTC](https://www.ruby-forum.com/t/newbie-question/115849/3 "2007-09-29T07:45:59Z")

</div>

I agree, it doesn’t look like correct syntax. The code is from the  
beast forum.  
All the code is available here:  
[http://svn.techno-weenie.net/projects/beast/trunk/](http://svn.techno-weenie.net/projects/beast/trunk/)  
They use syntax like that in the view all over the place:  
\<%= ‘What is Beast?’[:beast\_sidebar\_title] %\>  
The views are in .html.erb files.

---

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 8:09am UTC](https://www.ruby-forum.com/t/newbie-question/115849/4 "2007-09-29T08:09:23Z")

</div>

FYI - figured this out. This is an example of the syntax used if you  
are using the Gibberish plugin. It is a localization library used for  
doing translation to other languages, defining repetition strings,  
etc.

If you want more info there is a really quick and informative  
introduction here:  
[http://plugins.require.errtheblog.com/browser/gibberish/README](http://plugins.require.errtheblog.com/browser/gibberish/README)

---

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 5:37pm UTC](https://www.ruby-forum.com/t/newbie-question/115849/5 "2007-09-29T17:37:03Z")

</div>

That makes sense, just looks strange at first glance. I haven’t had to  
deal with internationalization yet luckily.

---

<div class="post-metadata">

**Author:** ![Jables](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@Jables](https://www.ruby-forum.com/u/Jables)\
**Post date:** [September 29, 2007, 8:06am UTC](https://www.ruby-forum.com/t/newbie-question/115849/6 "2007-09-29T08:06:28Z")

</div>

I haven’t looked in depth at the Beast code, but that looks like it’s  
there for internationalization. Cf. the Gibberish plugin [1], which  
overrides String#[] for this purpose. :sidebar\_title is an index into a  
translation table (for other languages), while the string is there so  
that English-speaking developers can modify without breaking too much  
flow.

[1] [http://errtheblog.com/post/4396](http://errtheblog.com/post/4396)
