Skip Navigation

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

Problem:
The client was experiencing issues with blog posts written in Arabic not rendering properly. They needed assistance with configuring WPML to support right-to-left (RTL) formatting for Arabic blog posts.
Solution:
We identified that the issue was due to incorrect placement of a variable in the translation string. The variable %s, which displays the list of available languages a blog post is available in, was incorrectly formatted as “s%” for RTL languages. We corrected the translation string for “This post is also available in” from

منشور المدونة متاح أيضًا باللغات التالية: s%

to

منشور المدونة متاح أيضًا باللغات التالية: %s

.

If you're experiencing similar issues, we recommend checking your translation strings for proper variable formatting in RTL languages. For further guidance, please refer to our documentation on WPML documentation.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.

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 reply, has 1 voice.

Last updated by metroW 3 months, 1 week ago.

Assisted by: Kor.

Author Posts
February 25, 2025 at 11:55 pm #16748582

metroW

Background of the issue:
I am trying to display blog posts for languages that use right-to-left formatting correctly, specifically Arabic. The Arabic home (archive) page displays properly, however, Arabic blog posts do not. The site I need help with is hidden link.

Here's a link to an English blog post:
hidden link

Here's a link to an Arabic blog post:
hidden link

Symptoms:
Blog posts written in right-to-left languages are not rendering properly.

Questions:
How can I configure WPML to support right-to-left formatting for Arabic?
Are there specific settings in WPML to adjust the layout for right-to-left languages?
If CSS needs to be added, can we do so through the customizer rather than updating a theme file?

February 26, 2025 at 6:07 pm #16752749

metroW

I still need help with this issue. Here are two screenshots of Arabic pages, representing the Archive Layout and Single Post Layout. The page should look like the archive layout with the header, footer, and right rail.

I appreciate any insight you can share.

Thanks,
Adrian

Single-Post-Layout-WMPL-Example-–-تغييرات-قادمة-في-وسائل-النقل-جنوب-مقاطعة-King-County-تتطلع-شركة-Metro-إلى-معرفة-ملاحظاتكم-بشأن-التحسينات-المقترحة-على-المسارات-–-.png
Archive-Layout-Metro-Matters-–-أخبار-تهمك-02-25-2025_03_15_PM.png
February 28, 2025 at 1:14 am #16758604

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for contacting us.

I've checked your Arabic page here hidden link and it looks broken.

Also, could you backup and update all WPML plugins to the latest version?

I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

February 28, 2025 at 10:08 am #16760094

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

It looks like the FTP access is not working. Could you please follow the guide here that explains how to enable debugging and share the debug log with us? https://wpml.org/documentation/support/debugging-wpml/ Take note that, once you enabled debugging, please open this link hidden link so that the error log can be generated.

You can upload the debug log to Google Drive and share it with me.

February 28, 2025 at 8:03 pm #16762644

metroW

Hi Kor,

Thanks for the clear instructions. The debut log can be found here:

hidden link

Thanks,
Adrian

March 3, 2025 at 1:14 am #16766545

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

This is the error that broke the page.

[28-Feb-2025 18:57:25 UTC] PHP Fatal error: Uncaught ValueError: Missing format specifier at end of string in /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-render.php:335
Stack trace:
#0 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-render.php(335): sprintf('\xD9\x85\xD9\x86\xD8\xB4\xD9\x88\xD8\xB1 \xD8\xA7\xD9\x84...', '\n <span clas...')
#1 /srv/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-render.php(310): WPML_LS_Render->post_translations_label(Object(WPML_LS_Post_Translations_Slot))

I regret any inconvenience caused, but to proceed with troubleshooting, I kindly ask for a snapshot of the site. Alternatively, with your permission, I can create one myself. For this purpose, I typically recommend using the free plugin "Duplicator." If you're already familiar with Duplicator (https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.

To guide you further, please adhere to these instructions:

1. View the Duplicator instructions video: hidden link

2. Consult WPML's instructions on providing supporters with a copy of your site: https://wpml.org/faq/provide-supporters-copy-site/

3. If the archive file exceeds 400MB, please use Duplicator's file filters to exclude cache, wp-uploads directory, media, and archive files.

Once you have the archive file ready, kindly share the link with us. You can utilize platforms like Google Drive, Dropbox, or similar for file sharing, as the snapshot file might be large.

Please note that your next reply will be private, visible only to you and me. You can paste the file link there. Rest assured that once the issue is resolved, I will delete the local site.

March 4, 2025 at 12:52 am #16771199

metroW

Hi Kor,

Upon further investigation by our team, we discovered what we believe was causing the rendering issue.

The variable, %s, used to display the list of available languages a blog post is available in should have been written as “s%” in the translation string for Arabic, following suit with RTL formatting.

To fix the problem, we updated the translation string for “This post is also available in” from

منشور المدونة متاح أيضًا باللغات التالية: s%

To

منشور المدونة متاح أيضًا باللغات التالية: %s

Below is a link to an Arabic blog post for your reference:

hidden link

The blog post is now rendering perfectly on our end. Please see the attached screenshot for reference.

Can you please confirm that was the only cause of this issue?

Thanks,
Adrian

arabic-single-post-layout-fixed-WMPL-Example.jpg
March 4, 2025 at 12:57 am #16771231

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Yes, that's the correct cause of the issue. Please be careful when you translate strings with variables using the String Translation.

March 4, 2025 at 5:49 pm #16775455

metroW

Problem solved. Thanks for your support!

My best,
Adrian