
Tagged: shortcode, translations, wpml, WPML Config File
-
AuthorPosts
-
April 1, 2025 at 5:39 pm #1480589
I am using the WP Booking System plugin together with the Enfold theme. WP Booking System does not support WPML, but it allows me to create the booking form in 3 languages. I need to insert a slightly different shortcode in the editor (lang=en, lang=de etc.) per language.
[wpbs id="1" language="nl" title="no" legend="yes" legend_position="side" display="1" year="0" month="0" language="auto" start="1" dropdown="yes" jump="no" history="1" tooltip="1" highlighttoday="no" weeknumbers="no" show_first_available_date="no" form_id="1" form_position="bottom" auto_pending="yes" selection_type="multiple" selection_style="split" minimum_days="0" maximum_days="0" booking_start_day="0" booking_end_day="0" show_date_selection="no"]
So I create a WPML config file in the root folder of my Enfold child theme with the following content:
<wpml-config> <shortcodes> <shortcode> <tag>wpbs</tag> <attributes> <attribute>id</attribute> <attribute>language</attribute> </attributes> </shortcode> </shortcodes> </wpml-config>
I reopened the page, updated the content, but I can still not change the German and English page through the Advanced Translation editor.
Do you have any clue what I am doing wrong?PS. I have tried this solution with both a content block and a code block, both don’t give me any result.
April 2, 2025 at 6:05 am #1480613Hey envis,
Thank you for the inquiry.
Have you tried placing the shortcode inside a Text Block? You should be able to translate the content of the Text Block element in the WPML Translation Editor. If this doesn’t work, please provide the login details in the private field. For additional assistance, please contact the WP Booking System plugin developers.
Best regards,
IsmaelApril 2, 2025 at 5:38 pm #1480655Ismael,
I asked WPML and they came up with this solution.
So I expect that because of this XML, I would see an ID and LANGUAGE attribute that I can change with WPML per language version. But I do not.
Greetings,
Gerben-
This reply was modified 1 day, 6 hours ago by
envis.
April 3, 2025 at 7:27 am #1480687Hi,
Thank you for the info.
We would like to try to override the wpml-config using the dedicated field in WPML > Settings (https://wpml.org/documentation/support/language-configuration-files/overriding-language-configuration-files/), but a script error prevents us from saving the changes. This is the error:
Uncaught SyntaxError: Unexpected token '<' (at https://site.de/?wpml-app=ate-dashboard&ver=472900:8:1) Line:8 ateDashboard(params); <pre style="padding:1em; background-color: #f8f8f8; color: #0a001f"><?xml version="1.0" encoding="UTF-8"?> <shortcodes> <shortcode> <tag>av_codeblock</tag> <attributes> <attribute>alb_description</attribute> <attribute>av_uid</attribute> <attribute>codeblock_type</attribute>
This might also be the reason why the Text Block and other elements are not translatable. Please forward this error to WPML support and once the issue is fixed, try to delete the wpml-config.xml file in the child theme folder, then transfer its content into the WPML > Settings > Custom XML Configuration tab.
Let us know the result.
Best regards,
IsmaelApril 3, 2025 at 9:16 am #1480704Maybe this was a human error. The wpml-config.xml was missing from the enfold theme folder. I have put it back there. Can you try again? Or does it have nothing to do with it?
April 3, 2025 at 9:32 am #1480707 -
This reply was modified 1 day, 6 hours ago by
-
AuthorPosts
- You must be logged in to reply to this topic.