• Resolved filip.jnc

    (@filipjnc-1)


    Hello Chouby,

    First of all, I’ve got to say that this plugins rocks! It’s very light and user-friendly. I have only one issue that I reckon is not a big deal to hack/fix/add an option in the next version of Polylang.

    1. I’m using a static front page
    2. PLL settings
    3. Webpage: http://www.bikeportal.md
    4. Languages: Romanian(default)/Russian

    My problem is that in case of untranslated categories/posts, polylang language switcher doesn’t show the link to that category/post but to the homepage. For example the category of posts Rezultate (Results) has not been translated and when you are in the default language and hover on the russian flag, you can see the url goes to the russian homepage (http://bikeportal.md/category/results/). The same goes for single posts.

    The thing is that I don’t to translate these posts and I don’t want to duplicate them either. So I thought if I translate categories and assign each post to 2 categories (default – translated), this post would appear in both romanian and russian posts list. Unfortunately, I can’t assign one post to the counter-language category. If only that was possible, I think all problems on my website would be gone.

    Any advice on this problem? I would be very thankful.

    Kind regards,

    Filip

    https://wordpress.org/plugins/polylang/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter filip.jnc

    (@filipjnc-1)

    PS. The code for my custom language switcher at the bottom of the page:

    <?php
    if( class_exists('Polylang') && function_exists('pll_the_languages') ) {
    
    $pll_args = array('show_names'=>0,'show_flags'=>1,'hide_if_empty'=>0,'hide_current'=>1,'raw'=>1);
    $pll_otherlang_array = pll_the_languages($pll_args);
    $pll_otherlang_details = $pll_otherlang_array[0];
    $pll_url = $pll_otherlang_details['url'];
    $pll_flag = $pll_otherlang_details['flag'];
    ?>
    <div class="mk-polylang-switcher">
    		<a href="<?php echo $pll_url ?>" class="mk-polylang-switcher-link"><?php echo $pll_flag ?></a>
    </div>
    <?php } ?>
    Thread Starter filip.jnc

    (@filipjnc-1)

    I’ve just noticed that if I add ?lang=ru at the end of the URL of each post or custom-post, the post is still displayed in the Romanian (default) and the rest is in Russian (even though the post in not translated). This is close to what I want if the post is not translated.

    Demo:
    http://bikeportal.md/results-2013-1/
    http://bikeportal.md/results-2013-1/?lang=ru

    However, this doesn’t work with categories and other taxonomies + the switcher still wants to redirect me to the homepage (doesn’t add ?lang=ru in the href).
    __________________________
    This still has little-to-nothing to do with my main problem: the translated categories and other taxonomies are empty because I can’t assign untranslated posts to them.

    Demo:
    http://bikeportal.md/category/results/
    http://bikeportal.md/category/results-ru/
    -> As you can see, the second one is a translated category of posts and it’s empty -> thus the language switcher from default language sees it and doesn’t add the correct URL to the Russian category.

    Any suggestions, tips, codes, idea would be very appreciated! I really don’t want to switch to that heavy WPML…

    Thread Starter filip.jnc

    (@filipjnc-1)

    I changed some bits of code in this plugin to redirect me to ?lang=ru of the same article if no translation is found and query the default article. It’s not a permanent fix, but I hope Polylang gets the future of displaying default category lists/posts/whatever if no translation found. Cheers.

    Hi Chouby, i agree with filip … this feature should be very helpful.
    Any plans to update your plugin, to manage this situation in a cleaner way?

    Filip … could you share your code modifications?

    thanks, this plugin rocks!
    Paolo

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Untranslated taxonomies/custom taxonomies’ is closed to new replies.