Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Chouby

    (@chouby)

    In fact, Polylang does not integrate this functionality yet. As discussed here, I chose not to add the language information when it is not necessary (ie for posts, pages, categories and post tags) and add it only when it is mandatory (for archives for example).

    The reason for this is that I wanted that, if for some reasons the plugin is deactivated, the links are not broken, even if it would have been easier to add the language information everywhere as other plugins generally do.

    However, since quite a lot of users seem to be interested in this feature, and even if I will not recommend to use it, I added it in my todo list for v0.7.

    Thread Starter brbrbr

    (@brbrbr)

    Hi,

    thanks for the answer and effort,

    is there a quick patch possible in your code?

    Plugin Author Chouby

    (@chouby)

    It’s not a matter of one or two lines of code. Several files will be modified. Please be patient.

    Check this forum, I will probably release a development version for tests in few days.

    Hi Chouby,

    I was actually trying to find this functionality in your great plugin. I understand well the reason why you prefer not to set fixed paths of posts, but I’m struggling with the Bombax theme (and I’m not a Web designer so I’m a bit lost).

    When I activate Polylang and set up everything, some of the stylesheets are not accessible anymore for the added language. It’s ok for the default language when the “Hide language information for default language” option is checked.

    Here is the difference between the two produced page sources:

    Default language:

    <head>
    [...]
    <link rel="stylesheet" href="http://192.168.1.191/wordpress/wp-content/themes/bombax/style.css" type="text/css">
    [...]
    <link rel="stylesheet" id="itx-css" href="http://192.168.1.191/wordpress//?itx=css&ver=3.3.1" type="text/css" media="all">

    Second language:

    <link rel="stylesheet" href="http://192.168.1.191/wordpress/wp-content/themes/bombax/style.css" type="text/css">
    [...]
    <link rel="stylesheet" id="itx-css" href="http://192.168.1.191/wordpress/?lang=en%2F%3Fitx%3Dcss&ver=3.3.1" type="text/css" media="all">

    (I can post captures of the pages, but the site is currently only local to our LAN)

    Will the next version enable this to work, or do I need to find another way?

    Thank you very much for the plugin, and for you help!

    Plugin Author Chouby

    (@chouby)

    No, the new version won’t correct that.

    The problem is that theme authors should not code like this, but most do. You can correct it yourself (maybe you can ask the author to include the modification in the next update).

    Edit the file bombax/header.php and replace lines 20 & 21

    wp_enqueue_script('itx',get_bloginfo('url').'/?itx=js');
    wp_enqueue_style('itx',get_bloginfo('url').itx_preview_vars('css'));

    by:

    wp_enqueue_script('itx',home_url('?itx=js'));
    wp_enqueue_style('itx',home_url(itx_preview_vars('css')));

    Plugin Author Chouby

    (@chouby)

    For people interested in and to better explain better why such coding can’t work with Polylang (and most probably other multilingual plugins).

    On most sites, there is one or more links to the homepage (in the header, in the menu…). For multilingual sites, we want that this links to the homepage in the correct language (not the homepage in the default language).

    So Polylang filters every call to bloginfo(‘url’), get_bloginfo(‘url’), home_url() which are the 3 ways to link to the homepage and adds the language information. If other links use these function, then it breaks 🙁 .

    The alternative for Polylang would be to provide a new function which knows about the translated homepage but it obliges to modify almost all themes. That’s why I prefer the current solution.

    Thank you so much!!! It works perfectly.
    I will ask them to include this modification.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Polylang] language in pages permalink’ is closed to new replies.