• Resolved tbo460

    (@thibotus01)


    Hi,

    I have a multilingual site so I need to put a different ID for each page / language of my widget.

    WPML doesn’t allow to modify the shortcode code since it’s not a text to translate.
    So how can I do this then?

    Thank you,

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    which shortcode are you talking about exactly? Where did you place them? Translating a page/post should result in a possibility to add a different shortcode to that translated content too.

    Cheers

    Thread Starter tbo460

    (@thibotus01)

    Hi,

    Thank you for your quick answer.
    Shortcode of widget reviews. I placed it in an elementor template page.

    In WPML translator I have this: https://gyazo.com/07776d91abb3284dc839705059dcafd7
    It doesn’t allow me to translate the actual ID. I opened ticket with WPML to know more.

    Thank you

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    that’s a very special case I guess ?? Building multilingual elementor templates with WPML – I guess this usecase may only be supported in case WPML allows these custom fields to be translatable.

    Best

    Thread Starter tbo460

    (@thibotus01)

    Elementor template pages are very common in wordpress developement nowdays. ??

    And I’m not sure it’s actually related at all. It’s strcitly related to WPML and shortcodes I believe.

    Plugin Author vendidero

    (@vendidero)

    And I’m not sure it’s actually related at all. It’s strcitly related to WPML and shortcodes I believe.

    Well it is related as these templates need to be translatable via WPML and that is a functionality only WPML can provide. You could integrate/implement a custom shortcode and check the current language via PHP and place/provide the actual widget as needed. But that requires a custom implementation.

    Thread Starter tbo460

    (@thibotus01)

    It looks like the plugin need a configuration file for WPML.
    Please read the ticket I opened here: https://wpml.org/forums/topic/shortcode-translation/

    And the configuration is described there: https://wpml.org/documentation/support/language-configuration-files/#1-4-automatically-converting-shortcode-ids

    Can you please have a look and advise?

    Thank you,

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    the automatic translation won’t work, as the id attribute does not contain posts/pages but the TS widget id. I’ve added a wpml-config.xml to our dev environment:

    <wpml-config>
        <shortcodes>
            <shortcode>
                <tag>ts_widget</tag>
                <attributes>
                    <attribute>id</attribute>
                    <attribute>sales_channel</attribute>
                </attributes>
            </shortcode>
        </shortcodes>
    </wpml-config>

    You may add the file manually to wp-content/plugins/trusted-shops-easy-integration-for-woocommerce/wpml-config.xml and disable/re-enable the plugin. Does that work?

    Cheers

    Thread Starter tbo460

    (@thibotus01)

    This doesn’t seem to work as it seems to add the ID and not replace it once I translate it.

    Also I’m facing another issue, the widget ID of another language/chanel is not working. Nothing is returned. It’s blank.
    It’s impossible to debug because there is no error message

    • This reply was modified 2 years, 5 months ago by tbo460.
    • This reply was modified 2 years, 5 months ago by tbo460.
    Plugin Author vendidero

    (@vendidero)

    Hi there,

    This doesn’t seem to work as it seems to add the ID and not replace it once I translate it.

    Hm, I don’t know how it should work but I guess the ID should be translatable? At least that’s what the docs say: https://wpml.org/documentation/support/language-configuration-files/#page-builder-content

    Also I’m facing another issue, the widget ID of another language/chanel is not working.

    You may check that by using the built-in functionality to place widgets for different sales channels (languages) via the GUI and compare the embedded code. Please check your Chrome dev tools for details.

    Thread Starter tbo460

    (@thibotus01)

    That’s another thing I don’t understand about the “Location” dropdown. If I select “homepage” how does he know where to show the widget? For example the carousel.
    Same for footer/header I’m not quiet sure.

    Thank you

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    please contact the TS support on details about the locations. The plugin uses Hooks provided by WooCommerce (and your theme) to place the widgets. In case of the homepage, the woocommerce_after_main_content is used and an additional check via is_shop() is made to check whether it’s the shop main page (product archive or shop page).

    Cheers

    • This reply was modified 2 years, 5 months ago by vendidero.
    Thread Starter tbo460

    (@thibotus01)

    In that case this is not working as no widget is showing up at all with these locations. So I’m not able to debug anything and understand why the other channel is not showing up.

    Are you able to look this up? Thank you

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    than you might do as follows: Disable all plugins but Woo and the TS plugin and activate a default theme (e.g. TwentyX, Storefront). Please disable adblockers in your browser too to make sure requests are not blocked. Please use the chrome dev tools to check whether the scripts/snippets are embedded.

    Cheers

    Thread Starter tbo460

    (@thibotus01)

    Hi

    So I enabled only Woocommerce, WPML, default storefront theme and the plugin.

    I can now see the TS tab in product page with the carousel widget for one channel but the issue persist in the other language. It’s blank

    And nothing in console dev to understand anything.

    Let me know where I can send you the URL in private?

    Plugin Author vendidero

    (@vendidero)

    By default, the widget will only show in the language configured. For each language available in WPML you’ll find a separate channel in the GUI – did you configure the widgets for the other language(s) too?

    Maybe linking some screenshots of your configuration would help.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Multilanguage sites with WPML and shortcodes?’ is closed to new replies.