Multilingual site with Polylang
I’ve been thinking for a while to make this site available in Portuguese and English. Just needed a plugin for this, but I delayed the decision because I didn’t like the two options that I knew of too much.
One of the plugins, qTranslate, is free but I don’t like how it works, putting all the translations within the same post (with custom tags). Also, it can’t keep up with WordPress development. It happened to me not being able to update WordPress because of qTranslate. Incidentally, this seems to be happening right now. The plugin is not updated since January, and according to the information on the plugin page, does not work with the latest versions of WordPress.
The other option, WPML, is, I think, one of the most used solutions for multilingual WordPress sites and a very good one, for what I read. But it’s a paid plugin and I don’t know if it would justify the investment. While it is interesting to have this site in English, it wasn’t a priority.
The fact is that with a quick search, it was easy to find some alternatives. Of these, Polylang stood out. Seems to be fairly used (300 000 downloads) and in active development (last updated a few days ago).
Once configured and all the content translated, I wanted to leave here my first impressions about the plugin.
Pros
- Creates a post for each language and connects them as translations of the same article. This brings some advantages, in particular, each post has a unique link and isn’t necessary to indicate the language in the URL (although it is possible).
- It automatically creates a RSS feed for each language.
- In addition to the traditional widget, the language switcher can be added as a menu entry, which facilitates including it in the site.
- Widgets are not actually translated but we have the option, for each of them, to only show it in a certain language. The same with the menus. All menus areas are multiplied by the number of languages, after which we just need to create a menu for each.
- Various functions and filters for use in the theme, if necessary (the documentation is quite good).
Cons
- The workflow of writing and translating can be a tedious chore. The Polylang offers the possibility, among other things, to synchronize tags and categories between translations, but they must be translated first. Which means that, after writing the original post, we have to translate tags and categories (if they are new) before creating the translations. Moreover, the media pages (pictures) must also be translated before they are available to insert into the translations.
- It doesn’t translate slugs of custom post types. For example, the address for ‘zecipriano.com/trabalho’ is ‘zecipriano.com/en/trabalho’, instead of giving the possibility to translate to ‘zecipriano.com/work’.
Conclusion
WordPress was never intended for multilingual websites so no solution will be perfect, but, overall, I’m pleased with Polylang. Especially given that it’s a free plugin. Everything works as expected and the disadvantages turn out to be of little relevance.
Finally, note that in order to have a perfect translation is also necessary to create, if not exists yet, a translation of the theme. Using the functions gettext [__ (“string”)] and then translating, for instance, with the Localisation CodeStyling plugin.