Blog

Articles about programming

Blog

Translating Wordpress templates with Google Translate Kit

04-05-2019

Translating Wordpress templates with Google Translate Kit When you buy a Wordpress template, it usually doesn't come translated into Spanish. Translations come in POT or PO files, in the "languages" folder, and they are usually very large files to do by hand. I'm going to explain how to do it easily with Google Translate Kit.

First, we choose a POT or PO file from those that come with the template. The POT is the "virgin file", which hasn't yet been translated into any language. This is the best, but there are templates that don't have it, which come directly with PO files that have already been translated. They would work just as well, but first we must open them with POedit and change the language in "Catalog" -> "Properties", select Spanish.
If we are going to use a POT, we must rename it to PO in order to upload it.

On the main screen of Google Translate Kit, click the "Upload" button.

Under "What would you like to translate?", select the PO file, set the source language to English.

Under "What languages do you want to translate into?", select Spanish.

Once this is done, we start the process. On the next screen, it tells us "Select a translation provider", click "No thanks".

We return to the main screen of Google Translate Kit. Our translation is already in the list, but it says 0% complete. Click on it.

You will enter an interface where the original string appears on the left and the translation proposed by Google on the right. Click the "Complete" button. It asks you "Are you sure you want to complete?" Yes.

Once that's done, go to File -> download, and it will download the PO file.

If we open the PO file with POedit, it is completely translated with Google's suggestions.

But you will see errors, since Google Translate makes mistakes with some special characters, so it still needs to be tweaked.

You can tweak it in POedit or with a "power" text editor, like Sublime Text or similar. Remember that a PO file is a text file.

The POedit, when trying to save the PO, will mark the errors in red, which is very good, the problem is that it does not mark them all at once, but rather it does so "by chapters", you solve some and when saving it marks others.

The most common change is the set \" as \ ", eliminate that space. Or in the original it says \" and in the translation it has eliminated the slash, you have to replace it.

Once finished, you just have to rename the PO file with the keyword of your language, in this case es_ES.po, and save it, which will generate the es_ES.mo, which is the file that you will upload to the template so that it takes the Spanish language.

Leave a comment

The comments sent by each user will always be visible in the corresponding post, and will not be used for any other purpose. The user has the right to access, rectify and suppress said comments, as reflected in our Privacy Policy