WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. janpeeters
    Member
    Posted 1 year ago #

    I'm not sure if I understand you well enough.
    So this means that in this latest test build you added the fields that occurred in the Strings Translation page or text widget titles? and does that mean that more should be added?
    Or do you mean that I should see a difference in the theme admin? That is not the case.
    Sorry that I have difficulty to grasp this.

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Widget titles should have already been here as Polylang should already translate widget titles.

    In the new dev version, I tried to add a new functionnality, so that plugins and themes believe that WPML is installed. So normally, all options which are translated by WPML should now be translated by Polylang too. But it seems that it does no work :(

  3. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I am a bit lost... I found this http://phpxref.pagelines.com/nav.html?wpml-config.xml.source.html but there is no wpml-config.xml in the file list (it should be directly in the pagelines directory, not in a subdirectory). So I don't understand how Pagelines asks WPML to translate the strings...

  4. janpeeters
    Member
    Posted 1 year ago #

    I've looked again and no WPML xml neither in there sourcecode website nor in my webfolder. What I did find is:
    http://phpxref.pagelines.com/includes/config.options.php.source.html in this file are all the options that we were looking for earlier I guess. Line 751 and 782 for example show the default values for the Post and Clip metabars.

    This still doesn't bring us to a full translation like with a WPML xml but maybe it points in a direction. I hope that the Framework devs will come back on this tomorrow. Maybe this link will have some info needed: http://developer.pagelines.com/resources/
    Or you could try to contact any of the devs directly via http://www.pagelines.com/contact/ They might be able to quickly point you to the right file.

  5. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    After studying the Pagelines code, I really wonder how Pagelines and WPML work together to translate these strings without the wpml-config.xml file...

    I made this: http://pastebin.com/hkdenAz7

  6. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    thanks, I updated to the new 0.9.3 Polylang plugin and pasted the code you created in a polylang_pagelines.php file, and uploaded that to my plugins folder and activated it.

    When activating the custom plugin I got the following error code:

    The plugin generated 4 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

    The strings that you included in the code do show up on the strings page, Great!!! But when I try to save the translations I get another error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/janpeete/domains/janpeeters.nl/public_html/cms/wp-content/plugins/polylang_pagelines.php:1) in /home/janpeete/domains/janpeeters.nl/public_html/cms/wp-includes/pluggable.php on line 881

    Also W3 Total Cache is not able to empty it's cache, it just hangs. No idea how that is possible.

    Regarding how Pagelines works together with WPML I have no information yet but I'm going to be persistent to get to the bottom of this. I think you have build a great plugin and people deserve alternatives besides WPML.

  7. janpeeters
    Member
    Posted 1 year ago #

    The w3 Total Cache problem seems to be caused by the custom plugin too.

  8. m.yovkov
    Member
    Posted 1 year ago #

    After upgrading to Polylang 0.9.3 "Site Title" and "Tagline" are not changing again. In version 0.9.2.3 it was fine. I use the Headway theme.

  9. janpeeters
    Member
    Posted 1 year ago #

    Indeed, same problem here with Pagelines Framework.

  10. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Well I made very slight changes in 0.9.3 compared to 0.9.2.3, and for @janpeeters, they were already present in 0.9.2.4. for what is related to string translations.

    Let's try to find which change causes this issue coming back.
    Could you try to edit the file polylang/include/core.php @ line 338 and replace:

    // and finally load user defined strings
    				$l10n['pll_string'] = $this->mo_import($this->curlang);
    			}

    by

    }
    
    			// and finally load user defined strings
    			$l10n['pll_string'] = $this->mo_import($this->curlang);

    @janpeeters, Are you sure you did copy correctly the code? When I activate the plugin together with pagelines lite, I don't get such error.

  11. janpeeters
    Member
    Posted 1 year ago #

    Chouby,

    changing the code that you posted above in Polylang 0.9.3 solves the problem of not translation strings like Blog title and tagline.

    And for the specific Pagelines strings I must have copy/pasted wrong, sorry for that, all is good now. No header warnings.

    I'll get back to you when I have word from the Pagelines devs about how they communicate with WPML.

    Thanks, Jan

  12. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Great! So, I will revert to the correct code in the next release. Even if I don't understand why it changes the result for you (no changes for me in Twenty Ten, and my goal was to avoid loading these translations two times...)

  13. janpeeters
    Member
    Posted 1 year ago #

    You mean with the changed code? I thought it had to do with the } that moves to a different location. But my knowledge of PHP is not good. So don't bother.

  14. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, you are right, the only change is the position of the }

    However I tried another way to do my optimization (to avoid loading translations two times). Could you try the development version (0.9.3.1) and tell me if it's OK?
    http://downloads.wordpress.org/plugin/polylang.zip

  15. janpeeters
    Member
    Posted 1 year ago #

    All good with the new build. It works without problems.
    Maybe you find another way to prevent the double loading of the translations, good luck with that. But I'm happy for now because it works! I'll contact you ASAP when I have an answer from WordPress.

  16. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your test! I will keep it as in 0.9.3.1 then :)

  17. m.yovkov
    Member
    Posted 1 year ago #

    It works again!

  18. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    I got a short answer from the Pagelines developer that's occupied with translation.

    He writes:

    WPML is different.

    In a few sections instead of oset we use tset like this:

    $the_text = ploption('quick_text_' . $i, $this->tset);

    When tset is used in a section, it sets the $oset['translate'] to true. then the magic_parse function spots it and registers the string in WPML.
    Same does not work for polylang, I tried it.
    If your plugin works why not roll with it, were not going to add something into core that does not work properly. The WPML bit works thats why its in there.

    Well I didn't ask him to add anything, but that aside.
    Hopefully the oset and tset thing explains it to you. For me it's like latin.

    Best, Jan

  19. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I already detected that the translation was done by this function 'pagelines_magic_parse', but the fact is that (at least in the free version I can test), it is always called with $o['translate'] = false, so there is no call to the WPML functions and so no call to the equivalent Polylang functions.

    Well, let's give up. Now you have a working solution ;-)

  20. janpeeters
    Member
    Posted 1 year ago #

    Hi Chouby,

    Yeah that might be a good idea, giving up. I tried to help you to find a working solution so that your plugin would be compatible with this framework. But if some manual string changes over the next time I know how to adjust your custom plugin to add that one too I guess.

    Thanks for your help.

    Jan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic