# Variable embedded on a string

**URL:** <https://www.ruby-forum.com/t/variable-embedded-on-a-string/172077>\
**Category:** Rails\
**Created:** [July 14, 2009, 9:41am UTC](https://www.ruby-forum.com/t/variable-embedded-on-a-string/172077 "2009-07-14T09:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldoitalo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@aldoitalo](https://www.ruby-forum.com/u/aldoitalo)\
**Post date:** [July 14, 2009, 9:41am UTC](https://www.ruby-forum.com/t/variable-embedded-on-a-string/172077/1 "2009-07-14T09:41:32Z")

</div>

hi, i have a problem with inserting a variable embedded on a string.

The string is formed by two “%” at start and end wich i don’t know this  
usage (is a part of view\_helper.rb of the plugin will\_paginate):

%{ view **%d&nbsp;-&nbsp; %d** of **%d**  
totals} %

i want to modify in:

%{ #{I18n.t(’.mytranslation’)} **%d&nbsp;-&nbsp; %d**  
#{I18n.t(’.mytranslation’)} **%d**  
#{I18n.t(’.mytranslation’)} } %

but don’ t work.  
waht is the correct syntax for this string?
