• Resolved seccyeth

    (@seccyeth)


    Hi,
    I created a L&L template with a mix of text and dynamic variables. I made templates translatable with WPML, and although it properly gave me only the text strings to translate, it messed up all the dynamic code anyway. I rewrote it properly in the translated version, that was no big issue.

    The main problem is that when I integrate the code on my global template page via Elementor pro’s dynamic function, the translated page doesn’t switch to the translated version of the L&L template. When selecting the L&L template in Elementor, I see I can pick from both the French and English version, whereas usually only the templates from the current language show. So I think that might be related to the issue.

    So I’m not sure whereas the issue stands with L&L behavior with Elementor or with WPML or with both. Is the plugin supposed to be WPML ready, or is it something you’re planning to do in the future?

    Anyway, awesome job, I love this plugin already!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tangible

    (@tangibleinc)

    Hi! We haven’t built out WPML support yet, but in our own projects we’ve found workarounds for translation.

    The easiest to implement is creating an ACF options page with your strings, translating those and getting them where needed in your templates (with the side benefit of those strings becoming easily editable by you or your client from one place in the admin). This approach makes the most sense for stuff like “Read more” or “Posted on” strings you’ll be using across the site that benefit from being consistent.

    How to use values from ACF options pages =>

    Registering an options page with ACF =>

    You can also test the url for the ?lang query string with the Url tag if you’re formatting your translated links that way, but that’s a bit less reliable.

    <Set name=dateFormat>
      <If check="{Url query=lang}" value=en>
        en
      <Else if check="{Url query=lang}" value=fr />
        fr
      <Else/>
        <Setting wpml-previous-default-language />
      </If>
    </Set>

    <Setting wpml-previous-default-language /> gets one of the very few fields that WPML saves in the wp-options table. Its name is a bit deceptive as it’s the current default language. I sometimes use the Url test approach to pass a language code to translate my dates:

    <Format date="j F, Y" locale="{Get dateFormat}><Field publish_date /></Format>

    Hope that helps!

    Please visit our dicussion forum if you have any other questions!

    Plugin Author Tangible

    (@tangibleinc)

    Our reply was held for moderation ?? check back in a bit

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WPML support for template’ is closed to new replies.