Jump to content


Photo
- - - - -

Translating 'search In Navbar And Widget


Best Answer batman† , 14 December 2012 - 10:00 AM

Hi Niels

 

You can use this, add to Pagelines Customize (plugin)

It is advisable to learn how to do this on your own too.  

Check out http://www.pagelines...wiki/Custom_CSS

 

 

add_filter('pagelines_search_form','override_search_form');

function override_search_form() {

$searchfield = sprintf('<input type="text" value="" name="s" class="searchfield" placeholder="%s" />', 'Buscar'); // modify here

$searchform = sprintf('<form method="get" class="searchform" onsubmit="this.submit();return false;" action="%s/" ><fieldset>%s</fieldset></form>', home_url(), $searchfield);

return $searchform;

}

 

Please change "Buscar" (spanish) for Dutch

;)

Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1 nionwebdesign

nionwebdesign

    Newbie

  • Members
  • 8 posts

Posted 14 December 2012 - 09:55 AM

Hi there,

 

How can I translate the 'search'  text that got displayed in the primary navigation bar and the search widget? I've already added to Dutch .mo file in my custom template language folder but with no result (all other parts are translated though).

 

I've also looked into searchform.php file in the template but there's much to be seen there. Same for the nav and navbar sections of the template. 

 

The default Wordpress settings in the config.php are also set to Dutch.

 

Any help is much appreciated.

 

Niels



#2 batman†

batman

    Bat Learning

  • DMS Subscriber†
  • 2282 posts

Posted 14 December 2012 - 10:00 AM   Best Answer

Hi Niels

 

You can use this, add to Pagelines Customize (plugin)

It is advisable to learn how to do this on your own too.  

Check out

Please Login or Register to see this Hidden Content

 

 

add_filter('pagelines_search_form','override_search_form');

function override_search_form() {

$searchfield = sprintf('<input type="text" value="" name="s" class="searchfield" placeholder="%s" />', 'Buscar'); // modify here

$searchform = sprintf('<form method="get" class="searchform" onsubmit="this.submit();return false;" action="%s/" ><fieldset>%s</fieldset></form>', home_url(), $searchfield);

return $searchform;

}

 

Please change "Buscar" (spanish) for Dutch

;)



#3 nionwebdesign

nionwebdesign

    Newbie

  • Members
  • 8 posts

Posted 14 December 2012 - 10:30 AM

Hi Bat,

 

This should go into the functions.php file in the custom template folder right?

I just did that but it still shows the English 'search'...

 

What am I doing wrong?



#4 batman†

batman

    Bat Learning

  • DMS Subscriber†
  • 2282 posts

Posted 14 December 2012 - 01:28 PM

Hi again

The function.php file is right.

I don´t know but I suppose that your Dutch .mo need other filter in Dutch

 

Wait for a Professional Moderation Team´s reply, I´m only a newbie.

:)



#5 Jean-Philippe†

Jean-Philippe

    Super Member

  • DMS Subscriber†
  • 116 posts

Posted 08 February 2013 - 05:12 AM

Thank you Batman, it worked well for me!