WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] "Site Title" and "Tagline" are not changing (50 posts)

  1. m.yovkov
    Member
    Posted 1 year ago #

    I am using WordPress 3.4.2. Now I am trying to use Polylang 0.9.2. All is almost OK but unfortunately "Site Title" and "Tagline" are not changing if the language is changed. I am using Headway theme. Any suggestions?

    http://wordpress.org/extend/plugins/polylang/

  2. janpeeters
    Member
    Posted 1 year ago #

    Hi I have the same problem with site titel and tag line not translating. I'm using WP 3.4.2 (with Pagelines Framework).
    I read another post of someone that had the SEO All-in-One plugin installed and that caused the problem.
    I don't have that plugin. I've got Yoast SEO. Could the problem be similar because it's also a SEO plugin?

    Thanks for any help.
    Jan

  3. m.yovkov
    Member
    Posted 1 year ago #

    I am using Yoast SEO too. Unfortunately the translation of site title and tag line doesn't work even if the Yoast SEO is disabled.

  4. janpeeters
    Member
    Posted 1 year ago #

    Aha that's great troubleshooting. Thanks for the info. I hope one of the Polylang devs can shine a light.

  5. m.yovkov
    Member
    Posted 1 year ago #

    It works if I change the theme to "Twenty Eleven". If I use a theme "Headway Base" it does not work.

  6. janpeeters
    Member
    Posted 1 year ago #

    Chouby could you try to shed a light? My framework developer tells me that there framework supports all WordPress translation methods. Not sure if they're right.

  7. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Your framework supports WordPress translations method. It means that the theme can be translated. You canddisplay it in whatever language you want. So every static strings should be correctly translated on your multilingual site.

    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).

  8. janpeeters
    Member
    Posted 1 year ago #

    Sorry Chouby, I DID search, but the WordPress Forums are one medieval piece of work when it comes to searching and categorisation.
    Thanks for pointing me to the right post, I will research that and presumably find the solution.

    Thanks!
    Jan

  9. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

  10. janpeeters
    Member
    Posted 1 year ago #

    Wow thanks a lot, for the hint about Google and the links, that helps a lot!

  11. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    Wanted to check the following before I have to go fiddle with code. Not an expert at that.

    I got the following response from the Pagelines Frameworks devs:

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

    Have you got an idea why this would not work with Polylang?

    Thanks, Jan

  12. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    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

  13. janpeeters
    Member
    Posted 1 year ago #

    Okay good to know. I'll search further.

  14. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Did you try with the simplest multilingual install, Polylang + Twenty Ten and no other plugin ?

  15. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    No not with TwentyTen. I've only got Pagelines Framework installed. But I did test with only Polylang and PL Framework. And that didn't work either, so it can't be another plugin. I'm not using custom php functions that might override native PL Framework behaviour.
    So the 'bug' must probably be somewhere in a compatibility issue. Although PL is rock solid it must still probably be the PL Framework if you say that it works with TwentyTen.

    I've contacted the PL Framework devs again with your comment hopefully they can think again!

  16. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Ooops... I wrote something wrong. wp_title does return the title of the page displayed, without the site name, so it should not be concerned by our problem here, which should concern bloginfo('name') and bloginfo('description') only.

    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). Copy paste this in a file test.php

    <?php
    /*
    Plugin Name: tests for Polylang
    */
    
    add_filter('option_blogname', 'translate_bloginfo');
    add_filter('option_blogdescription', 'translate_bloginfo');
    
    function translate_bloginfo($value) {
    	return  __($value, 'pll_string');
    }

    Upload the file in your plugins directory and activate the plugin. And tell me if it solves your issue.

  17. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    You can also forget about the code above and just download the development version (0.9.2.3) in which I included it.
    http://downloads.wordpress.org/plugin/polylang.zip

  18. janpeeters
    Member
    Posted 1 year ago #

    Terrific Chouby. That's really great. The Blog title and tagline are now correctly translated.

    I'm not sure if I'd better start a new thread for the following, but since were here...
    I just noticed that the only thing that doesn't translate is the posts Metabar. When you look at http://www.janpeeters.nl/blog-english/ the 'posted on [date]' string is still in Dutch. Could this have to do with the same issue? Or should we do something else to solve this.

    Thanks again!

  19. m.yovkov
    Member
    Posted 1 year ago #

    It works perfect with Headway theme too. The Blog title and tagline are now correctly translated.

    Thank you Chouby!!

  20. janpeeters
    Member
    Posted 1 year ago #

    Chouby, sorry, the non-translating metabar has nothing to do with Polylang I guess. I type it somewhere in the theme so I have to find a way to translate these in some other way. Thanks again for the dev build it works great.

  21. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I guess these are strings which are stored in theme options. The main difficulty is to find the option where they are stored. Then, you can filter the option and, on admin side, register the strings with 'pll_register_string', on frontend side, translate them with 'pll__'.
    Examples in the links I gave you above can help. The best, however, is to create a separate personal plugin.

    I wonder. Does your theme contain a file name 'wpml-config.xml'?

  22. janpeeters
    Member
    Posted 1 year ago #

    Hi, I haven't been able to find a file with that name.
    I know they have a repository for translating the Pagelines Framework in other languages, but I'm afraid that this is only for the back-end and not for strings manually entered by end user.
    More info on their localisation here:
    http://www.pagelines.com/translation-localization-center
    http://www.pagelines.com/translate/projects/pagelines-framework

    I'll look into the plugin method. Thanks again.

  23. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    I was wondering. Is it a idea for a feature of Polylang that people could manually add strings on your Strings translation page for non-generic strings? I figured that if you can find the right string that is called from any theme you could add it there and fill in the translations?

    Best, Jan

  24. janpeeters
    Member
    Posted 1 year ago #

    Me again, I'm ping-ponging between the WP forum and Pagelines forum to try to solve this. I've started a thread on the PL forum with the request where the right options can be found and if there is a wpml-config.xml file. Hopefully we can tackle this and provide the people that are using Pagelines Framework with a solution.

  25. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I asked you about the wpml config file as it would have been a clue to know if the theme was compatible with WPML.

    It's good to see that Pagelines source code is freely available:
    http://phpxref.pagelines.com

    I found here that the theme manages to be compatible with WPML.
    I am not sure however that everything is managed in the function 'pagelines_magic_parse' in the file includes/library.options.php @ line 277.

    Maybe you can ask the authors to add string translation management by Polylang with something like:

    if (is_admin())
      pll_register_string($key, $string);
    else
      return pll__($string);

    The Polylang API works pretty much the same way as the WPML API, except that there is no group and that you must test 'is_admin' as 'pll_register_string' is not available on frontend and 'pll__' is not available on admin.

    To answer your second post, the problem is not to include a string in the string translation table, but how to tell the theme that it has to use the translated string

  26. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    FYI, the file 'wpml-config.xml' is one way to inform WPML it has to translate a string without using the WPML API. Pagelines uses directly the WPML API

  27. janpeeters
    Member
    Posted 1 year ago #

    Wow your a speedy responder, thanks. I will copy-paste your reply to the thread that I just mentioned and see what happens.

    Thanks for the great support!

  28. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Why did I not think to this before today??? It should be even easier if Polylang includes the WPML API! Thus all plugins and themes which use it would be compatible with Polylang without effort...

    Could you try the latest development version (0.9.2.4)?
    http://downloads.wordpress.org/plugin/polylang.zip

  29. janpeeters
    Member
    Posted 1 year ago #

    It's a brilliant idea but it's only working to some extend at the moment. But lets troubleshoot this over the next days because it feels like a smart move. In the following screenshot you can see new strings showing up in the strings screen:
    https://dl.dropbox.com/u/424822/Shared%20Screenshots/Polylang_924.png
    But besides the regular strings only two new show up, those are the titels of two sidebar text widgets that I conditionally show on Dutch and English pages that are about education ('opleiding' in Dutch) and Career ('loopbaan' in Dutch) To provide for translation I have to have two for each widget.
    How should this WPML API work?
    And is the API freely available?

  30. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    When I write that Polylang includes the WPML API, it just means that in 0.9.2.4 I created 2 function which have exactly the same names and parameters than in WPML. Thus the theme should believe that it calls WPML functions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic