Skip to content Skip to sidebar

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

Problem:
The client was experiencing 404 errors on a multilingual website using the Milenia theme and MotoPress Hotel Booking plugin after translating the 'accommodations' slug. The URL slug alternated between 'nastaniavane' and 'accommodations' in the Bulgarian version, causing inconsistent behavior.
Solution:
The client resolved the issue by adjusting the slug translation settings in WPML. Instead of translating 'accommodations' directly to 'nastaniavane' in the string translation, the client set it to 'accommodations' in both English and Bulgarian. This change was then correctly reflected in the WPML settings for taxonomies and slugs, allowing the correct Bulgarian translation 'nastaniavane' to be used without causing errors. Additionally, we recommended troubleshooting steps such as clearing caches and synchronizing taxonomies in WPML if the problem persists. For detailed guidance on using WPML with MotoPress Hotel Booking, visit the following links:

If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. Also, 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.

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 4 replies, has 2 voices.

Last updated by Itamar 1 year, 1 month ago.

Assisted by: Itamar.

Author Posts
June 4, 2024 at 9:56 am #15700736

Dessislav

Background of the issue:
I'm building a website for reservations using the Milenia theme, which uses the Motopress reservation extension 'motopress hotel booking'. The main language of the site is Bulgarian. After translating the content and administrative texts into Bulgarian, I added WPML to make the site multilingual and added English. I made the necessary settings to translate the 'accommodations' slug from the Motopress extension.

Symptoms:
When checking the site in Bulgarian and English, sometimes loading a premise results in a 404 error. The URL slug alternates between 'nastaniavane' and 'accommodations' in the Bulgarian version, causing inconsistent behavior. Sometimes refreshing the page resolves the issue.

Questions:
Why is the URL slug alternating between 'nastaniavane' and 'accommodations' in the Bulgarian version?
What can I do to fix the 404 error when loading premises in both languages?

June 4, 2024 at 1:45 pm #15702299

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

The MotoPress Hotel Booking plugin is officially compatible with WPML.

https://wpml.org/plugin/motopress/

Please ensure to follow the guide here.

hidden link

I can see the problem on your site. It happens, for example, when I use the Language Switcher to switch from English to Bulgarian. Please see the attached screenshot. I tried it on this post, for example.

hidden link

Please see the attached screenshot.

Please try the troubleshooting section.

1. Take a backup of the DB of your site.

2. Go to WPML -> Support -> Troubleshooting (link)

3. Once on the troubleshooting screen, press the following buttons and check if it helps. Press each button at a time and wait for the process to complete.

- 'Disable cache for language switcher templates'

- 'Clear language information and repopulate languages' button (if it is showing)

- 'Synchronize posts taxonomies' for 'Products'

- 'Clear the cache in WPML'

- 'Remove ghost entries from the translation tables'

- 'Fix element_type collation'

- 'Fix WPML tables collation'

- 'Synchronize local job ids with ATE jobs'

- 'Synchronize translators and translation managers with ATE'

- 'Assign translation status to duplicated content'

- 'Set language information'

- 'Reset languages' Press this button only if you didn't add a custom language!

- 'Fix terms count'

- 'Fix post type assignment for translations'

- 'Cleanup and optimize string tables'

- 'Clear invalid strings'

*** Please backup your database before using this.***

Please let me know how it goes.

Regards,
Itamar.

2024-06-04_16-38-56.jpg
June 5, 2024 at 11:44 am #15706462

Dessislav

Hello,

Ok, I'll do the steps above!

Some of them I tried in the beginning when I started translating, as it wouldn't show me some translations.

I'll need some tech time, I'll post when I try out the steps.

Best Regards

June 12, 2024 at 3:53 pm #15732739

Dessislav

Hello,

I apologize for the late reply. I had some hosting issues and stuff.

Regarding the problem described above, I think I have managed to solve it. Since Sunday, when I made some changes, the site has not given such an error, none of the above.

I have not applied the steps you suggested, because, as I wrote in a previous post, I had applied some of them and even all of them at one point, some several times, even for the same problem, but nothing helped.

As in the first post with which I opened the discussion, I described the problem with "slug" in the version with the Bulgarian language, which is also set to be the default language, etc.
Where "slug" was once shown as "nastaniavane" (one of the words for accommodation in Bulgarian) another time with the English word "accommodation" in the Bulgarian version and once worked in both cases, other times not, and that when it works in the Bulgarian version with both words "accommodation" and "accommodation", when it first shows the page and "slug" is not translated and shows it as "accommodation" in the Bulgarian translation, when the page is refreshed, the same slug "accommodation" changes of "nastaniavane". Which is also an indication that somewhere there is an intertwining of two names for one language, in this case Bulgarian. As you can see from the screenshots, especially in the string translation images, that the slug "accommodation" in English is also translated into Bulgarian, however, from this translation of the slug, the system takes the translation for the other language and puts it in the slug change field in the part with the WPML settings where it is specified whether to translate the slug or not.
Since the default language is Bulgarian, the translation word "nastaniavane" (in Bulgarian) for "accommodation". Probably due to the fact that a slug has been translated directly into the string translation, it causes sticking and confuses the reservation system because of the Bulgarian word, which replaces the role of "accommodation". Because accommodation is key to the operation of the reservation system. So, I went to the string translation and instead of directly translating "accommodation" as "nastaniavane", as it was before, I simply also wrote "accommodation" in the field for the Bulgarian translation. And since, as I said, then this translation is transferred to the WPLM settings in the part with translations for taxonomies and slugs, from there I have already changed things, because even in Bulgarian it showed me accommodation and because from there I already have an active option to change the language to which the name refers, from there I changed it so that it is not Bulgarian, but English. Then WPML, after updating the settings, showed me the change field correctly and then I already wrote the Bulgarian word "nastaniavane" for "accommodation".

I'm describing how I solved the problem, since you still have no way of knowing exactly what I did and did on the site and the translation, etc. in detail before I turn to you.

Once again, thank you very much for your responsiveness and quick response, and I apologize for my late response.

Best Regards,

June 13, 2024 at 4:07 pm #15737240

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hello.

Dear Dessislav, I greatly appreciate your description of how you solved the problem. I hope it will help other users who face the same problem.

I'm closing this ticket. Don't hesitate to contact us again with any WPML issues or questions.

Thanks a lot,
Itamar.