Skip Navigation

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

Problem:
The client was experiencing issues with translating slugs for a custom post type slug that comes from the plugin Citadela, that was showing up on WPML->Settings->Post Types Translation.

Solution:
Firstly, we recommended that any code changes should indeed be made in the child theme to prevent them from being overwritten during plugin updates. Regarding the slug translation issue, we provided the following steps:

1. Navigate to the file

/wp-content/plugins/citadela-directory/plugin/cpt/item/CitadelaItem.php

.
2. On line 31, locate the following code:

add_action('init', array(__CLASS__, 'citadelaOnInit'), 20, 0);

3. Change it to:

add_action('init', array(__CLASS__, 'citadelaOnInit'), 0);

4. After making the change, go to WPML -> Settings -> Custom post type translation -> Items (citadela-item), enter the translation for "lieu", and click "Save".

We also emphasized the importance of having a full backup of the website before making any updates or changes.

Please note that this solution might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If necessary, do not hesitate to open a new support ticket for further assistance 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.

Tagged: 

This topic contains 30 replies, has 2 voices.

Last updated by Marsel Nikolli 9 months, 2 weeks ago.

Assisted by: Marsel Nikolli.

Author Posts
December 12, 2023 at 7:51 pm #15049393

Mary

Hello,

I'm using the plugin Citadela Listings in my website to create a directory of places. Within this plugin, you can go to a tab called "Extension" (in French) and create custom fields that you can add to your listings and then use these same custom fields to filter results (see screenshot). But I can't seem to be able to translate these fields.

I did go under WPML > Settings and found these fields (they all start with _citadela_item_extension_ ; see other screenshot). I set them to being translatable, but I don't see them in the String translations.

In the front end, these fields show in the search area on this page (the "Filtrer par caractéristiques" drop-down; you can also see screenshot):
hidden link

And in individual parks pages (above the operating hours): hidden link

Is there a reason why they don't show in the string translation and is there a workaround?

Thanks!

citadela_front_end_search.png
citadela_front_end_park.png
citadela_extension_translatable.png
citadela_extension.png
December 13, 2023 at 11:09 am #15053569

Marsel Nikolli

Hi,



Thank you for contacting WPML Support, I will be happy to help you today.


It seems that the plugin "Citadela Listing" is not yet part of the WPML compatible plugins list, anyway could you please check if you can find the custom fields strings by following these steps:

1)
- go to WPML -> Theme and plugin localization -> Strings in the plugins
- select checkboxnext to "Citadela Listing"
- click “Scan selected plugins for strings”

2) After the scan is done, please:
- go to WPML -> String Translations
- scroll at the bottom of the page, click the blue link Translate texts in admin screens »
- after you click, in the page that opens (Admin Texts Translation), search for “_citadela” or directly the strings you want to translate
- select the checkboxes next to them and click “Add to String Translation”
- go back to WPML -> String Translation

Check if the strings are showing, if so proceed with the translation.

For more related information: https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#scan-the-theme-or-plugin

Let me know if this works out for you,
Marsel

December 13, 2023 at 4:55 pm #15057759

Mary

Hi, thanks for your reply!

I did what you said, I then found three things in the string translation:

1) Admin text like this "_citadela_item_extension_parc_Chiens_permis"
2) The displayed values (Chiens permis) in the domain Default
3) The same displayed values (Chiens permis) in the domain "admin_texts_citadela_directory_item_extension"

Translating the admin text didn't change anything on the front end.

Translating the strings in the domain Default only changed what appears in the Search/Filter section in this page: hidden link
Note that I had to switch the default language for this domain to be able to translate these displayed values as the default language was English (with French text) instead of French.

Translating the strings in the "admin_texts_citadela_directory_item_extension" domain changed what appear in the individual parks pages: hidden link

I have a few more related questions:

#1 I'm not sure it was needed to translate the displayed values in the in domain Default. I removed one translation from there, and the displayed text still showed correctly in the Search/Filter page of the main Places directory. Should I have just translated the strings in the "admin_texts_citadela_directory_item_extension" domain? And if so, should I undo what I did in the Default domain? As mentioned, I had changed the language of this domain (from English to French). Could this cause issues? My site is set to French as the main language. But I see many of the other strings in the Default domain are in English (but now set as French)

#2 In the main Places directory, two fields/strings are still not translated. Both texts from Citadela blocks. A) The first one is the map. When clicking on a location on the map, it shows the name of the park or facility in French and links to the French page instead of the English one. This comes from of their Maps block B) The second one is the filter title "Filtrer par caractéristiques du parc ou de l’aire de jeu". This is set directly in their Advanced filter block in the original French page. I'm not sure how to translate those.
See page here: hidden link

=====
This 3rd question is not related to a custom field, but to the slug. Let me know if I need to open a new ticket for this one.

#3 In the individual parks page, the slug of the English pages is in French ("lieu"). I tried setting those in the Settings. It keeps telling me the slug is "translatable" but that the translation is missing, even though I did set it (see screenshots).

Thank you!

December 14, 2023 at 9:49 am #15061989

Marsel Nikolli

Hi Mary,

Thank you for the detailed explanation and update on the issue you are facing.

#1 From your description it seems that you already had the strings available for translation (the Default domain), without needing to add the strings from the domain "admin_texts_citadela_directory_item_extension".

In order to investigate this issue and understand it better, I would need a temporary access to your website.

Please make a full backup of your site (files and database) and confirm it in your next reply.

I would need to access both your site's WP-admin.
Your next reply is set to private for you to provide the username and password details.

Thanks,
Marsel

December 14, 2023 at 1:44 pm #15063737

Mary

No, what I'm saying is that I don't think the strings in the Default domain needed to be translated, for 2 reasons.
1) When I translated that text, it didn't change the text everywhere (individual park pages *and* search filters)
2) when I remove it, it doesn't have any impact.

I tested this further by adding a new field. Only translating the strings in the domain "admin_texts_citadela_directory_item_extension" was needed to make it work everywhere.

So you can ignore my question #1

December 14, 2023 at 4:06 pm #15066461

Marsel Nikolli

Thanks for the update and sorry for my misunderstanding.

I would still need a temporary access on your website to better understand how it is set up and further check the issues related to question #2 and question #3.

I've set your next reply in order for you to provide access details.

Thanks,
Marsel

December 15, 2023 at 10:09 am #15071083

Marsel Nikolli

Hi,

Thank you for providing the access.

I was able to check the staging site and:

1) The string "Filtrer par caractéristiques du parc ou de l’aire de jeu" can be translated by editing the English page and changing the string directly on the editor. I already changed it on the staging site, please check that the translation is correct. (please check attached image)

2) I noticed that you have the WPML notification asking if the site is a copy or you moved the site, you'll need to select the proper situation option there.

3) It seems that the maps are not working in the staging site in order to check the translation of the Maps block.

4) Related to the slug issue, I'd first suggest deal with point #2 and after try clearing the site cache and try setting the slug for the English version on: WPML -> Settings -> Post Types Translation.

Please try checking what described above and let me know.

* If point #4 doesn't work we'll split it on a separate ticket.

Looking forward to your reply,
Marsel

December 15, 2023 at 9:10 pm #15076123

Mary

Hi Marsel,

Ok, I was trying to translate these fields just with the ATE and string translations, but if it's not possible, that's fine.

So, for #1, I translated it in the page directly as you recommended.

For everything else, I think it's best not to use the staging site because it seems I can't fully activate the Citadela plugin on it. Also the live site is not really "live"/accessible to the public, so it's fine. And I've just made a new backup.

#2 & #4 - this notification does not appear in the live site and #4 (slug) is still an issue

#3 - The maps appear in the live site, so you can check it there. But here's what happens: when I update the French page, the map appears in French on both the French and English page. When I update the English page, then the map appears in English on both the French and English page.

Here's the URL to the "live" site again: hidden link

December 18, 2023 at 9:22 am #15081495

Marsel Nikolli

Hi,

Thanks for the update.

1) Would it be possible to check if the issue happens in a minimal setup, that meaning:

- set a default WP theme
- keep active only WPML Plugins and necessary plugins
- disable all other plugins

After, check if the issue/s is still happening.

Note: Please make sure you have a full backup (files & database) before trying anything on your website.

2) I would suggest also you to reach out to the "Citadela Listing" plugin's author regarding the slug and map issue, as the plugin is not yet in WPML's compatible plugin list, you can also request them to join the Go Global Program of WPML where they can work with our compatibility team to make their product multilingual.

More information regarding Go Global Program can be found here: https://wpml.org/documentation/support/go-global-program/

Let me know how it goes,
Marsel

December 18, 2023 at 8:33 pm #15087443

Mary

The slug and map issues are still present in a minimal setup.

I have already contacted them about other WPML issues, and they redirected me to you, saying they are not WPML specialists. I will try again for these specific issues, but I don't have much hope because they had quickly recommended another translation plugin instead.

You can see their support page regarding WPML: hidden link

The slug issue kind of looks like it is a WPML problem. I save the slug in the other language, but a WPML warning still tells me it is not set (and once saved, what I put in is removed).

citadela_slugs2.png
citadela_item_slug.png
December 18, 2023 at 9:51 pm #15087845

Mary

Just to add: actually for the slugs, I don't seem to have the same issue with other plugins. So I'll let you know what the Citadela authors says.

December 19, 2023 at 8:43 am #15089795

Marsel Nikolli

Hi,

Thanks for the update.

We do understand that the plugin authors are not WPML experts and the main reason we always ask them to join our Go Global program is to work together with them to make make it possible that the plugins/themes are fully compatible with WPML.

Anyway, in order to further troubleshoot the issue I would require a copy of your website to test it locally and further escalate the issue if needed.

You can use the Duplicator plugin(https://wordpress.org/plugins/duplicator/) in order to create a copy of your website, and upload the backup on a file sharing website (Google Drive, Dropbox, etc.), please send me the link to download the backup after.

*Note: Please try to minimize the size of the backup file by excluding unnecessary media files or backup folders that might be in the "/wp-content/" folder.

I’ve set your next reply as private in order for you to provide the backup link.

Thank you, looking forward to your reply,
Marsel

December 20, 2023 at 4:24 pm #15104775

Mary

Yes, I've told them twice about your Go Global program, but so far, they haven't expressed an interest, unfortunately.

I installed the Duplicator, I've tried it twice (including one time with removing some files in the /upload folder to reduce file size), but both times I got a 504 Gateway Time-out. Can I instead give you access to the site or create a staging site as I have done before?

December 21, 2023 at 8:39 am #15107501

Marsel Nikolli

Hi,

Thanks for the update, much probably you get the 04 Gateway Time-out error due to hosting restrictions.

Could you please setup a staging site and I can try getting a copy from there and if that won't be possible then we'll try to troubleshoot further on the staging site.

Thank you, looking forward to your reply,
Marsel

December 21, 2023 at 2:35 pm #15111387

Mary

Ok, it seems my answer is not private. Is it possible to set it as private?