# Gettext of variables

**URL:** <https://www.ruby-forum.com/t/gettext-of-variables/74470>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:45am UTC](https://www.ruby-forum.com/t/gettext-of-variables/74470 "2006-11-07T10:45:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Hauck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@Matthew\_Hauck](https://www.ruby-forum.com/u/Matthew_Hauck)\
**Post date:** [November 7, 2006, 10:45am UTC](https://www.ruby-forum.com/t/gettext-of-variables/74470/1 "2006-11-07T10:45:14Z")

</div>

Greetings!

Basically, I would like to do the following:

* * *

## string = ‘test string’ puts \_(string)

But, it seems that gettext does not seem to work on variables, only on  
literals. I am a newbie to gettext. I can get it to translate literals  
fine. But it will not translate variables, even when I am sure that  
the value of the variable is indeed translated in the mo file.

Any thoughts? Thanks!
