Translation not working on listings page with TranslatePress

Hi,

I know you don’t offer help for other plugins, but I just need you to point me in the right direction with my problem if you can.

I have Translatepress as my translation plugin, and all works perfectly fine, except that when I search listings in the secondary language (I have two), it does not show them, or it shows only a few.

Some settings:

  • Translatepress configured with Spanish as first (default) language. English is the second language users can select from a language switcher. Default Spanish URLs have no language code ( no “/es/ ) but English ones do (for example: www.website.com/en/listings). Translation for gettext strings is disabled
  • Hivepress geolocation uses Mapbox, and Regions are disabled. The search form only has location and category
  • I created custom Listings and Listing templates (via Hivepress→Templates)
  • Litespeed cache is installed and active

So what happens is that when choosing a category, let’s say “Rentas vacacionales” and a location in the default Spanish language, all listings appear normally. If I switch to English and choose the same category, translated as “Vacation rentals”, and the same location (in English, because it seems Mapbox autotranslates as well), only a few, or no listings appear at all. This happens for older listings and for newly published ones.

When I click on a listing in Spanish, I can then select English in the listing itself and it will show in English with no issues. Interestingly, the “Related listings” block inside the listing page WILL show related listings even when in English, while in the Listings (search) page those same listings don’t appear in English.

Do you have an idea where the problem could be related to? Mapbox conflict? Hivepress conflict? URL conflict?

It would be a shame having to drop the translation option because everything else works fine

Hi,

We’ll consider supporting TranslatePress, but we recommend switching to WPML if possible. If you decide to go ahead with TranslatePress, please note that there isn’t a simple code snippet available for integration.

If you are comfortable with coding, you can review the changes we made for WPML integration to get a better idea of how to approach this.

Hope this helps.

Hi,

I can’t switch to WPML now. It took a lot of work to cofigure Translatepress for optimal performance. It actually works pretty good.

I was not asking for integration, although if it is added, that will be great. I was only asking where I could start troubleshooting since I don’t know how Hivepress queries the database to show the listings on the listings search page. And like I said, in the listing page itself, it does show related listings in the English version, so I suspect there is some conflict when getting the listings to display that has to do either with Hivepress or with Mapbox, but you probably know better who is the most probable suspect here.

Some more info since yesterday: I tried using the regular Listings template (not my custom one) and it still doesn’t work. And I previously used Regions but switched it back off months ago. I reenabled Regions briefly, eliminated all previously created Regions, and then disabled Regions again. It still can’t find all the listings in the English page.

Unfortunately there are no specific suggestions as this would require researching the TranslatePress API and requirements. We plan to add integration with more multilanguage plugins, probably in the near feature because these plugins work in a similar way and after integrating WPML this would take less time to implement.

Please check if TranslatePress has any guides for integration, I assume they require some parameters for the get_posts calls, like WPML does with “suppress_filters” parameter. We did this change in multiple places of the framework when adding integration with WPML, you can check the changes here Release by hivepress · Pull Request #328 · hivepress/hivepress · GitHub Adding “suppress” filters” parameter set to “true” to all the “get_posts” calls may resolve most of the issues, but please note that there may be other issues as currently there’s no specific integration with TranslatePress. For example, TranslatePress will probably not detect the Listings page correctly in secondary languages as there’s a single-choice option for this page in HivePress/Settings/Listings.

Hope this helps

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.