• Resolved andreaslechner

    (@andreaslechner)


    Hi,
    I have created a website making heavy use of Pods custom post types, which are awesome! I started the website in German and have added an english version using Polylang.
    With Polylang, I have activated Templates for translation, not the custom post type (their data remains the same). I have the auto template option set for the custom post types and access single posts from a list of posts using {permalink}.

    I have two language versions for the template but I always only get the German version when I open the post on the English page.
    The two language versions refer to each other as translations.

    I tried the following:
    – Same name for English and German templates –> select this name in the auto template options => I see the German version
    – Different names for English an German templates –> select the name of the German version in the auto template options => I see the German version
    – Different names for English an German templates –> select the name of the Enlish version in the auto template options => I see the German version

    I am currently using a workaround, accessing a page which displays one post, selected by its ID. Disadvantage: I can’t switch languages on the page and on social media, I don’t get the title and picture of the post but of the page.

    What else could I try?

    Thanks in advance
    Andreas

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @andreaslechner

    This might be a difficult one. My first guess is that this custom post type was translatable before, or has been set to the default language.
    Even though you disabled translations these might still exist in the database.

    Another think I’d like to know is how you’ve set your site language?
    When you go the the page where a translated template should show, what is the actual locale that the site is in at that point. (you can check using get_locale()).
    A plugin like Query Monitor might help here as well!

    Cheers, Jory

    Thread Starter andreaslechner

    (@andreaslechner)

    Hi Jory,

    I might have set the custom post type to translateable before. I don’t exactly remember, because I tried around on my local XAMPP installation before I changed setup on the live website and don’t remember which was which.
    How could I unset this database setting?

    The site language is set to German.
    When I’m on the English list of posts (locale is en_US) and open one (permalink), the locale changes to de_DE and stays there.

    Thanks for your support!
    Andreas

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @andreaslechner

    Even if it is in the database this shouldn’t matter, this might be a Polylang bug / edge-case but I’d have to know more about the generated SQL. Did you find the query for this using Query Monitor?

    When I’m on the English list of posts (locale is en_US) and open one (permalink), the locale changes to de_DE and stays there.

    Since it switched to DE I’m quite sure Polylang considers this post type to be translatable for some reason.
    @chouby do you have any insights in this matter that might help us?

    Cheers, Jory

    Thread Starter andreaslechner

    (@andreaslechner)

    Hi @keraweb

    which query are you interested in? There are quite a lot pods sql queries and none that looks suspicious 😉

    This is where it gets the template post on one I take the permalink. post_title is the English Auto Template name.
    SELECT ID
    FROM wp_posts
    WHERE post_title = ‘Online Workshop Details EN’
    AND post_type = ‘_pods_template’
    AND post_status IN ( ‘publish’ )
    ORDER BY ( post_status = ‘publish’ ) DESC, ID DESC

    Best regards
    Andreas

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @andreaslechner

    That query doesn’t include any language filters so that should be fine.

    Could you create a bug report on GitHub and provide all information that is asked there so I can replicate your situation?
    https://github.com/pods-framework/pods/issues/new?template=bug_report.md

    Cheers, Jory

    Plugin Author Jory Hogeveen

    (@keraweb)

    Closing topic due to no reply.
    Feel free to re-open if you still need help!

    Cheers, Jory

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

The topic ‘Auto Template with multiple languages for Custom Post Type’ is closed to new replies.