Search: AI, Hybrid, Classic

  • Pricing
  • Contact Us
  • Help
    • My Licenses
      • Login
      • Download
      • Why us
      • Contact us
    • Features
      • Google Retail Search
      • Weaviate
      • Elasticsearch
      • OpenSearch
      • Solr
      • Algolia
      • Roadmap
      • Artificial Intelligence
      • Hosting
      • Releases
    • Documentation
    • Support
    • Testimonials
    • Live Demos
    • Blog
Menu
  • Pricing
  • Contact Us
  • Help
    • My Licenses
      • Login
      • Download
      • Why us
      • Contact us
    • Features
      • Google Retail Search
      • Weaviate
      • Elasticsearch
      • OpenSearch
      • Solr
      • Algolia
      • Roadmap
      • Artificial Intelligence
      • Hosting
      • Releases
    • Documentation
    • Support
    • Testimonials
    • Live Demos
    • Blog
Search
Search
Search
Search

Home » Your configuration journey, step by step » Add-ons » WPML add-on

WPML add-on

340 views 0 February 3, 2021 Updated on February 27, 2021

What is WPML add-on

Image wpsolr-wpml-certificate-1.png of WPML add-on
WPSOLR is certified “WPML-ready”. Click to see it at WPML

 

 

 

 

 

 

 

 

 

WPML search compatibility list
WPML search compatibility list. Click to see it at WPML

 

WPML is a wordpress plugin that allows you to use multiple languages on your website. It is a very useful plugin when you have visitors that come from all over the world. But WPSOLR search doesn’t work with multiple languages by default. This is where the WPML add-on comes in. With this extension, WPSOLR can search in multiple languages by creating several indexes, one for each language to be precise. This considerably improves performance when searching in multiple languages.

 

Install the WPML plugins

Image Screenshot-2021-02-01-at-10.34.36-1024x233.png of WPML add-on

Install the “WPML Multilingual CMS” and “WPML String Translation” plugins like you would any other plugin. Then register the plugins so you will be able to get future updates.

 

Setup WPML

Image Screenshot-2021-02-01-at-10.49.40.png of WPML add-on

Click on WPML in the sidebar.

Image Screenshot-2021-02-01-at-10.46.51-1024x340.png of WPML add-on

Choose the language the content is currently written in.

Image Screenshot-2021-02-01-at-10.48.04-1024x523.png of WPML add-on

Image Screenshot-2021-02-01-at-10.48.12-1024x175.png of WPML add-on

Choose the languages you want to use on your site. I’m going to choose french.

Image Screenshot-2021-02-01-at-10.58.16-1024x509.png of WPML add-on

Here you have a variety of options to choose from. You can select the order of the languages and choose what to do if there is a language it can’t translate. You can either skip that language or link to home of language for missing translations.  You can choose to add a language switcher to either a menu, a widget area or the footer. Finally, you can add a link to the translation in the content.

Image Screenshot-2021-02-01-at-11.20.51-1024x357.png of WPML add-on

You can decide if you want to send information to wpml.org.

Image Screenshot-2021-02-01-at-12.17.24-1024x380.png of WPML add-on

You can enter your site key in this step.

 

Translate content

If you have WooCommerce content you might have difficulty translating it. By default, WPML translates posts and pages.

Image Screenshot-2021-02-01-at-13.08.30-1024x427.png of WPML add-on

Image Screenshot-2021-02-01-at-13.12.01-1024x335.png of WPML add-on

Go to “WPML” -> “Settings” then scroll down to “Post Types Translation”.  Select the type of content you want to be translated.

Image Screenshot-2021-02-01-at-15.02.46-1024x403.png of WPML add-on

Next scroll down to “Media Translation” and click on “Start”. Leave the default configuration if you’re not sure what to choose.

Image Screenshot-2021-02-01-at-14.58.15-1024x132.png of WPML add-on

Click on the “+” icon on the very right of the screen.

Image Screenshot-2021-02-01-at-15.23.16-1024x468.png of WPML add-on

Then type in the translated text. When you’re done click on publish. If you want to see the original text, click on “Copy content from English” in the sidebar. This will fill in the text from the original language in the different fields. It can be very helpful if you don’t remember what you wrote.

 

Change website language

Image Screenshot-2021-02-03-at-14.39.27-1024x290.png of WPML add-on

Click on “WPML” -> “Languages” then scroll down until you reach “Language URL format”. Click on “Different languages in directories” if you want to be able to switch language by changing directories in url.

 

Create an index

Image Screenshot-2021-02-01-at-09.29.07-1024x529.png of WPML add-on

Click on “Connect your indexes” then, if you want to create a test index, click on “Click to generate a free index to test WPSOLR”.

Image Screenshot-2021-02-01-at-09.31.07-1024x244.png of WPML add-on

Select “Create a free test index”. The index is only valid for two hours however, so you will have to create more if you want to use it for longer. You will however need to have the same number of indexes as languages you want your website to have, but you can only create one test index. You will therefore need to connect to a search server or service for the other indexes.

Image Screenshot-2021-02-15-at-09.35.31.png of WPML add-on

Image Screenshot-2021-02-15-at-09.44.32-1024x671.png of WPML add-on

Choose the search engine for your index then choose a hosting service. Choose the language you want your index to be used for, in my case i want the second index to be used for the french search. name your WPSOLR index and give a name to the search engine index. get your endpoint url from Elasticsearch server, and fill in the user and password you were given.

 

Activate the WPML extension

Image Screenshot-2021-02-02-at-14.45.32-1024x93.png of WPML add-on

Go to “Activate extensions”.

Image Screenshot-2021-02-02-at-14.47.03.png of WPML add-on

Then click on “WPML” in the sidebar.

Image Screenshot-2021-02-02-at-15.06.13-1024x307.png of WPML add-on

Click on the checkbox. This will activate the WPSOLR WPML add-on.

Image Screenshot-2021-02-03-at-15.22.37-1024x467.png of WPML add-on

Scroll down and choose the languages you want to use for each index.

Image Screenshot-2021-02-02-at-16.01.59-1024x281.png of WPML add-on

If you want to be able to choose more layouts in WPSOLR filters, click on “Theme” in sidebar, then on “Use this extension”. When you’re done save.

 

Configure WPSOLR

Image Screenshot-2021-02-02-at-15.10.14-1024x84.png of WPML add-on

Click on “Define your search with ‘Test index from Elastic Cloud'”.

Image Screenshot-2021-02-02-at-15.32.17-1024x405.png of WPML add-on

Next click on “Search” and select one of the two indexes in “Search with this search engine index”.

Image Screenshot-2021-02-02-at-15.42.05.png of WPML add-on

Click on “Data” in the sidebar.

Image Screenshot-2021-02-02-at-15.44.31-1024x188.png of WPML add-on

Then select the data you want to index.

Image Screenshot-2021-02-02-at-15.46.39-1024x191.png of WPML add-on

You can choose the taxonomies you want to use.

Image Screenshot-2021-02-03-at-15.29.12-1024x380.png of WPML add-on

You can also choose the fields you want to use. If you want to use a slider you will have to change the default option, which is text, to floating point number if there are decibel numbers or integer if there are only whole numbers.

Image Screenshot-2021-02-12-at-09.16.37.png of WPML add-on

Click on “Suggestions” in the sidebar

Image Screenshot-2021-02-12-at-09.16.52-1024x680.png of WPML add-on

Then create a new suggestion. Choose a name for your suggestion in the “Label” field and click on the “Is active” checkbox. In the “jQuery selectors” field, fill in the search bar id. I will show you how to retrieve it later. In the “Query” section, choose “Suggest content” and then scroll down.

Image Screenshot-2021-02-12-at-09.17.02-1024x441.png of WPML add-on

Click on “Products” if you want to display products in search suggestions. If you also want to display the price, you can click on the “Show Products price” checkbox.

Image Screenshot-2021-02-12-at-10.09.24-1024x201.png of WPML add-on

head over to the search bar you want the suggestions to apply to and right click and select “inspect”. You will then see something similar to the photo. copy the search bar id. In my case it is “woocommerce-product-search-field-0”. When you’re done, go back to WordPress admin.

Image Screenshot-2021-02-02-at-15.48.55.png of WPML add-on

Click on “Filter” in the sidebar.

Image Screenshot-2021-02-02-at-15.59.37-1024x585.png of WPML add-on

Image Screenshot-2021-02-12-at-10.33.15-1024x34.png of WPML add-on

Click on the filters you would like to use on your website then click on “Save Options”.

Image Screenshot-2021-02-17-at-10.55.12-1024x568.png of WPML add-on

Image Screenshot-2021-02-11-at-10.24.24-1024x568.png of WPML add-on

Image Screenshot-2021-02-11-at-10.24.44-1024x709.png of WPML add-on

Image Screenshot-2021-02-11-at-10.24.59-1024x382.png of WPML add-on

Image Screenshot-2021-02-12-at-11.19.16-1024x562.png of WPML add-on

If you want to change the layout of the filter you select the one you want in “Layout”. You can also change layout skin on “Range Slider – Ion.RangeSlider js library”. Give your filters a title so that they are translated. if you want to people to be able to choose a product or page based on date of creation, modify “displaydate_dt” filter. Choose a label then choose the range slider and a skin. You will also have to enter some javascript to choose date format. Enter this code for the english US format:

wpsolr_ion_range_slider_options =
{
grid: true,
prettify: function tsToDate (ts) {
var lang = "en-US";
var d = new Date(ts); return d.toLocaleDateString(lang, { year: 'numeric', month: 'long', day: 'numeric' });
 } 
};

If you want to be able to change the currency and the format based on the language, enter this javascript code:

wpsolr_ion_range_slider_options =

{

grid: true,

prefix: "$",

prettify: function my_prettify (n) {
return n.toLocaleString('en-US', {maximumFractionDigits:2});
}};

 

Index content

Image Screenshot-2021-02-02-at-16.38.47-1024x81.png of WPML add-on

Click on “Send your data”

Image Screenshot-2021-02-02-at-16.48.23-1024x514.png of WPML add-on

Click on “Index selected post types in index ‘index-name'”. Then do the same thing for the other index.

 

Add the WPSOLR Facet widget

Image Screenshot-2021-02-03-at-13.11.39-1024x405.png of WPML add-on

 

Click on “Customise” on the front part of your website, then select “Widget” and “Sidebar”. Add the WPSOLR Facets widget.

 

Translate WPSOLR Facets and WordPress widgets

Image Screenshot-2021-02-05-at-14.56.56.png of WPML add-on

Click on “WPML” then on “String Translation” in the sidebar.

Image Screenshot-2021-02-15-at-10.52.58-1024x291.png of WPML add-on

Click on the + sign and add your translation. This will translate facets and widgets on your website.

Image Screenshot-2021-02-15-at-10.46.56-1024x303.png of WPML add-on

Image Screenshot-2021-02-15-at-10.47.07-1024x292.png of WPML add-on

Image Screenshot-2021-02-15-at-10.47.19-1024x301.png of WPML add-on

Image Screenshot-2021-02-15-at-10.47.28-1024x293.png of WPML add-on

Image Screenshot-2021-02-15-at-10.47.38-1024x295.png of WPML add-on

Translate the WPSOLR facets.

 

Image Screenshot-2021-02-12-at-11.17.58-1024x405.png of WPML add-on

Be sure to also translate the code i showed you earlier to display date in your language format. You just have to change “var lang = ” to your language.

Image Screenshot-2021-02-17-at-11.48.33-1024x311.png of WPML add-on

Don’t forget to also translate the JS code for the price slider. Change “prefix” to “postfix” and “$” to “€”.  You will also have to change “en-US” to “fr”. Everything should be working as expected after that.

 

 

Translate WordPress menus

Image Screenshot-2021-02-11-at-13.43.03.png of WPML add-on

Choose “Appearance” in WordPress admin sidebar then “Menus”.

Image Screenshot-2021-02-11-at-13.45.42-1024x473.png of WPML add-on

Then click on “Create Menu” and choose a name, the language and if you want it to be the translation of a certain english menu.

Image Screenshot-2021-02-11-at-13.49.08.png of WPML add-on

Choose the pages you want in your menu then click on “Add to Menu”.

Image Screenshot-2021-02-11-at-13.49.21-1024x293.png of WPML add-on

Rearrange them if you want then click on save.

 

Test your website search

Image Screenshot-2021-02-17-at-11.17.23-1024x432.png of WPML add-on

As you can see, we only get english content when searching right now.

Image Screenshot-2021-02-12-at-10.15.20-1024x153.png of WPML add-on

The suggestions are working as well.

Image Screenshot-2021-02-11-at-14.11.49.png of WPML add-on

Now let’s switch over to french.

Image Screenshot-2021-02-17-at-11.18.14-1024x488.png of WPML add-on

Image Screenshot-2021-02-12-at-10.22.24-1024x167.png of WPML add-on

We now have search in the french language. If you want more detailed instructions, you can watch this video:

Was this helpful?

Yes  No
Related Articles
  • Hybrid search
  • Question Answering
  • Cohere
  • OpenAI
  • HuggingFace
  • CLIP

Didn't find your answer? Contact Us

Previously
Custom Facets CSS
Up Next
Premium add-on
Expand All Collapse All
  • What is it WPSOLR ?
    • The standard WordPress SQL search
    • The WPSOLR search with Elasticsearch, Apache Solr, or Algolia
  • Your configuration journey, step by step
    • Install Apache Solr
    • Hosted Apache Solr and SolrCloud Services
    • Install Elasticsearch
    • Elasticsearch Hosting
    • Configure your indexes
      • Create a Google Retail search index
      • Create a Weaviate index
        • Transformers
        • CLIP
        • HuggingFace
        • OpenAI
        • Cohere
        • Question Answering
        • Hybrid search
      • Generate a test Apache Solr index
      • Generate a test Elasticsearch index
      • Create an Apache Solr index
      • Create a SearchStax SolrCloud index
      • Create an Elastic Elasticsearch index
      • Create an Amazon AWS OpenSearch index
      • Create an Algolia index
      • Create an Elasticsearch index
      • Create an Opensolr Solr index
      • Create a Qbox Elasticsearch index
      • Create an ElasticPress Elasticsearch index
      • Create an Aiven Elasticsearch or OpenSearch index
      • Create a Bonsai Elasticsearch index
      • Create an Amazon AWS Elasticsearch index
      • Create an ObjectRocket Elasticsearch index
      • Create a Cloudways Elasticsearch index
      • Create an Alibaba Cloud Elasticsearch index
      • Create a Compose Elasticsearch index
      • Connect to an Apache Solr index
      • Connect to an Elasticsearch index
    • Add-ons
      • bbPress add-on
      • YITH WooCommerce Ajax Search add-on
      • SEO add-ons
        • Yoast SEO add-on
        • All in One SEO add-on
      • Listable add-on
      • ACF add-on
      • Advanced Scoring add-on
      • Cron Scheduling add-on
      • Theme add-on
        • Filters layouts
          • Radiobox & Checkbox Layout
          • Numeric Range Layout
          • Colour Picker Layout
          • Range Slider Layout
        • Add Ajax to the current Theme
        • Collapse taxonomy hierarchies
        • Custom Facets CSS
      • WPML add-on
      • Premium add-on
        • Manage more than one Elasticsearch or Solr index
      • PDF Embedder add-on
      • Geolocation add-on
      • AI Natural Language APIs add-on
        • Amazon Comprehend
        • Google Natural Language
        • Aylien Text Analysis
        • MeaningCloud
        • Qwam Text Analytics
      • Toolset Types add-on
      • AI Image and OCR APIs add-on
        • Google Vision
        • Amazon Rekognition
      • Embed Any Document add-on
      • MyListing add-on
      • Polylang add-on
      • WooCommerce add-on
      • Cross-domain search add-on
      • Directory+ add-on
      • Toolset Views add-on
      • Listify add-on
      • Jobify add-on
      • Query Monitor add-on
  • Quick start
Login
Support
Privacy policy
  • Terms and Conditions
  • © 2020 wpsolr.com. All Rights Reserved.
Youtube
Roadmap