Multilingual wordpress site
So, to solve the problem, you will need:
Consider 1 point – Ready-made WordPress theme. If it is a purchased theme, it should be with multilingual support. In the characteristics of the theme should be the phrase: Translations Support & RTL:
If you create a theme with multilingual support yourself, then for WordPress 3.9 and earlier versions in wp-config.php should be this line:
And for WordPress 4.0 and later versions in the site settings (menu “Settings” -> “General”) simply select the main language.
The structure of access to the site will look like:
https://Domain/ – Russian language
https://Domain/en – English language
Also in the functions.php file of your theme, which you create, there should be these lines:
* Add language support
add_action( 'after_setup_theme', 'my_child_theme_setup' );
load_child_theme_textdomain( 'mydomain', get_stylesheet_directory() . '/lang' );
Where mydomain is the text domain which was specified in the phrases to be translated in the theme files, lang is the folder in your theme, where the translation files with .po and .mo extensions are stored.
So, if this base is ready, let’s consider point 3 at once, because it has more to do with the translation of the theme and plugins. With the Loco Translate plugin, you can not only translate phrases, but also create translation files with .po and .mo extensions for the desired language.
But for this, the theme or plugin must be properly prepared – Have a text domain in the phrases to translate.
The theme translation forms in the plugin look like this:
Now back to point 2 – Polylang plugin – this is what makes wordpress multilingual in this variant.
If you are installing wordpress from scratch, then translating existing content – records or articles – may not be need. But if you have existing content that needs to be translated, right after installing, the Polylang offer to install Lingotek plugin. Which is compatible with the Polylang plugin and offers different ways to translate, ranging from free to a paid subscription. In practice, in the free version, this plugin translates quite well, but requires manual correction.
To work it needs to be set up. You can sign up for the Lingotek service through the admin panel and then translate content can be simply by clicking a couple of clicks. For example, in the list of records appears an additional column of the plugin, where in the drop-down menu, select the stage of translation.
But, as mentioned above, the translation of the free version requires manual correction.
And then there is the final part of the multilingualism setup for wordpress – the plugin language switcher itself Polylang:
You will find a lot of information on the Internet on how to install this feature. In my own version, I will use language selector through a menu item by simply adding it to the right place in the menu:
In my case, my theme has support for menu items.
In general, according to this article – this option of installing multilingualism for WordPress is very practical and most importantly – does not require additional fees for plugins or their subscriptions. It supports optimal SEO. But it is also very time consuming. If we compare multilingual support in two different CMS prestashop and wordpress, then prestashop – having ready-made free functionality in its box and convenient built-in translation system – more comfortable than wordpress.