Install Linguise neural translation on a WordPress website

Table of Contents

Generate the API Key

After your connection to your Linguise dashboard you’ll need to setup a new domain first and save it’s settings to get the API Key.

The API key is what is required to activate the translation on your website. Basically the API key will check what language is activated on what domain and will allow the neural translation pages  to be generated.

Copy the API Key and keep it in your clipboard.

translation-API-key

Install the WordPress plugin

Now you need to install the WordPress plugin to activate the language switcher (flags with language switcher). You can download the latest version from the WordPress plugin directory.

After the script is downloaded, install it to your WordPress website as usual using the WordPress plugin installer

add-linguise-plugin

Activate the WordPress translation

Once the WordPress plugin is installed and activated, you can access the plugin configuration by using the “Linguise” left menu. The first to look into is the API key field. Paste the API key from your dashboard and click on Apply

  • You’ll get the full website language configuration
  • All the website should already be translated in all the languages!

Add the language switcher to your website

You have 3 methods to load the website language switcher (flags and language names) to your website on WordPress.

  • Use the shortcode below
  • Use the WordPress Linguise menu
  • Use the PHP snippet
[linguise]

Once it’s added, on the frontend you’ll have the flag and language name displayed.

The alternate option will generate the alternate URL per language, so the search engine can crawl easily all the language version of the page. It’s recommended to let it activated.

An alternate example in the HTML code that will be crawled by search engines:

alternate-links

Setup the language switcher type

The language switcher can be displayed as a popup, a dropdown list, or just aligned side by side. You also have the option to display only the flag or only the language names, or both.

On the right side of the screen, you can use the preview to check the final rendering.

The position setting allows the use of floating positions on your website.

Language switcher flag and text design

There’s many design option that help the language switcher to be loaded anywhere on your website. For example, style won’t be the same on the white top bar and on a dark footer.

Main options are:

  • Flags shape and size
  • Language names text color
  • Shadow of elements on mouse hover
  • Mouse hover style

Language switcher setup in video

Language switcher advanced options

Finally, you can setup the advanced options such as cache setting, the amount of URL and translation to store locally to be served faster.

The browser language redirect is not recommended for various reasons detailed here. Basically, it redirects the user to one of the languages that is setup in his browser.

Pre-text and post-text are the HTML content to display in the popup of the language switcher. 

language-flag

Install on WordPress with IIS servers

Add the line corresponding to your CMS in your Web.config file.
It should be set before any other redirection, especially the redirection to your PHP main file:

				
					<rule name="Linguise language redirection" stopProcessing="true">
	<match url="^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-cn|zh-tw|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu|zz-zz)(?:$|/)(.*)$"  />
	<action type="Rewrite" url="/wp-content/plugins/linguise/script.php?linguise_language={R:1}&amp;original_url={R:2}"  appendQueryString="true" />
</rule>
				
			

Install on WordPress with NGINX servers

Add the line corresponding to your CMS in your NGINX server configuration block.
It should be set before any other redirection, especially the redirection in your PHP main file.
				
					rewrite ^/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-cn|zh-tw|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu|zz-zz)(?:$|/)(.*)$ /wp-content/plugins/linguise/script.php?linguise_language=$1&original_url=$2 last;