In version 1.4.3 we added WPML support to MinervaKB knowledge base. In this article, we’ll walk through the steps needed to add WPML support to your knowledge base.
To follow these steps you’ll need:
- WPML plugin with String Translation module installed. String Translation module is needed for translating plugin options.
- MinervaKB version 1.4.3 or higher.
KB home page setup
First of all, to create multiple KB home pages you’ll need to use either our page builder or shortcode builder, instead of plugin options.
The process is same as for translating any other page with WPML: you create the base language page, for ex. English, then click the translation link (you can also copy the contents from base language) and edit the sections for the other language in the new screen. Then save and publish the new page.
When you’ll have topics and articles translated, you’ll be able to select them in your current language in Shortcode builder.
Articles and topics
Knowledge base articles use custom post type functionality, so you need to let WPML know they should be translated. Go to any article, scroll to the bottom of the edit page and tick all the boxes for translating articles and topics/tags.
After this you’ll see the same translation metabox on the top right as on pages an you’ll be able to translate articles as posts. Note, that you will need to create the topics for the new language too, as your current topics will be locked to your base language.
You can map topics in Topics edit section. First, make sure you have selected your target (not base) language in admin dashboard – check the flag at the top of page. Then create a new topic. Fill in all the fields and in the dropdown at the bottom choose the appropriate topic in base language.
After creating the topics in new language you will be able to select them in article edit screen.
Another important point for topics, is you need to select the home page for each topic, as with all the content created with shortcodes. You can do it in the edit screen for the topic.
The translation of FAQ is the same as articles and topics. First, make the questions post type translatable in the question edit screen, then re-map all the categories to the new ones. The rest is done automatically.
All the plugin options are stored in the database, so to translate them you need the String Translation module from WPML. Go to WPML – String Translation and select MinervaKB in domain section.
This filter out all the other translation items from theme or plugins. After that, you simply need to add translations for all the fields that are used in your setup.
AJAX cookie setup
As pointed out by the WPML team, in order for the live search to work properly with WPML, you need to enable the cookie for AJAX filtering in settings. To learn how to do this, please check this guide language cookie on WPML documentation site.
That’s it for this guide. You can check our multilingual demo to see how it all works together and remember to always contact our support if you have any questions.