Jump to content


Photo
- - - - -
Resolved

Non-translation strings when using Polylang

polylang translation

  • Please log in to reply
5 replies to this topic

#1 janpeeters

janpeeters

    Advocate

  • Members

  • 307 posts
  • LocationBreda, The Netherlands
  • Country: Country Flag

Posted 03 October 2012 - 06:52 PM

Hi,

I'm using Polylang to translate my originally Dutch site into English. It works mostly very very well. A few strings don't translate however: site tag line and the post metabar. I contacted the developer of Polylang and he told me the following:

If the theme or a plugin uses the standard WordPress function to display the site title and the tagline (as of course themes developed by the WordPress team do!), then Polylang knows that it must translate these strings and so you can translate theme in Settings->Languages->Strings translations.
However, if the theme or a Plugin uses another way, then Polylang can't know by itself, so the theme or the plugin must inform Polylang about the string to translate.
This is done by the functions pll_register_string on admin side and pll__ . There are several examples in the forum on how to adapt themes or plugins (as well as some links in the doc).


When he gets to 'This is done by…' I've lost him. So hopefully someone has experience with this and can point me in the right direction.

Thanks, Jan
www.janpeeters.nl

#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 03 October 2012 - 08:49 PM

We use wp_title() filter and bloginfo( 'description' ) as per the wordpress theme standards.

#3 janpeeters

janpeeters

    Advocate

  • Members

  • 307 posts
  • LocationBreda, The Netherlands
  • Country: Country Flag

Posted 04 October 2012 - 08:02 PM

Hi Simon, I had to get back to Chouby, the Polylang dev. He answers the following:

wp_title, bloginfo('name') and bloginfo('description') should be correctly translated by Polylang except if a plugin overwrites what Polylang did before the theme displays.
And for me, it works with the combination I tested: WordPress SEO + Polylang + Twenty Ten


I did test with all plugins deactivated and only Pagelines Framework and Polylang activated.
Could you bend your mind once again as to how this could be possible?
I've considered WPML but it's above my budget at the moment, so I'm really trying to get Polylang to work. People are mostly very enthusiastic.

Thanks, Jan

#4 janpeeters

janpeeters

    Advocate

  • Members

  • 307 posts
  • LocationBreda, The Netherlands
  • Country: Country Flag

Posted 06 October 2012 - 09:15 AM

Hi, I thought I report back.

The latest Polylang development build solves the problem of the SIte title and tagline Chouby wrote:

I use the bloginfo filter to translate these strings. However you can try another filter which may work better with your theme (if they directly use get_option instead of bloginfo).

Later he posted a link to a new dev build that solved it.

The Metabar still doesn't so I'll contact him about that too.

Jan

#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 06 October 2012 - 07:32 PM

Great! I will resolve this. If you have further difficulties, please open a new topic and reference this one!

All the best!

#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 06 October 2012 - 07:32 PM

The topic was marked as resolved.





Also tagged with one or more of these keywords: Resolved, polylang, translation