• First of all, thanks for all the great support.

    I’m trying to translate things like the search function on my website (www.poetsgemak.nl). Currently it says: ‘To search type here and hit enter’. I want to translate it in to something dutch. I’ve tried two things:

    1. Download the .po and .mo file and open it with Poedit. Translate the text and upload the new files to my website. This didn’t translate the things i wanted.

    2. Opened the searchform.php and changes the text ‘To search type here and hit enter’. When i changed a word it works but when i change the whole sentence i get an error:

    Parse error: syntax error, unexpected ‘?’ in /home/deb82970/domains/poetsgemak.nl/public_html/wp-content/themes/hueman/searchform.phpon line 3

    Don’t really now what i’m doing wrong. Maybe it is because i use a child theme and uploaded the files tot het parent theme. But i’m a little bit stuck, so i’m hoping for your help!

    I’m curious what you’ve used to translate the text in the search field or sentences like ‘previous story’/’you may also like this’.

    Thank you in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • You did right thing. But maybe you have deleted some more ‘ ‘ character in the code of search.php. If you delete it, the site would error when running like what you see.
    ‘To search type here and hit enter’
    will be replaced with
    Another language meaning – what you want
    Do not delete ‘ ‘ (it’s important, make the code right.

    <input type="text" class="search" name="s" onblur="if(this.value=='')this.value='<?php _e('To search type here and hit enter','hueman'); ?>';" onfocus="if(this.value=='<?php _e('To search type here and hit enter','hueman'); ?>')this.value='';" value="<?php _e('To search type here and hit enter','hueman'); ?>" />

    i’m sorry, searchform.php, line 3. Poetsgemak
    Upload it to the Hueman directory, not Hueman-child.

    Thread Starter Poetsgemak

    (@poetsgemak)

    Max_iT, thanks for the quick response.

    I’ve followed you’re action and changed the text like this:

    <form method=”get” class=”searchform themeform” action=”<?php echo home_url(‘/’); ?>”>
    <div>
    <input type=”text” class=”search” name=”s” onblur=”if(this.value==”)this.value='<?php _e(‘Type hier om te zoeken en druk op enter’,’hueman’); ?
    >’;” onfocus=”if(this.value=='<?php _e(‘Type hier om te zoeken en druk op enter’,’hueman’); ?
    >’)this.value=”;” value=”<?php _e(‘Type hier om te zoeken en druk op enter’,’hueman’); ?>” />
    </div>
    </form>

    Maybe i’ve change the layout of the code in the wrong way. I’m just a guy trying to understand a little bit of CSS. So your help would be great.

    Do you spot a mistake?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘translate searchform and other lines’ is closed to new replies.