Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I don't know how to translate text that I use as placeholder for my comment form. I have a function in my function.php file where is defined how comment form should look like. Here is example of that code:

    $fields =  array(
        'author' => '<p class="comment-form-author">' .
                '<input id="author" name="author" placeholder="Name" type="text" required value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />',
        'email'  => '<p class="comment-form-email"> ' .
                '<input id="email" name="email" placeholder="E-mail" type="text" required value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
        'url'    => '<p class="comment-form-url">' .
                '<input id="url" name="url" placeholder="Website" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
     );

Can you help me here?

share|improve this question
    
What is 'placeholder' supposed to be? What should the result look like? –  s_ha_dum Jun 6 '13 at 15:59
    
Placeholder for exampe, for author is "Name". And I would like to add "Name" into .PO file so that user can change it. I tried to add placeholder="'._e( 'Name', 'tpmoments' ).'" but it doesnt work. @s_ha_dum –  Valeka Jun 6 '13 at 16:05

1 Answer 1

up vote 0 down vote accepted

In your code, you are concatenating a string but you are (from a comment) using a function that echos information-- _e(). You can't do that. You are printing the content wherever that array is constructed, which is not what you want.

Use __() instead.

share|improve this answer
    
Thanks! You were right, I used echo to get information from function. Works perfect! –  Valeka Jun 6 '13 at 16:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.