Algolia integration
Integration between Algolia and the Weglot WordPress plugin.
Algolia is a powerful search and discovery API platform designed to create fast and relevant search experiences for websites and applications. It provides tools to index, search, and analyze data in real-time, ensuring that users can quickly find what they're looking for.
To install Algolia, please follow the steps described in this link: Algolia WordPress Integration Setup.
To make Algolia work with Weglot, you need to add the following code to a snippet or directly into your user code:
This code adds the required JavaScript file for Algolia and includes the xhook library to intercept and proxy Algolia requests. The wp_enqueue_script
function is used to load the xhook library and the custom Algolia JavaScript file. Additionally, the wp_localize_script
function passes Weglot configuration data (such as the API key, original language, and current language) to the custom JavaScript file.
If everything is set up correctly, you should see the Algolia JavaScript file from Weglot and the xhook library loaded on your page.
To complete the setup, you now need to add some definitions to your Weglot custom settings to specify what content you want to translate. You can do this by including the following code:
Please note that this integration is still a Work In Progress (WIP), and we greatly appreciate any feedback you may have. Your insights will help us improve the integration and ensure a seamless experience. Thank you for your support!
Last updated