Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to translate the 'lang' attribute of the VikRentCar shortcode ([vikrentcar view="vikrentcar" lang="en-US"]) using WPML, but the translation does not reflect on the page. The issue arises because the 'lang' attribute is stored in a custom database table and is not dynamically updated during the localization process.
Solution:
To resolve this, you need to make the value stored in the custom database tables translatable with WPML. You can follow the guide on making strings translatable in WPML here: String Package Translation. Until this configuration is set, you will need to manually translate the page containing the VikRentCar shortcode using the WordPress editor instead of the Advanced Translation Editor. Additionally, since the VikRentCar plugin is not listed in WPML’s compatibility directory, it is recommended to contact the VikRentCar development team for further support and encourage them to join WPML's Go Global program for better compatibility.

If this solution does not apply to your case, or if it seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If further assistance is needed, we highly recommend opening a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 0 replies, has 0 voices.

Last updated by emmanouilK-4 3 days, 19 hours ago.

Assisted by: Prosenjit Barman.

Author Posts
December 30, 2024 at 11:41 am

emmanouilK-4

Background of the issue:
I'm trying to translate a page that has the shortcode [vikrentcar view="vikrentcar" lang="en-US"] that has the lang attribute which needs to be translated. I've manually registered the shortcode's attribute in settings using the following xml vikrentcar lang . The lang parameter appears in the translation editor, I translate it to fr-FR.

Symptoms:
After saving the page and checking the string translation manager, the shortcode is not translated but the original is copied with lang="en-US".

Questions:
Why is the lang attribute not being translated in the shortcode?
How can I ensure the lang attribute is correctly translated to fr-FR?

December 30, 2024 at 12:39 pm
December 31, 2024 at 5:24 am #16554931

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There!
I hope you're doing well!

I reviewed the entire conversation you had with my colleague and analyzed the issue further. Upon a deeper look, I was able to pinpoint the root cause and gain a clearer understanding of the underlying problem.

The issue involves the `lang` attribute of the VikRentCar shortcode (`[vikrentcar view="vikrentcar" lang="en-US"]`), which is stored as a separate value in the plugin's custom database table (`wp_vikrentcar_wpshortcodes`). Unfortunately, this `lang` attribute is not dynamically updated or translated during localization processes. This appears to be due to the plugin’s limited localization support and its static handling of certain shortcode parameters.

Even if you register the Shortcode for translation, it will not work because the values are stored in the separate Database table. To ensure that the `lang` attribute value is updated correctly in each language, it’s necessary to make the value stored in custom database tables translatable with WPML. You can refer to the following guide for a detailed explanation of the process:

- https://wpml.org/documentation/support/string-package-translation/

Once the `lang` attribute is configured to be translatable, you should be able to translate the value easily using WPML. Until then, you will need to manually translate the page, containing the VikRentCar shortcode, using the WordPress editor instead of the Advanced Translation Editor.

Additionally, I want to point out that the VikRentCar plugin is not listed in WPML’s compatibility directory, which indicates that this is more of a compatibility issue. Since other shortcode parameters may also be affected, I strongly recommend escalating this issue to the VikRentCar development team. You can also encourage them to join WPML's Go Global program to ensure seamless compatibility. Collaboration with their developers will be crucial to implementing a comprehensive and permanent resolution.

I hope you can understand. Please feel free to let me know if you need further clarification. I'll be happy to help.

Best regards,
Prosenjit

December 31, 2024 at 4:32 pm #16556170

emmanouilK-4

Thank you Prosenjit for looking into my issue.

I forwarded this ticket to VikRentCar and hopefully they will look into implementing official support for WPML.

Best regards.