Join our new community forum for support & discussion
Join NowHome › Support › General › HivePress › Listing Attributes translation in Multillingual Site with Polylang
Listing Attributes translation in Multillingual Site with Polylang
-
AuthorPosts
-
Bogdan 1 year ago
Hi Ihor, do you have any idea, how to translate Listing Attributes in multilingual environment? I use Polylang and everything works well up to now. I don’t allow front-end edition.
Pages, Posts, Listings, Categories, Widgets are available to translate, all Hive widgets are translated, but Polylang doesn’t provide Attributes translation. I can’t add another attributes in additional language, because I use it also for filtering and I will have the same attribute twice on filter widget – in two different languages.Please check if Attributes are available as a custom post type, since attributes are not static (like strings) they should be available for translation in the same way as Listings. They may also be hidden since it’s not a public post type, please check if Polylang requires this.
Bogdan 1 year agoListings are available in custom post types and Categories are available as a custom taxonomies. Attributes are not there.
Information from Polylang Support:
Note: To correctly display the languages columns and metabox for custom post types and taxonomies, plugins or theme authors must use the same actions and filters as WordPress. Otherwise there is now way for Polylang to add its own interface.Note for developpers: By default, Polylang displays the post types and taxonomies in the settings for which the parameter ‘public’ is set to true. Other won’t appear. You can use the wpml-config.xml file or the filters ‘pll_get_post_types’ and ‘pll_get_taxonomies’ to change that.
Can you change it to ‘public’ or I can change anything?
This is a private post type so unfortunately there’s no easy way to turn it public (you can do this via the
hivepress/v1/post_types
filter but this would enable front-end pages for attributes which may break something). Please consider adjusting the Polylang config instead (as suggested in their docs).Bogdan 1 year agoIhor, I have created wpml-config.xml according the doc: https://polylang.pro/doc/the-wpml-config-xml-file/ and load it to root directory of hivepress plugin (also to polylang directory)
<wpml-config>
<taxonomies>
<taxonomy translate=”1″>Attributes</taxonomy>
</taxonomies>
</wpml-config>
Nothing happened.
What is the taxonomy name for Attributes? Is Attributes ok as used above?The post type (not taxonomy) is
hp_listing_attribute
, for vendors it’shp_vendor_attribute
, for bookingshp_booking_attribute
. Hope this helps.Bogdan 1 year agoGreat! Thank you. Following code works:
<wpml-config> <custom-types> <custom-type translate="1">hp_listing_attribute</custom-type> </custom-types> </wpml-config>
One more question. I need to translate also Options for Listing Attributes. What id should I use here?
Thanks for posting the solution! Attribute options are registered as taxonomy terms of “hp_listing_{attribute_name}” taxonomy, so these also should be available for translation.
Bogdan 1 year agoIhor, I have translation for Attributes in the Attributes list, but there is important issue:
There are both language versions of the same Attribute on the Listing page
as well as on the Filter page. It means every Attribute, doesn’t matter what language, is visible in all lanuages – https://www.golf4camper.eu/cs/listing-category/18-or-more/I believe this is already HP plugin functionality. Is it difficult to repair this “bug”?
I also believe, when you fix this issue, Polylang could be officially compatible with HP. I can also test it for you in any other area.Thanks for your feedback and for testing this, declaring the multilanguage support would be awesome. Please try adding this code to a list of arguments at line 228 in hivepress/includes/components/class-attribute.php file:
'suppress_filters' => false,
It may resolve the double attribute issue.
-
AuthorPosts
New Reply
This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.